/* ============ Reset & Base ============ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #f5f6fa;
    --card-bg: #ffffff;
    --card-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
    --card-radius: 14px;
    --text-primary: #1a1a2e;
    --text-secondary: #555770;
    --text-muted: #8e90a6;
    --accent: #4361ee;
    --accent-light: #eef0ff;
    --border: #e8e8f0;
    --success: #2ec4b6;
    --danger: #e74c3c;
    --warning: #f39c12;
    --max-width: 960px;
    --gap: 16px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ============ Container ============ */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--gap);
    padding-bottom: 40px;
}

/* ============ Header ============ */
.header {
    text-align: center;
    padding: 32px 0 20px;
}

.header h1 {
    font-size: 26px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent), #7209b7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 1px;
}

.header .current-date {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* ============ Hero Row (60s + Bing 并排) ============ */
/* ============ Weather Bar ============ */
.weather-bar {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border-radius: var(--card-radius);
    padding: 12px 16px;
    margin-bottom: var(--gap);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px 12px;
    font-size: 13px;
    min-height: 48px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    line-height: 1.4;
}

.weather-bar .weather-loading {
    opacity: 0.7;
    font-size: 13px;
}

.weather-bar .weather-icon {
    font-size: 22px;
    flex-shrink: 0;
}

.weather-bar .weather-temp {
    font-weight: 600;
    font-size: 18px;
}

.weather-bar .weather-desc {
    opacity: 0.9;
}

.weather-bar .weather-humidity,
.weather-bar .weather-wind {
    opacity: 0.75;
    font-size: 12px;
}

.weather-bar .weather-error {
    color: #ffd93d;
    font-size: 13px;
}



/* ============ Section ============ */
.section {
    margin-bottom: 28px;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    padding-left: 4px;
}

/* ============ Cards Grid ============ */
.cards-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--gap);
}

@media (min-width: 640px) {
    .cards-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 860px) {
    .cards-grid.cols-3 {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

/* Full-width card override（独立使用或网格内均生效） */
.card.card-full {
    width: 100%;
    margin-bottom: var(--gap);
}

.cards-grid .card-full {
    grid-column: 1 / -1;
}

/* ============ Card ============ */
.card {
    background: var(--card-bg);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    transition: transform 0.15s, box-shadow 0.15s;
}

.card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px 0;
}

.card-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 12px 18px 18px;
}

.card-body:only-child {
    padding-top: 18px;
}

/* ============ Loading / Error / Placeholder ============ */
.loading {
    text-align: center;
    padding: 20px 0;
    color: var(--text-muted);
    font-size: 13px;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-left: 8px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-skeleton {
    padding: 8px 0;
}

.skeleton-line {
    height: 12px;
    background: linear-gradient(90deg, #eee 25%, #f5f5f5 50%, #eee 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 6px;
    margin-bottom: 8px;
}

.skeleton-line:last-child {
    width: 60%;
}

.skeleton-line.wide {
    width: 90%;
}

.skeleton-line.short {
    width: 40%;
}

.skeleton-image {
    height: 120px;
    background: linear-gradient(90deg, #eee 25%, #f5f5f5 50%, #eee 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
    margin-bottom: 8px;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.error-msg {
    text-align: center;
    padding: 16px 0;
    color: var(--danger);
    font-size: 13px;
}

.error-msg .retry-btn {
    display: inline-block;
    margin-top: 8px;
    padding: 4px 14px;
    border: 1px solid var(--danger);
    border-radius: 6px;
    background: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s;
}

.error-msg .retry-btn:hover {
    background: #fef0ef;
}

.placeholder {
    text-align: center;
    padding: 16px 0;
    color: var(--text-muted);
    font-size: 13px;
}

/* ============ Daily 60s ============ */
.news-list {
    list-style: none;
    counter-reset: news-counter;
}

.news-item {
    counter-increment: news-counter;
    position: relative;
    padding: 6px 0 6px 32px;
    font-size: 13.5px;
    line-height: 1.7;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}

.news-item:last-child {
    border-bottom: none;
}

.news-item::before {
    content: counter(news-counter);
    position: absolute;
    left: 0;
    top: 7px;
    width: 22px;
    height: 22px;
    background: var(--accent-light);
    color: var(--accent);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tip-block {
    margin-top: 12px;
    padding: 12px 16px;
    background: #fef9e7;
    border-left: 3px solid var(--warning);
    border-radius: 8px;
    font-size: 13px;
    color: #7d6608;
    line-height: 1.6;
}

.tip-label {
    font-weight: 600;
    margin-right: 4px;
}

/* ============ Row Duo（KFC + JS 趣味题 并排）============ */
.row-duo {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--gap);
    margin-bottom: var(--gap);
}

.row-duo .card {
    display: flex;
    flex-direction: column;
}

.row-duo .card .card-body {
    flex: 1;
}

@media (max-width: 640px) {
    .row-duo {
        grid-template-columns: 1fr;
    }
}

/* ============ Bing Wallpaper ============ */
.wallpaper-img {
    width: 100%;
    max-height: 360px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity 0.2s;
    display: block;
}

.wallpaper-img:hover {
    opacity: 0.92;
}

.wallpaper-desc {
    margin-top: 10px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.wallpaper-desc p {
    margin-bottom: 4px;
}

.wallpaper-desc p:last-child {
    margin-bottom: 0;
}

.wallpaper-copyright {
    font-size: 12px;
    color: var(--text-muted);
}

/* ============ Exchange Rate ============ */
.rate-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.rate-item:last-child {
    border-bottom: none;
}

.rate-currency {
    font-weight: 500;
    color: var(--text-primary);
}

.rate-value {
    color: var(--text-secondary);
    font-family: 'SF Mono', 'Consolas', monospace;
    font-size: 13px;
}

/* ============ Today in History ============ */
.history-list {
    list-style: none;
}

.history-item {
    position: relative;
    padding: 8px 0 8px 20px;
    border-left: 2px solid var(--accent-light);
    margin-left: 4px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.history-item::before {
    content: '';
    position: absolute;
    left: -5px;
    top: 13px;
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
}

.history-year {
    display: inline-block;
    font-weight: 600;
    color: var(--accent);
    font-size: 12px;
    margin-right: 6px;
}

/* ============ AI News ============ */
.ai-news-item {
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    line-height: 1.6;
}

.ai-news-item:last-child {
    border-bottom: none;
}

.ai-news-item a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.15s;
}

.ai-news-item a:hover {
    color: var(--accent);
}

/* ============ Tab Container ============ */
.hot-tabs {
    background: var(--card-bg);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

.tab-buttons {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    border-bottom: 1px solid var(--border);
    background: var(--card-bg);
}

.tab-buttons::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    flex-shrink: 0;
    padding: 10px 16px;
    border: none;
    background: none;
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.2s, border-color 0.2s;
    border-bottom: 2px solid transparent;
    font-family: inherit;
}

.tab-btn:hover {
    color: var(--text-secondary);
}

.tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    font-weight: 600;
}

.tab-content {
    padding: 16px 18px;
    min-height: 120px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* ============ Ranking List (for hot tabs) ============ */
.rank-list {
    list-style: none;
}

.rank-item {
    display: flex;
    align-items: flex-start;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    gap: 10px;
    font-size: 13px;
}

.rank-item:last-child {
    border-bottom: none;
}

.rank-num {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: var(--text-muted);
}

.rank-num.top-1 {
    background: #e74c3c;
}

.rank-num.top-2 {
    background: #e67e22;
}

.rank-num.top-3 {
    background: #f1c40f;
    color: #333;
}

.rank-title {
    flex: 1;
    line-height: 1.5;
}

.rank-title a {
    color: var(--text-secondary);
    text-decoration: none;
}

.rank-title a:hover {
    color: var(--accent);
}

.rank-hot {
    flex-shrink: 0;
    font-size: 11px;
    color: var(--text-muted);
    text-align: right;
    min-width: 40px;
}

/* Maoyan specific */
.maoyan-item {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    gap: 8px;
    font-size: 13px;
}

.maoyan-item:last-child {
    border-bottom: none;
}

.maoyan-info {
    flex: 1;
}

.maoyan-title {
    font-weight: 500;
    color: var(--text-primary);
}

.maoyan-stats {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* NCM specific */
.ncm-item {
    display: flex;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
    gap: 8px;
    font-size: 13px;
}

.ncm-item:last-child {
    border-bottom: none;
}

.ncm-rank {
    flex-shrink: 0;
    width: 20px;
    text-align: center;
    font-weight: 700;
    color: var(--text-muted);
    font-size: 12px;
}

.ncm-rank.top-1,
.ncm-rank.top-2,
.ncm-rank.top-3 {
    color: var(--accent);
}

.ncm-name {
    flex: 1;
}

.ncm-artist {
    font-size: 11px;
    color: var(--text-muted);
}

/* ============ Input Group ============ */
.input-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.input-group input,
.input-group select {
    flex: 1;
    min-width: 120px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--card-bg);
    outline: none;
    transition: border-color 0.2s;
}

.input-group input:focus,
.input-group select:focus {
    border-color: var(--accent);
}

.input-group button {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    white-space: nowrap;
    font-family: inherit;
}

.input-group button:hover {
    background: #3a56d4;
}

.input-group button:active {
    transform: scale(0.97);
}

/* ============ Result block ============ */
.result {
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    word-break: break-all;
}

.result img {
    max-width: 100%;
    border-radius: 8px;
    margin-top: 8px;
}

/* ============ Refresh Button ============ */
.refresh-btn {
    padding: 4px 12px;
    border: 1px solid var(--accent);
    border-radius: 6px;
    background: none;
    color: var(--accent);
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    font-family: inherit;
}

.refresh-btn:hover {
    background: var(--accent);
    color: #fff;
}

/* ============ Entertainment specific ============ */
.quote-text {
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-secondary);
    font-style: italic;
    text-align: center;
    padding: 8px 0;
}

.quote-source {
    text-align: right;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
}

.js-quiz-question {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.js-quiz-answer {
    font-size: 13px;
    color: var(--success);
    padding: 8px 12px;
    background: #f0fdf4;
    border-radius: 8px;
    margin-top: 6px;
    display: none;
}

.js-quiz-answer.show {
    display: block;
}

.js-quiz-toggle {
    display: inline-block;
    margin-top: 8px;
    padding: 4px 12px;
    border: 1px solid var(--success);
    border-radius: 6px;
    background: none;
    color: var(--success);
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s;
}

.js-quiz-toggle:hover {
    background: #f0fdf4;
}

.audio-wrapper {
    text-align: center;
}

.audio-wrapper audio {
    width: 100%;
    margin-top: 8px;
}

.audio-info {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* ============ Epic Free Games ============ */
.epic-game {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    align-items: flex-start;
}

.epic-game:last-child {
    border-bottom: none;
}

.epic-game img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.epic-game-info {
    flex: 1;
}

.epic-game-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.epic-game-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.epic-game-date {
    font-size: 11px;
    color: var(--success);
    margin-top: 4px;
}

.epic-game a {
    color: var(--accent);
    text-decoration: none;
    font-size: 12px;
}

.epic-game a:hover {
    text-decoration: underline;
}

/* ============ OG Info ============ */
.og-card {
    display: flex;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    align-items: flex-start;
}

.og-card img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.og-card-content {
    flex: 1;
    min-width: 0;
}

.og-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.og-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

.og-url {
    font-size: 11px;
    color: var(--accent);
    margin-top: 4px;
    word-break: break-all;
}

/* ============ Hash result ============ */
.hash-result-box {
    padding: 10px 14px;
    background: #f8f9fa;
    border-radius: 8px;
    font-family: 'SF Mono', 'Consolas', monospace;
    font-size: 12px;
    word-break: break-all;
    user-select: all;
    border: 1px solid var(--border);
    margin-top: 8px;
}

/* ============ Footer ============ */
.footer {
    text-align: center;
    padding: 24px 0 10px;
    border-top: 1px solid var(--border);
    margin-top: 20px;
}

.footer p {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}
