/* 頂部導航 */
.header {
    height: 56px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    height: 100%;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 20px;
    font-weight: bold;
    color: var(--color-info);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.balance {
    font-size: 13px;
    color: var(--text-secondary);
}

.balance span {
    color: var(--color-success);
    font-weight: 500;
}

/* 主內容區 */
.main-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 60px;
}

/* 底部導航 */
.bottom-nav {
    height: 60px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-around;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--text-secondary);
    transition: color 0.2s;
    padding: 8px 0;
}

.nav-item svg {
    width: 24px;
    height: 24px;
}

.nav-item span {
    font-size: 11px;
}

.nav-item.active {
    color: var(--color-info);
}

/* 卡片 */
.card {
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* 按鈕 */
button {
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s;
}

button.btn-block {
    width: 100%;
}

button.btn-lg {
    padding: 14px 24px;
    font-size: 16px;
}

button.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* 輸入框 */
.input-group {
    margin-bottom: 16px;
}

.input-label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 13px;
}

input, textarea, select {
    width: 100%;
    padding: 10px 12px;
    border-radius: 6px;
    transition: all 0.2s;
}

/* 表格 */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th, table td {
    padding: 12px 8px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

table th {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
}

table td {
    color: var(--text-primary);
    font-size: 13px;
}

table tr:hover {
    background: var(--bg-hover);
}

/* 標籤 */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.badge-success {
    background: rgba(14, 203, 129, 0.15);
    color: var(--color-success);
}

.badge-danger {
    background: rgba(246, 70, 93, 0.15);
    color: var(--color-danger);
}

.badge-warning {
    background: rgba(255, 168, 0, 0.15);
    color: var(--color-warning);
}

.badge-info {
    background: rgba(50, 145, 255, 0.15);
    color: var(--color-info);
}

/* Tab 標籤頁 */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 16px;
}

.tab-item {
    padding: 12px 20px;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    font-weight: 500;
}

.tab-item:hover {
    color: var(--text-primary);
}

.tab-item.active {
    color: var(--color-info);
    border-bottom-color: var(--color-info);
}

/* Toast 提示 */
.toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    z-index: 10000;
    animation: fadeIn 0.3s ease;
    max-width: 90%;
}

.toast.success { border-left: 3px solid var(--color-success); }
.toast.error { border-left: 3px solid var(--color-danger); }
.toast.warning { border-left: 3px solid var(--color-warning); }
.toast.info { border-left: 3px solid var(--color-info); }

/* Modal 彈窗 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 16px;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.modal-close:hover {
    background: var(--bg-hover);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
}

/* Drawer 抽屜 */
.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
}

.drawer {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: 80%;
    max-width: 360px;
    background: var(--bg-secondary);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    animation: slideInRight 0.3s ease;
}

.drawer.closing {
    animation: slideOutRight 0.3s ease;
}

.drawer-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.drawer-title {
    font-size: 16px;
    font-weight: 600;
}

.drawer-close {
    width: 32px;
    height: 32px;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.drawer-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

/* 空狀態 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
}

/* 載入中 */
.loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.spinner {
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top-color: var(--color-info);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
