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

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

/* 黑夜模式（默认） */
[data-theme="dark"] {
    --bg:        #1C1917;
    --bg2:       #2a2520;
    --surface:   rgba(0,0,0,0.85);
    --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.35);
    --border-btn:rgba(202,138,4,0.3);
    --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%;
    height: 100dvh;
    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: pan-x pan-y;
    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;
    min-height: 100dvh;
    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;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: opacity 0.2s;
}
.metal-price:hover {
    opacity: 0.8;
}

.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); }
}

.metal-group {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}
.metal-row {
    display: flex;
    align-items: center;
    gap: 24px;
}
.price-time {
    font-size: 0.65rem;
    color: var(--text-muted);
}

/* ═══════════════════════════════════════════════
   中央主区 — 新闻轮播
   ═══════════════════════════════════════════════ */
.news-stage {
    flex: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 40px;
    position: relative;
    min-height: 0;
    background: var(--surface2);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.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 {
    width: 100%;
    max-width: 1100px;
}

/* ── Swiper 容器（自写最小 CSS，不依赖 CDN）────── */
.news-swiper {
    width: 100%;
    overflow: hidden;
    padding-bottom: 40px;
    position: relative;
}
.news-swiper .swiper-wrapper {
    display: flex !important;
    align-items: stretch;
}
.news-swiper .swiper-slide {
    flex-shrink: 0 !important;
    width: 100% !important;
    height: auto !important;
    display: flex !important;
    position: relative;
}

/* ── 横向新闻卡片 ─────────────────────────────── */
.news-card {
    display: flex;
    align-items: stretch;
    gap: 16px;
    width: 100%;
    padding: 20px 24px;
    background: var(--summary-bg);
    border: 1px solid var(--summary-border);
    border-radius: 12px;
    box-sizing: border-box;
    min-height: 170px;
}
.news-card .news-cat {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-family: "Microsoft YaHei", sans-serif;
    min-width: 64px;
    text-align: center;
    align-self: stretch;
}
.news-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    overflow: hidden;
}
.news-card-body .news-link {
    display: block;
    text-decoration: none;
    color: inherit;
}
.news-card-body .news-text {
    font-family: "Microsoft YaHei", serif;
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.5;
    color: var(--text);
    letter-spacing: 1px;
    transition: color 0.3s;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    word-break: break-word;
}
.news-link:hover .news-text,
.news-link:active .news-text {
    color: var(--gold-light);
}
.news-card-body .news-summary {
    font-size: 0.9rem;
    color: var(--gold-light);
    letter-spacing: 0.5px;
    line-height: 1.6;
    padding: 6px 14px;
    border-left: 3px solid var(--summary-border);
    background: var(--summary-bg);
    border-radius: 0 6px 6px 0;
    box-sizing: border-box;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    word-break: break-word;
}
.news-card-body .news-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: auto;
    padding-top: 2px;
}
.news-card-body .news-source {
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.news-card-body .news-time {
    font-size: 0.72rem;
    color: var(--text-muted);
    opacity: 0.7;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── 类目标签颜色 ─────────────────────────────── */
.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);
}
.cat-消费市场 {
    background: var(--cat-gold-bg);
    color: var(--cat-gold-text);
    border: 1px solid var(--cat-gold-border);
}
.cat-国际视野 {
    background: var(--cat-blue-bg);
    color: var(--cat-blue-text);
    border: 1px solid var(--cat-blue-border);
}

/* ── Swiper 分页点 ────────────────────────────── */
.news-dots {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 4px 0;
}
.news-dots .swiper-pagination-bullet {
    width: 8px;
    height: 8px;
    background: var(--dot-bg);
    opacity: 1;
    margin: 0;
    border-radius: 50%;
}
.news-dots .swiper-pagination-bullet-active {
    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: 20px 28px 28px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    transition: background 0.5s ease, border-color 0.5s ease;
}

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

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

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

.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    width: 170px;
    height: 150px;
    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;
}

.svc-status {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 0.55rem;
    color: #4ade80;
    letter-spacing: 0;
    margin-top: 2px;
}
.svc-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4ade80;
    flex-shrink: 0;
}
.svc-status.off {
    color: #ef4444;
}
.svc-status.off .svc-dot {
    background: #ef4444;
}

.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;
    }
}

/* ═══════════════════════════════════════════════
   响应式 — 三级断点全覆盖
   ═══════════════════════════════════════════════ */

/* ── 平板横屏 / 小笔记本 (max-width: 1280px) ──────── */
@media (max-width: 1280px) {
    .top-bar {
        padding: 10px 20px 14px;
        flex-wrap: wrap;
        row-gap: 8px;
    }
    .metal-value { font-size: 1.1rem; }
    .metal-label { font-size: 0.7rem; }
    .metal-unit { font-size: 0.65rem; }
    .top-right { gap: 10px; }
    .price-live { width: 6px; height: 6px; }
    .user-area { margin-left: 4px; }
    .current-user-badge { padding: 3px 8px; }
    .user-name { font-size: 13px; }
    .btn-logout, .btn-login { padding: 4px 10px; font-size: 12px; }
    .news-stage { padding: 24px 20px 16px; }
    .news-stage-inner { max-width: 100%; }
    .news-card { padding: 16px 20px; min-height: 150px; gap: 14px; }
    .news-card-body .news-text { font-size: 1.1rem; }
    .news-card-body .news-summary { font-size: 0.85rem; -webkit-line-clamp: 3; }
    .news-card .news-cat { font-size: 0.68rem; min-width: 56px; padding: 5px 10px; }
    .nav-btn { width: 170px; height: 150px; }
    .nav-btn .svg-icon { width: 38px; height: 38px; }
    .clock { font-size: 2rem; }
    .nav-buttons { gap: 28px; }
}

/* ── 平板竖屏 (max-width: 900px) ────────────────── */
@media (max-width: 900px) {
    html, body { overflow-y: auto; }  /* 允许滚动兜底 */
    .top-bar {
        padding: 10px 14px;
        flex-wrap: wrap;
        gap: 6px;
    }
    .shop-name { font-size: 1rem; letter-spacing: 1px; }
    .metal-price { gap: 2px; }
    .metal-value { font-size: 1.05rem; }
    .metal-label { font-size: 0.65rem; }
    .metal-unit { font-size: 0.65rem; }
    .price-time { font-size: 0.65rem; }
    .top-right { gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
    .theme-toggle { width: 36px; height: 36px; }

    .news-stage { flex: auto; padding: 24px 14px 18px; min-height: 38vh; }
    .news-header { margin-bottom: 14px; }
    .news-title-label { font-size: 1rem; letter-spacing: 2px; }
    .news-stage-inner { max-width: 100%; }
    .news-card { padding: 14px 16px; min-height: 140px; gap: 12px; }
    .news-card-body .news-text { font-size: 1.05rem; -webkit-line-clamp: 2; }
    .news-card-body .news-summary { font-size: 0.82rem; -webkit-line-clamp: 2; padding: 5px 10px; }
    .news-card .news-cat { font-size: 0.65rem; min-width: 50px; padding: 4px 8px; letter-spacing: 1px; }

    .bottom-bar { flex: auto; padding: 16px 20px; }
    .bottom-center { gap: 20px; }
    .clock { font-size: 1.8rem; letter-spacing: 2px; }
    .nav-buttons { flex-wrap: wrap; justify-content: center; gap: 16px; }
    .nav-btn { width: 150px; height: 130px; gap: 12px; border-radius: 14px; }
    .nav-btn .svg-icon { width: 34px; height: 34px; }
    .nav-btn .btn-label { font-size: 1rem; letter-spacing: 1px; }

}

/* ── 大屏手机 / 小平板 (max-width: 768px) ────────── */
@media (max-width: 768px) {
    .top-bar {
        padding: 8px 10px;
        gap: 4px;
    }
    .top-left { gap: 8px; }
    .logo-small { height: 26px; }
    .shop-name { font-size: 0.85rem; }
    .metal-value { font-size: 1.05rem; }
    .metal-unit { font-size: 0.7rem; }
    .top-right { gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
    .price-time { font-size: 0.6rem; }

    .news-stage { padding: 20px 10px 14px; min-height: 32vh; }
    .news-header { margin-bottom: 10px; gap: 8px; }
    .news-header .svg-icon { width: 20px; height: 20px; }
    .news-title-label { font-size: 0.9rem; letter-spacing: 1px; }
    .news-stage-inner { max-width: 100%; }
    .news-card { padding: 12px 14px; min-height: 130px; gap: 10px; }
    .news-card-body .news-text { font-size: 0.95rem; -webkit-line-clamp: 2; }
    .news-card-body .news-summary { font-size: 0.78rem; -webkit-line-clamp: 2; padding: 4px 8px; }
    .news-card .news-cat { font-size: 0.62rem; min-width: 44px; padding: 3px 6px; letter-spacing: 1px; }
    .news-card-body .news-source { font-size: 0.72rem; }
    .news-card-body .news-time { font-size: 0.68rem; }

    .bottom-bar { padding: 14px 14px; }
    .bottom-center { gap: 16px; }
    .clock { font-size: 1.5rem; letter-spacing: 2px; }
    .nav-buttons { gap: 10px; }
    .nav-btn { width: 130px; height: 110px; gap: 10px; border-radius: 12px; border-width: 1.5px; }
    .nav-btn .svg-icon { width: 28px; height: 28px; }
    .nav-btn .btn-label { font-size: 0.9rem; }

}

/* ── 手机竖屏 (max-width: 480px) ──────────────────── */
@media (max-width: 480px) {
    .top-bar {
        padding: 6px 8px;
        gap: 2px;
    }
    .top-left { gap: 6px; }
    .logo-small { height: 24px; }
    .shop-name { font-size: 0.75rem; letter-spacing: 0.5px; }
    .metal-value { font-size: 0.95rem; }
    .metal-label { font-size: 0.65rem; }
    .top-right { gap: 6px; }
    .theme-toggle { width: 32px; height: 32px; }
    .theme-toggle .svg-icon { width: 16px; height: 16px; }

    .news-stage { padding: 20px 6px 12px; min-height: 30vh; }
    .news-header { margin-bottom: 8px; gap: 6px; }
    .news-header .svg-icon { width: 18px; height: 18px; }
    .news-title-label { font-size: 0.8rem; letter-spacing: 1px; }
    .news-stage-inner { max-width: 100%; }
    .news-card { padding: 10px 10px; min-height: 120px; gap: 8px; }
    .news-card-body .news-text { font-size: 0.88rem; -webkit-line-clamp: 2; }
    .news-card-body .news-summary { font-size: 0.73rem; -webkit-line-clamp: 2; padding: 3px 6px; }
    .news-card .news-cat { font-size: 0.6rem; min-width: 40px; padding: 2px 5px; letter-spacing: 0.5px; }
    .news-card-body .news-source { font-size: 0.68rem; }
    .news-card-body .news-time { font-size: 0.65rem; }

    .bottom-bar { padding: 10px 8px; }
    .bottom-center { gap: 12px; }
    .clock { font-size: 1.3rem; letter-spacing: 1px; }
    .nav-buttons { gap: 8px; }
    .nav-btn {
        width: 100px; height: 90px; gap: 6px;
        border-radius: 10px; border-width: 1.5px;
        min-height: 44px; /* 触摸最小高度 */
    }
    .nav-btn .svg-icon { width: 24px; height: 24px; }
    .nav-btn .btn-label { font-size: 0.8rem; letter-spacing: 1px; }

}
