/* ── 艾丽斯珠宝主页 · 黑白金风格 · 平板常亮仪表盘 ── */

/* ═══════════════════════════════════════════════
   CSS 变量 — 双主题
   ═══════════════════════════════════════════════ */
:root {
    --touch-min: 44px;
}

/* 黑夜模式（默认） */
[data-theme="dark"] {
    --bg:        #1C1917;
    --bg2:       #2a2520;
    --surface:   rgba(0,0,0,0.5);
    --surface2:  rgba(255,255,255,0.02);
    --text:      #ffffff;
    --text-muted:#8c8c8c;
    --gold:      #CA8A04;
    --gold-light:#E5A810;
    --gold-dark: #A66E00;
    --border:    rgba(202,138,4,0.15);
    --border-btn:rgba(202,138,4,0.2);
    --shadow:    rgba(202,138,4,0.12);
    --cat-gold-bg:   rgba(202,138,4,0.18);
    --cat-gold-text: #E5A810;
    --cat-gold-border: rgba(202,138,4,0.25);
    --cat-red-bg:    rgba(220,38,38,0.12);
    --cat-red-text:  #fca5a5;
    --cat-red-border: rgba(220,38,38,0.2);
    --cat-blue-bg:   rgba(37,99,235,0.12);
    --cat-blue-text: #93c5fd;
    --cat-blue-border: rgba(37,99,235,0.2);
    --cat-purple-bg:  rgba(147,51,234,0.12);
    --cat-purple-text:#d8b4fe;
    --cat-purple-border: rgba(147,51,234,0.2);
    --summary-bg:  rgba(202,138,4,0.05);
    --summary-border: rgba(202,138,4,0.35);
    --dot-bg:      rgba(202,138,4,0.25);
    --btn-hover-bg: rgba(202,138,4,0.06);
    --btn-active-bg:rgba(202,138,4,0.1);
    --silver:      #c0c0c0;
}

/* 白天模式 */
[data-theme="light"] {
    --bg:        #F5F0E8;
    --bg2:       #EDE5D8;
    --surface:   rgba(255,255,255,0.75);
    --surface2:  rgba(0,0,0,0.02);
    --text:      #1C1917;
    --text-muted:#7a7268;
    --gold:      #B8860B;
    --gold-light:#9A7000;
    --gold-dark: #7A5800;
    --border:    rgba(184,134,11,0.25);
    --border-btn:rgba(184,134,11,0.35);
    --shadow:    rgba(184,134,11,0.15);
    --cat-gold-bg:   rgba(184,134,11,0.12);
    --cat-gold-text: #8B6508;
    --cat-gold-border: rgba(184,134,11,0.3);
    --cat-red-bg:    rgba(220,38,38,0.08);
    --cat-red-text:  #b91c1c;
    --cat-red-border: rgba(220,38,38,0.2);
    --cat-blue-bg:   rgba(37,99,235,0.08);
    --cat-blue-text: #1d4ed8;
    --cat-blue-border: rgba(37,99,235,0.2);
    --cat-purple-bg:  rgba(147,51,234,0.08);
    --cat-purple-text:#7c3aed;
    --cat-purple-border: rgba(147,51,234,0.2);
    --summary-bg:  rgba(184,134,11,0.06);
    --summary-border: rgba(184,134,11,0.4);
    --dot-bg:      rgba(184,134,11,0.2);
    --btn-hover-bg: rgba(184,134,11,0.08);
    --btn-active-bg:rgba(184,134,11,0.14);
    --silver:      #8c8c8c;
}

/* ── 全局重置 ──────────────────────────────────── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    overscroll-behavior: contain;
    transition: background 0.5s ease, color 0.5s ease;
}

a {
    color: inherit;
    text-decoration: none;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: linear-gradient(160deg, var(--bg) 0%, var(--bg2) 50%, var(--bg) 100%);
}

/* ── Focus 态 ──────────────────────────────────── */
:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 3px;
    border-radius: 4px;
}

button:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

/* ═══════════════════════════════════════════════
   顶部栏
   ═══════════════════════════════════════════════ */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 28px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    transition: background 0.5s ease, border-color 0.5s ease;
}

.top-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo-small {
    height: 38px;
    width: auto;
    border-radius: 6px;
}

.shop-name {
    font-family: "Microsoft YaHei", serif;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--gold-light);
    letter-spacing: 2px;
    transition: color 0.5s ease;
}

/* 日夜切换按钮 */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-btn);
    border-radius: 50%;
    background: var(--surface2);
    cursor: pointer;
    color: var(--gold-light);
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent;
    padding: 0;
}

.theme-toggle:hover {
    border-color: var(--gold);
    background: var(--btn-hover-bg);
}

.theme-toggle .svg-icon {
    width: 20px;
    height: 20px;
    transition: transform 0.4s ease;
}

.theme-toggle:active .svg-icon {
    transform: rotate(30deg);
}

.top-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.metal-price {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.metal-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.metal-value {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 1px;
    font-family: "Helvetica Neue", sans-serif;
}

.metal-unit {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.metal-price.gold .metal-value {
    color: var(--gold);
}

.metal-price.silver .metal-value {
    color: var(--silver);
}

/* 金价实时指示灯 */
.price-live {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gold);
    display: inline-block;
    animation: pulse-dot 2s ease-in-out infinite;
    margin-right: 2px;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; box-shadow: 0 0 4px var(--gold); }
    50%      { opacity: 0.4; box-shadow: 0 0 10px var(--gold); }
}

.price-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-left: 2px;
}

/* ═══════════════════════════════════════════════
   中央主区 — 新闻轮播
   ═══════════════════════════════════════════════ */
.news-stage {
    flex: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 40px;
    position: relative;
    min-height: 0;
}

.news-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.news-header .svg-icon {
    width: 24px;
    height: 24px;
    color: var(--gold-light);
}

.news-title-label {
    font-family: "Microsoft YaHei", serif;
    font-size: 1.1rem;
    color: var(--gold-light);
    letter-spacing: 3px;
    font-weight: 600;
}

.news-stage-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.news-carousel {
    position: relative;
    width: 100%;
    max-width: 900px;
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 整条新闻横条左右翻页区 */
.stage-tap {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 30%;
    background: transparent;
    border: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    outline: none;
    z-index: 10;
}

.stage-tap-left { left: 0; }
.stage-tap-right { right: 0; }

.news-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 24px 44px;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.6s ease, transform 0.6s ease;
    pointer-events: none;
    text-align: center;
}

.news-item.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.news-link {
    display: block;
}

.news-text {
    font-family: "Microsoft YaHei", serif;
    font-size: 1.7rem;
    font-weight: 600;
    line-height: 1.6;
    color: var(--text);
    letter-spacing: 1px;
    transition: color 0.3s;
}

.news-link:hover .news-text,
.news-link:active .news-text {
    color: var(--gold-light);
}

.news-source {
    font-size: 0.9rem;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.news-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.7;
    margin-top: 2px;
}

/* DeepSeek 增强摘要 */
.news-summary {
    font-size: 1rem;
    color: var(--gold-light);
    letter-spacing: 1px;
    max-width: 700px;
    line-height: 1.6;
    margin-top: 8px;
    padding: 8px 18px;
    border-left: 3px solid var(--summary-border);
    background: var(--summary-bg);
    border-radius: 0 6px 6px 0;
}

/* 新闻类目标签 */
.news-cat {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 10px;
    text-transform: uppercase;
    font-family: "Microsoft YaHei", sans-serif;
}

.cat-金价行情 {
    background: var(--cat-gold-bg);
    color: var(--cat-gold-text);
    border: 1px solid var(--cat-gold-border);
}

.cat-品牌消费 {
    background: var(--cat-red-bg);
    color: var(--cat-red-text);
    border: 1px solid var(--cat-red-border);
}

.cat-行业政策 {
    background: var(--cat-blue-bg);
    color: var(--cat-blue-text);
    border: 1px solid var(--cat-blue-border);
}

.cat-时尚设计 {
    background: var(--cat-purple-bg);
    color: var(--cat-purple-text);
    border: 1px solid var(--cat-purple-border);
}

/* 新闻指示点 */
.news-dots {
    display: flex;
    gap: 4px;
    margin-top: 60px;
    padding: 6px 4px;
}

.dot {
    width: var(--touch-min);
    height: var(--touch-min);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.3s;
}

.dot::after {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--dot-bg);
    transition: all 0.3s ease;
}

.dot:hover::after,
.dot:active::after {
    background: var(--gold-light);
    box-shadow: 0 0 8px var(--shadow);
}

.dot.active::after {
    background: var(--gold);
    box-shadow: 0 0 8px var(--shadow);
}

.news-empty {
    color: var(--text-muted);
    font-size: 1.1rem;
    font-family: "Microsoft YaHei", "PingFang SC", serif;
}

/* ═══════════════════════════════════════════════
   底部栏
   ═══════════════════════════════════════════════ */
.bottom-bar {
    flex: 5;
    padding: 24px 28px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.5s ease, border-color 0.5s ease;
}

.bottom-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
}

/* 时钟 */
.clock {
    font-family: "Helvetica Neue", sans-serif;
    font-size: 2.4rem;
    font-weight: 700;
    letter-spacing: 4px;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

/* 系统入口按钮 */
.nav-buttons {
    display: flex;
    gap: 40px;
}

.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    width: 200px;
    height: 176px;
    border: 2px solid var(--border-btn);
    border-radius: 16px;
    background: var(--surface2);
    transition: all 0.3s ease;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.nav-btn .svg-icon {
    width: 44px;
    height: 44px;
    color: var(--gold-light);
    transition: color 0.3s, transform 0.3s;
}

.nav-btn .btn-label {
    font-family: "Microsoft YaHei", sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--gold-light);
    letter-spacing: 2px;
    transition: color 0.3s;
}

/* hover — 仅在有 hover 能力的设备上生效 */
@media (hover: hover) {
    .nav-btn:hover {
        border-color: var(--gold);
        background: var(--btn-hover-bg);
        transform: translateY(-3px);
        box-shadow: 0 6px 24px var(--shadow);
    }

    .nav-btn:hover .svg-icon {
        color: var(--gold);
        transform: scale(1.05);
    }

    .nav-btn:hover .btn-label {
        color: var(--gold);
    }

    .news-link:hover .news-text {
        color: var(--gold-light);
    }
}

/* active — 触摸按下反馈 */
.nav-btn:active {
    border-color: var(--gold);
    background: var(--btn-active-bg);
    transform: scale(0.97);
    box-shadow: none;
}

/* ── 省电模式 ────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .news-item { transition: none; }
    .price-live { animation: none; }
    * {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ═══════════════════════════════════════════════
   响应式 — 竖屏/手机
   ═══════════════════════════════════════════════ */
@media (max-width: 768px) {
    .top-bar {
        padding: 10px 16px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .logo-small { height: 28px; }
    .shop-name { font-size: 0.9rem; }
    .metal-value { font-size: 1.15rem; }

    .news-stage { padding: 30px 20px; }
    .news-text { font-size: 1.3rem; }
    .news-carousel { min-height: 120px; }
    .news-item { padding: 16px 24px; }

    .clock { font-size: 1.8rem; }

    .nav-buttons { flex-wrap: wrap; justify-content: center; gap: 20px; }
    .nav-btn { width: 150px; height: 136px; }
    .nav-btn .svg-icon { width: 34px; height: 34px; }
}

@media (max-width: 480px) {
    .top-right { gap: 10px; }
    .metal-value { font-size: 1rem; }
    .news-text { font-size: 1.1rem; }
    .news-item { padding: 10px 16px; }
    .nav-btn { width: 120px; height: 110px; }
    .nav-btn .svg-icon { width: 28px; height: 28px; }
    .nav-btn .btn-label { font-size: 0.95rem; }
}
