/* ========================================
   Rate Card System - Professional Theme
   ======================================== */

:root {
    --rc-primary: #1a2332;
    --rc-secondary: #2c3e50;
    --rc-accent: #3498db;
    --rc-accent-hover: #2980b9;
    --rc-bg: #f5f6fa;
    --rc-card-bg: #ffffff;
    --rc-border: #e1e4e8;
    --rc-text: #2c3e50;
    --rc-text-muted: #7f8c8d;
    --rc-success: #27ae60;
    --rc-danger: #e74c3c;
    --rc-warning: #f39c12;
    --rc-info: #3498db;
}

body {
    background-color: var(--rc-bg);
    color: var(--rc-text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.875rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navbar */
.navbar {
    background: var(--rc-primary) !important;
    border-bottom: 2px solid var(--rc-accent);
    padding: 0.4rem 1rem;
}
.navbar-brand {
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.5px;
}
.nav-link {
    font-size: 0.8125rem;
    padding: 0.5rem 0.75rem !important;
}

/* Cards */
.card {
    border: 1px solid var(--rc-border);
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.card-header {
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.6rem 1rem;
    letter-spacing: 0.3px;
}

/* Tables */
.table {
    font-size: 0.8125rem;
    margin-bottom: 0;
}
.table th {
    font-weight: 600;
    white-space: nowrap;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--rc-border);
    padding: 0.5rem 0.6rem;
}
.table td {
    vertical-align: middle;
    padding: 0.4rem 0.6rem;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.table td:hover {
    overflow: visible;
    white-space: normal;
    word-break: break-all;
}
.table-responsive {
    max-height: 65vh;
    overflow-y: auto;
}
.table thead {
    position: sticky;
    top: 0;
    z-index: 1;
}
.table-dark {
    background: var(--rc-secondary) !important;
}
.table-dark th {
    background: var(--rc-secondary) !important;
    color: #ecf0f1;
    border-bottom-color: var(--rc-accent);
}

/* Buttons */
.btn {
    font-size: 0.8125rem;
    border-radius: 4px;
    font-weight: 500;
}
.btn-primary {
    background: var(--rc-accent);
    border-color: var(--rc-accent);
}
.btn-primary:hover {
    background: var(--rc-accent-hover);
    border-color: var(--rc-accent-hover);
}

/* Forms */
.form-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--rc-text-muted);
    margin-bottom: 0.25rem;
}
.form-select, .form-control {
    font-size: 0.8125rem;
    border-radius: 4px;
    border-color: var(--rc-border);
}
.form-select:focus, .form-control:focus {
    border-color: var(--rc-accent);
    box-shadow: 0 0 0 2px rgba(52,152,219,0.15);
}

/* Badges */
.badge {
    font-weight: 500;
    font-size: 0.7rem;
    letter-spacing: 0.3px;
    padding: 0.3em 0.6em;
    border-radius: 3px;
}

/* Pagination */
.pagination {
    margin-bottom: 0;
}
.page-link {
    font-size: 0.8125rem;
    min-width: 36px;
    text-align: center;
    color: var(--rc-text);
    border-color: var(--rc-border);
}
.page-item.active .page-link {
    background: var(--rc-accent);
    border-color: var(--rc-accent);
}

/* Footer */
.footer {
    margin-top: auto;
    border-top: 1px solid var(--rc-border);
    font-size: 0.75rem;
    color: var(--rc-text-muted);
}

/* Alerts */
.alert {
    border-radius: 4px;
    font-size: 0.8125rem;
}

/* Stat cards (dashboard/compare) */
.stat-card {
    transition: all 0.15s ease;
    cursor: pointer;
}
.stat-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.stat-card h3, .stat-card h4, .stat-card h2 {
    font-weight: 700;
}

/* Compare page specifics — 涨价=绿色↑  降价=红色↓ */
.diff-up { color: var(--rc-success); font-weight: 600; }
.diff-down { color: var(--rc-danger); font-weight: 600; }
.diff-zero { color: var(--rc-text-muted); }
.pct-badge {
    font-size: 0.7rem;
    padding: 1px 5px;
    border-radius: 3px;
    font-weight: 600;
}
.pct-up { background: #fde8e8; color: #c0392b; }
.pct-down { background: #e8f8f0; color: #1e8449; }
.price-cell {
    text-align: right;
    font-family: 'SF Mono', 'Consolas', 'Courier New', monospace;
    font-size: 0.8rem;
}
.route-cell {
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.filter-row {
    background: #f8f9fa;
    padding: 10px 14px;
    border-radius: 4px;
    border: 1px solid var(--rc-border);
}

/* Feature cards (index.html) */
.card-hover {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card-hover:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* Loading */
.loading-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(255,255,255,0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* Responsive */
@media (max-width: 768px) {
    .table th, .table td {
        font-size: 0.7rem;
        padding: 0.3rem;
    }
    .btn-group .btn {
        min-width: 70px;
        font-size: 0.8rem;
    }
}

/* Radio button groups */
.btn-check:checked + .btn-outline-primary {
    background: var(--rc-accent);
    border-color: var(--rc-accent);
    color: #fff;
}
.btn-check:checked + .btn-outline-success {
    background: var(--rc-success);
    border-color: var(--rc-success);
    color: #fff;
}
.btn-check:checked + .btn-outline-light {
    background: #fff;
    color: var(--rc-secondary);
}

/* Notification items */
.notification-item {
    border-bottom: 1px solid var(--rc-border);
    padding: 12px 16px;
    transition: background 0.1s;
}
.notification-item:hover {
    background: #f8f9fa;
}
.notification-item.unread {
    background: #f0f7ff;
    border-left: 3px solid var(--rc-accent);
}

/* Modal */
.modal-header {
    padding: 0.75rem 1rem;
}
.modal-title {
    font-size: 0.9rem;
    font-weight: 600;
}

/* Compare price cell layout */
.pc-old {
    color: var(--rc-text-muted);
    font-size: 0.75rem;
    text-decoration: line-through;
    line-height: 1.2;
}
.pc-new {
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.2;
}
.pc-diff {
    font-size: 0.7rem;
    line-height: 1.3;
    margin-top: 1px;
}
.pc-pct {
    opacity: 0.85;
}
.pc-unchanged {
    color: var(--rc-text-muted);
    font-size: 0.8125rem;
}

/* Excel-style column filters */
.excel-thead {
    position: sticky;
    top: 0;
    z-index: 10;
}
.excel-thead th {
    background: var(--rc-secondary) !important;
    color: #ecf0f1;
    border-bottom: 2px solid var(--rc-accent);
    padding: 0 !important;
    vertical-align: top;
}
.excel-th-inner {
    padding: 6px 4px 2px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}
.excel-th-filter {
    padding: 0 3px 4px;
}
.excel-th-filter select,
.excel-th-filter input {
    font-size: 0.7rem;
    padding: 1px 4px;
    height: 24px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.1);
    color: #ecf0f1;
    border-radius: 2px;
    width: 100%;
    min-width: 60px;
    max-width: none;
    text-overflow: ellipsis;
}
.excel-th-filter select {
    position: relative;
    overflow: visible;
}
.excel-thead th {
    overflow: visible !important;
}
.excel-th-filter select:focus,
.excel-th-filter input:focus {
    background: rgba(255,255,255,0.95);
    color: var(--rc-text);
    border-color: var(--rc-accent);
    outline: none;
}
.excel-th-filter select option {
    color: var(--rc-text);
    background: #fff;
}
.excel-count {
    font-size: 0.7rem;
    color: var(--rc-text-muted);
    padding: 4px 8px;
    background: #f8f9fa;
    border-bottom: 1px solid var(--rc-border);
}

/* #33 — Active nav link styling */
.navbar-nav .nav-link.active {
    font-weight: 600;
    border-bottom: 2px solid #fff;
    padding-bottom: 6px;
}
