/* macOS 风格主题 */
:root {
    --bg-primary: #F5F5F7;
    --bg-secondary: #FFFFFF;
    --bg-tertiary: #E8E8ED;
    --sidebar-bg: #F5F5F7;
    --card-bg: #FFFFFF;
    --blue: #007AFF;
    --blue-hover: #0051D5;
    --green: #34C759;
    --red: #FF3B30;
    --orange: #FF9500;
    --purple: #AF52DE;
    --text-primary: #1D1D1F;
    --text-secondary: #86868B;
    --text-tertiary: #AEAEB2;
    --border: #D2D2D7;
    --border-light: #E5E5EA;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.06);
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 10px;
    --font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "Microsoft YaHei", sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
}

.app {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* 侧边栏 */
.sidebar {
    width: 220px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    padding: 20px 0;
}

.sidebar-header {
    padding: 0 20px 24px;
}

.logo {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.sidebar-nav {
    flex: 1;
    padding: 0 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 10px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-bottom: 4px;
}

.nav-item:hover {
    background: rgba(0,0,0,0.04);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--blue);
    color: white;
}

.nav-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-light);
}

.user-badge {
    font-size: 13px;
    color: var(--text-tertiary);
}

/* 主内容区 */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 32px 40px;
}

.page {
    display: none;
    max-width: 1200px;
    margin: 0 auto;
}

.page.active {
    display: block;
}

.page-header {
    margin-bottom: 28px;
}

.page-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.page-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
}

/* 卡片 */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.card-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.card-full {
    margin-top: 20px;
}

.cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.cards-grid.half {
    grid-template-columns: 1fr 1fr;
}

/* 拖放区 */
.drop-zone {
    background: var(--bg-tertiary);
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    min-height: 130px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.drop-zone:hover, .drop-zone.drag-over {
    background: rgba(0,122,255,0.06);
    border-color: var(--blue);
}

.drop-zone.has-file {
    border-style: solid;
    border-color: var(--green);
}

.drop-zone-icon {
    font-size: 32px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.drop-zone.has-file .drop-zone-icon {
    color: var(--green);
}

.drop-zone-title {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.drop-zone-subtitle {
    font-size: 13px;
    color: var(--text-tertiary);
}

.file-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.file-status {
    font-size: 13px;
    color: var(--text-tertiary);
    margin: 10px 0;
    min-height: 18px;
}

.file-status.has-file {
    color: var(--green);
}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    padding: 0 22px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--blue);
    color: white;
}

.btn-primary:hover {
    background: var(--blue-hover);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: #D2D2D7;
}

.btn-ghost {
    background: transparent;
    color: var(--blue);
}

.btn-ghost:hover {
    background: rgba(0,122,255,0.08);
}

/* 表单 */
.form-row {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-input, .form-select {
    height: 40px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    font-family: var(--font-family);
    font-size: 15px;
    color: var(--text-primary);
    outline: none;
    min-width: 180px;
}

.form-input:focus, .form-select:focus {
    border-color: var(--blue);
    background: white;
}

.input-tip {
    font-size: 13px;
    color: var(--text-tertiary);
}

.flex-grow {
    flex: 1;
}

/* 进度条 */
.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--border-light);
    border-radius: 3px;
    margin: 16px 0;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--blue);
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 0%;
}

/* 操作栏 */
.action-bar {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
}

/* 统计卡片 */
.stats-bar {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 14px 20px;
    min-width: 140px;
    text-align: center;
    flex: 1;
}

.stat-name {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

/* 表格 */
.table-card {
    padding: 12px;
    overflow: hidden;
}

.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-md);
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
}

.data-table thead th {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    padding: 12px 14px;
    text-align: center;
    font-weight: 600;
    border-bottom: 1px solid var(--border-light);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
}

.data-table thead th:first-child {
    border-top-left-radius: var(--radius-md);
}

.data-table thead th:last-child {
    border-top-right-radius: var(--radius-md);
}

.data-table tbody td {
    padding: 10px 14px;
    text-align: center;
    border-bottom: 1px solid var(--border-light);
    white-space: nowrap;
}

.data-table tbody tr:nth-child(even) {
    background: rgba(0,0,0,0.015);
}

.data-table tbody tr:hover {
    background: rgba(0,122,255,0.04);
}

.empty-row td {
    color: var(--text-secondary);
    padding: 40px;
    text-align: center;
}

.wow-up {
    color: var(--green);
    font-weight: 600;
}

.wow-down {
    color: var(--red);
    font-weight: 600;
}

/* 滚动条 */
.main-content::-webkit-scrollbar {
    width: 8px;
}

.main-content::-webkit-scrollbar-track {
    background: transparent;
}

.main-content::-webkit-scrollbar-thumb {
    background: var(--text-tertiary);
    border-radius: 4px;
}

.main-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* 响应式 */
@media (max-width: 960px) {
    .cards-grid {
        grid-template-columns: 1fr;
    }
    .sidebar {
        width: 64px;
    }
    .nav-text, .logo {
        display: none;
    }
    .nav-item {
        justify-content: center;
        padding: 12px;
    }
    .main-content {
        padding: 20px;
    }
}
