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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #0d1117;
    color: #c9d1d9;
    line-height: 1.6;
    -webkit-text-size-adjust: 100%;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid #21262d;
    margin-bottom: 24px;
}

.header h1 {
    font-size: 24px;
    font-weight: 600;
    color: #f0f6fc;
}

.update-status {
    font-size: 14px;
    color: #3fb950;
    display: flex;
    align-items: center;
    gap: 8px;
}

.update-status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #3fb950;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.card {
    background: #161b22;
    border: 1px solid #21262d;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.card-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: #f0f6fc;
}

.auto-refresh {
    font-size: 12px;
    color: #8b949e;
}

/* 估值卡片 */
.estimate-card {
    background: linear-gradient(135deg, #161b22 0%, #1a2332 100%);
    border-color: #30363d;
}

.estimate-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 30px;
}

.estimate-main {
    text-align: center;
}

.nav-value {
    font-size: 56px;
    font-weight: 700;
    color: #f0f6fc;
    line-height: 1.2;
}

.nav-label {
    font-size: 14px;
    color: #8b949e;
    margin-top: 8px;
}

.estimate-details {
    display: flex;
    gap: 40px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-label {
    font-size: 12px;
    color: #8b949e;
}

.detail-value {
    font-size: 20px;
    font-weight: 600;
    color: #f0f6fc;
}

.change-pct.positive { color: #f85149; }
.change-pct.negative { color: #3fb950; }
.change-pct.flat { color: #8b949e; }

/* 图表 */
.chart-container {
    height: 300px;
    position: relative;
}

.chart-summary {
    text-align: center;
    padding: 12px 0 0;
    font-size: 13px;
    color: #8b949e;
    border-top: 1px solid #21262d;
    margin-top: 12px;
}

.intraday-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.date-select {
    padding: 6px 12px;
    font-size: 13px;
    background: #21262d;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #c9d1d9;
    cursor: pointer;
    outline: none;
}

.date-select:focus {
    border-color: #1f6feb;
}

.market-hours {
    font-size: 12px;
    color: #8b949e;
}

/* 时间范围按钮 */
.time-range-buttons {
    display: flex;
    gap: 8px;
}

.range-btn {
    padding: 6px 16px;
    font-size: 13px;
    background: #21262d;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #c9d1d9;
    cursor: pointer;
    transition: all 0.2s;
}

.range-btn:hover {
    background: #30363d;
    border-color: #484f58;
}

.range-btn.active {
    background: #1f6feb;
    border-color: #1f6feb;
    color: #fff;
}

/* 股票表格 */
.stock-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.stock-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.stock-table th,
.stock-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid #21262d;
    white-space: nowrap;
}

.stock-table th {
    background: #0d1117;
    color: #8b949e;
    font-weight: 600;
    position: sticky;
    top: 0;
}

.stock-table tbody tr:hover {
    background: #1c2333;
}

.stock-table tbody tr:last-child td {
    border-bottom: none;
}

.loading {
    text-align: center;
    color: #8b949e;
    padding: 40px !important;
}

.stock-name {
    font-weight: 500;
    color: #f0f6fc;
}

.stock-code {
    color: #8b949e;
}

.weight-badge {
    background: #21262d;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 13px;
}

.footer {
    text-align: center;
    padding: 24px 0;
    color: #484f58;
    font-size: 13px;
}

/* ========== 手机适配 ========== */
@media (max-width: 768px) {
    .container {
        padding: 12px;
    }

    /* Header */
    .header {
        flex-direction: column;
        gap: 8px;
        text-align: center;
        padding: 14px 0;
        margin-bottom: 16px;
    }

    .header h1 {
        font-size: 17px;
        line-height: 1.3;
    }

    .update-status {
        font-size: 12px;
    }

    /* Card */
    .card {
        padding: 16px;
        margin-bottom: 14px;
        border-radius: 10px;
    }

    .card-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
        margin-bottom: 14px;
    }

    .card-header h2 {
        font-size: 15px;
    }

    /* 估值卡片 */
    .estimate-content {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }

    .nav-value {
        font-size: 40px;
    }

    .nav-label {
        font-size: 12px;
    }

    .estimate-details {
        gap: 20px;
        justify-content: center;
    }

    .detail-value {
        font-size: 16px;
    }

    /* 分时控制栏 */
    .intraday-controls {
        width: 100%;
        justify-content: space-between;
    }

    .date-select {
        flex: 1;
        max-width: 180px;
        font-size: 12px;
        padding: 6px 8px;
    }

    /* 图表 */
    .chart-container {
        height: 220px;
        margin: 0 -8px;
    }

    .chart-summary {
        font-size: 11px;
        padding: 10px 0 0;
    }

    /* 时间范围按钮 */
    .time-range-buttons {
        flex-wrap: wrap;
        gap: 6px;
    }

    .range-btn {
        padding: 5px 12px;
        font-size: 12px;
    }

    /* 股票表格 */
    .stock-table th,
    .stock-table td {
        padding: 10px 10px;
        font-size: 12px;
    }

    .weight-badge {
        font-size: 11px;
        padding: 3px 8px;
    }

    /* Footer */
    .footer {
        padding: 16px 0;
        font-size: 11px;
    }
}

/* 超小屏 (iPhone SE等) */
@media (max-width: 375px) {
    .container {
        padding: 8px;
    }

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

    .header h1 {
        font-size: 15px;
    }

    .nav-value {
        font-size: 34px;
    }

    .estimate-details {
        gap: 14px;
    }

    .detail-label {
        font-size: 11px;
    }

    .detail-value {
        font-size: 14px;
    }

    .chart-container {
        height: 180px;
    }
}
