:root {
    --bg-primary: #0A0A0A;
    --bg-secondary: #141414;
    --bg-card: #1A1A1A;
    --bg-hover: #242424;
    --bg-input: #0F0F0F;

    --gold-primary: #D4AF37;
    --gold-light: #F4D03F;
    --gold-dark: #B7950B;

    --text-primary: #FFFFFF;
    --text-secondary: #B0B0B0;
    --text-muted: #707070;
    --text-gold: #D4AF37;

    --border-gold: rgba(212, 175, 55, 0.3);
    --border-default: rgba(255, 255, 255, 0.1);
    --border-subtle: rgba(212, 175, 55, 0.2);

    --success: #27AE60;
    --warning: #F39C12;
    --error: #E74C3C;
    --info: #3498DB;

    --gradient-gold: linear-gradient(135deg, #D4AF37 0%, #F4D03F 100%);
    --gradient-header: linear-gradient(180deg, #0A0A0A 0%, #141414 100%);
    --gradient-card: linear-gradient(145deg, #1A1A1A 0%, #141414 100%);
    --gradient-button: linear-gradient(135deg, #D4AF37 0%, #B7950B 100%);

    --shadow-gold: 0 4px 20px rgba(212, 175, 55, 0.15);
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.4);
}

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

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--gold-primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--gold-light);
}

/* ============ Layout ============ */
.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    background: var(--gradient-header);
    border-right: 1px solid var(--border-gold);
    padding: 20px 0;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-logo {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-default);
    margin-bottom: 20px;
}

.sidebar-logo h1 {
    font-size: 18px;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    letter-spacing: 1px;
}

.sidebar-logo .subtitle {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.sidebar-nav {
    list-style: none;
}

.sidebar-nav li {
    margin: 2px 12px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--text-secondary);
    border-radius: 8px;
    transition: all 0.2s;
    font-size: 14px;
}

.sidebar-nav a:hover {
    background: var(--bg-hover);
    color: var(--gold-primary);
}

.sidebar-nav a.active {
    background: rgba(212, 175, 55, 0.1);
    color: var(--gold-primary);
    border-left: 3px solid var(--gold-primary);
}

.sidebar-nav .nav-icon {
    width: 20px;
    margin-right: 12px;
    text-align: center;
}

.sidebar-section-title {
    padding: 16px 24px 8px;
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.main-content {
    margin-left: 240px;
    flex: 1;
    padding: 32px;
    min-height: 100vh;
    overflow-x: auto;
}

.page-header {
    margin-bottom: 28px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-default);
}

.page-header h2 {
    font-size: 24px;
    color: var(--text-primary);
    font-weight: 600;
}

.page-header .breadcrumb {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* ============ Cards ============ */
.card {
    background: var(--gradient-card);
    border: 1px solid var(--border-default);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-card);
}

.card-gold {
    border-color: var(--border-gold);
    box-shadow: var(--shadow-gold);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-default);
}

.card-header h3 {
    font-size: 18px;
    color: var(--gold-primary);
}

/* ============ Login Page ============ */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at center, #1A1A1A 0%, #0A0A0A 100%);
    position: relative;
    overflow: hidden;
}

.login-wrapper::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.08) 0%, transparent 50%);
    animation: pulse 8s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.login-card {
    background: var(--gradient-card);
    border: 1px solid var(--border-gold);
    border-radius: 16px;
    padding: 48px 40px;
    width: 420px;
    box-shadow: var(--shadow-gold), 0 0 60px rgba(212, 175, 55, 0.1);
    position: relative;
    z-index: 1;
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo h1 {
    font-size: 28px;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    letter-spacing: 2px;
}

.login-logo .subtitle {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 8px;
    letter-spacing: 1px;
}

/* ============ Forms ============ */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 14px;
}

.form-label .required {
    color: var(--error);
    margin-left: 4px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--gold-primary);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.form-control::placeholder {
    color: var(--text-muted);
}

textarea.form-control {
    min-height: 80px;
    resize: vertical;
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23D4AF37'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 20px;
    padding-right: 36px;
}

/* ============ Buttons ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    gap: 8px;
}

.btn-primary {
    background: var(--gradient-button);
    color: #000;
    font-weight: 600;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-gold);
    color: #000;
}

.btn-secondary {
    background: var(--bg-hover);
    color: var(--text-primary);
    border: 1px solid var(--border-default);
}

.btn-secondary:hover {
    border-color: var(--gold-primary);
    color: var(--gold-primary);
}

.btn-danger {
    background: var(--error);
    color: #fff;
}

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-block {
    width: 100%;
}

/* ============ Table Type Cards ============ */
.type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.type-card {
    background: var(--gradient-card);
    border: 1px solid var(--border-default);
    border-radius: 12px;
    padding: 28px 24px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    color: var(--text-primary);
    position: relative;
    overflow: hidden;
}

.type-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-gold);
    transform: scaleX(0);
    transition: transform 0.3s;
}

.type-card:hover {
    transform: translateY(-4px);
    border-color: var(--gold-primary);
    box-shadow: var(--shadow-gold);
    color: var(--text-primary);
}

.type-card:hover::before {
    transform: scaleX(1);
}

.type-card .type-icon {
    font-size: 36px;
    margin-bottom: 16px;
    color: var(--gold-primary);
}

.type-card h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

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

.type-card .type-meta {
    color: var(--text-muted);
    font-size: 12px;
}

/* ============ Tables ============ */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 12px 16px;
    background: var(--bg-secondary);
    color: var(--gold-primary);
    font-weight: 600;
    font-size: 13px;
    border-bottom: 1px solid var(--border-gold);
    white-space: nowrap;
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-default);
    color: var(--text-secondary);
    font-size: 13px;
}

.data-table tr:hover td {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* ============ Status Badges ============ */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.badge-success { background: rgba(39, 174, 96, 0.15); color: var(--success); }
.badge-warning { background: rgba(243, 156, 18, 0.15); color: var(--warning); }
.badge-danger { background: rgba(231, 76, 60, 0.15); color: var(--error); }
.badge-info { background: rgba(52, 152, 219, 0.15); color: var(--info); }

/* ============ Alerts ============ */
.alert {
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 16px;
    border: 1px solid transparent;
}

.alert-danger { background: rgba(231, 76, 60, 0.1); border-color: var(--error); color: var(--error); }
.alert-success { background: rgba(39, 174, 96, 0.1); border-color: var(--success); color: var(--success); }
.alert-warning { background: rgba(243, 156, 18, 0.1); border-color: var(--warning); color: var(--warning); }
.alert-info { background: rgba(52, 152, 219, 0.1); border-color: var(--info); color: var(--info); }

/* ============ File Upload ============ */
.upload-zone {
    border: 2px dashed var(--border-default);
    border-radius: 12px;
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-input);
}

.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--gold-primary);
    background: rgba(212, 175, 55, 0.05);
}

.upload-zone .upload-icon {
    font-size: 48px;
    color: var(--gold-primary);
    margin-bottom: 16px;
}

.upload-zone .upload-text {
    color: var(--text-secondary);
    font-size: 14px;
}

.upload-zone .upload-hint {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 8px;
}

/* ============ Stats ============ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--gradient-card);
    border: 1px solid var(--border-default);
    border-radius: 12px;
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--gradient-gold);
}

.stat-card .stat-label {
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--gold-primary);
}

/* ============ Result Layout (两栏布局) ============ */
.result-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 20px;
    align-items: start;
}

.result-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: 20px;
}

.result-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.action-card {
    border: 2px solid var(--gold-primary);
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.08), var(--bg-card));
}

.action-buttons {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-full {
    width: 100%;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dashed var(--border-subtle);
    font-size: 13px;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    color: var(--text-muted);
    flex-shrink: 0;
}

.info-value {
    color: var(--text-secondary);
    text-align: right;
    margin-left: 12px;
    word-break: break-all;
}

.stat-block {
    padding: 16px 20px;
    border-bottom: 1px dashed var(--border-subtle);
}

.stat-block:last-child {
    border-bottom: none;
}

.stat-block-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.stat-block-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--gold-primary);
}

.card-danger {
    border-color: var(--error);
}

.card-danger .card-header h3 {
    color: var(--error);
}

/* 响应式：小屏下改为单列 */
@media (max-width: 900px) {
    .result-layout {
        grid-template-columns: 1fr;
    }
    .result-sidebar {
        position: static;
    }
}

/* ============ Pagination ============ */
.pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 24px;
    list-style: none;
}

.pagination a, .pagination span {
    padding: 8px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 13px;
}

.pagination a:hover {
    border-color: var(--gold-primary);
    color: var(--gold-primary);
}

.pagination .current {
    background: var(--gradient-button);
    color: #000;
    border-color: var(--gold-primary);
    font-weight: 600;
}

/* ============ Utilities ============ */
.text-gold { color: var(--gold-primary); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--error); }
.text-warning { color: var(--warning); }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 16px; }

/* ============ Preview Table ============ */
.preview-table-wrapper {
    overflow-x: auto;
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid var(--border-default);
    border-radius: 8px;
}

.preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.preview-table th {
    position: sticky;
    top: 0;
    background: var(--bg-secondary);
    padding: 8px 12px;
    color: var(--gold-primary);
    border-bottom: 1px solid var(--border-gold);
    text-align: left;
    white-space: nowrap;
}

.preview-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-default);
    color: var(--text-secondary);
    white-space: nowrap;
}

/* ============ Modal ============ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: var(--gradient-card);
    border: 1px solid var(--border-gold);
    border-radius: 12px;
    padding: 32px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-default);
}

.modal-header h3 {
    color: var(--gold-primary);
    font-size: 18px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--text-primary);
}

/* ============ Responsive ============ */
@media (max-width: 768px) {
    .sidebar {
        width: 60px;
    }
    .sidebar-logo h1, .sidebar-logo .subtitle,
    .sidebar-nav a span, .sidebar-section-title {
        display: none;
    }
    .main-content {
        margin-left: 60px;
        padding: 16px;
    }
    .type-grid {
        grid-template-columns: 1fr;
    }
    .login-card {
        width: 90%;
        padding: 32px 24px;
    }
}

/* ============ Compact Form (紧凑表单样式) ============ */
.compact-form .compact-card {
    padding: 14px 18px;
    margin-bottom: 12px;
}

.compact-form .compact-card .card-header {
    margin-bottom: 12px;
    padding-bottom: 10px;
}

.compact-form .compact-card .card-header h3 {
    font-size: 15px;
}

.compact-form .compact-group {
    margin-bottom: 8px;
}

.compact-form .compact-label {
    margin-bottom: 3px;
    font-size: 12px;
    color: var(--text-secondary);
}

.compact-form .compact-control {
    padding: 6px 10px;
    font-size: 13px;
    border-radius: 6px;
}

.compact-form select.compact-control {
    padding-right: 28px;
    background-size: 16px;
    background-position: right 6px center;
}

.compact-form textarea.compact-control {
    min-height: 50px;
}

.compact-form .page-header {
    margin-bottom: 16px;
    padding-bottom: 10px;
}

.compact-form .page-header h2 {
    font-size: 20px;
}
