:root {
    --bg-base: #f7f8fa;
    --card-bg: #ffffff;
    --text-main: #1a1a1a;
    --text-sub: #7d7d7d;
    --text-light: #9fa3ac;
    --color-down: #00b578; /* 更加明亮的绿色 */
    --color-up: #ff4d4f;   /* 更加鲜艳的红色 */
    --color-gold: #c6a35f;
    --color-border: #f0f0f0;
    --brand-primary: #b89249;
    --brand-soft: rgba(184, 146, 73, 0.14);
    --brand-glow: rgba(184, 146, 73, 0.28);
    
    /* 更加现代的阴影 */
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);

    /* Theme specific gradients - 调优色值使其更高级 */
    --gold-bg-top: #fffcf5;
    --gold-bg-mid: #fdf5e2;
    --silver-bg-top: #f5f7f9;
    --silver-bg-mid: #eaedf2;
    --plat-bg-top: #f2f4f9;
    --plat-bg-mid: #e8ebf4;
    
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-base: #0f1115;
        --card-bg: #1a1c22;
        --text-main: #f0f2f5;
        --text-sub: #90949c;
        --text-light: #5c6068;
        --color-border: #2a2d35;
        
        --shadow-sm: 0 2px 8px rgba(0,0,0,0.2);
        --shadow-md: 0 4px 16px rgba(0,0,0,0.3);
        --shadow-lg: 0 8px 24px rgba(0,0,0,0.4);

        --gold-bg-top: #1e1b14;
        --gold-bg-mid: #16140f;
        --silver-bg-top: #16181d;
        --silver-bg-mid: #111316;
        --plat-bg-top: #15171e;
        --plat-bg-mid: #101216;
    }
    
    .alert-btn {
        background: rgba(42, 45, 53, 0.8);
        border-color: rgba(255, 255, 255, 0.05);
        color: #e0e0e0;
    }

    .bottom-nav {
        background: rgba(26, 28, 34, 0.85);
        border-color: rgba(255, 255, 255, 0.05);
    }

    .chart-dropdown {
        color: #d7dbe3;
        background: rgba(42, 45, 53, 0.82);
        border-color: rgba(255, 255, 255, 0.08);
    }

    .icon-down {
        color: #c6ccd8;
    }

    .dropdown-item.active {
        background-color: rgba(255, 255, 255, 0.06);
    }

    .chart-section {
        background: linear-gradient(180deg, rgba(26, 28, 34, 0.94) 0%, rgba(26, 28, 34, 1) 100%);
    }

    .chart-container {
        border-color: rgba(92, 116, 232, 0.2);
        background: linear-gradient(180deg, rgba(33, 36, 45, 0.9) 0%, rgba(26, 28, 34, 0.95) 100%);
    }

    .legend-bottom .legend-item {
        background: rgba(184, 146, 73, 0.16);
        border-color: rgba(184, 146, 73, 0.3);
    }

    .main-price-card {
        background: linear-gradient(180deg, rgba(30, 33, 41, 0.95) 0%, rgba(26, 28, 34, 1) 100%);
    }

    .price-col {
        background: rgba(184, 146, 73, 0.1);
        border-color: rgba(184, 146, 73, 0.22);
    }

    .time-label {
        background: rgba(144, 148, 156, 0.12);
        border-color: rgba(144, 148, 156, 0.2);
    }

    .market-card::before {
        background: linear-gradient(180deg, rgba(184, 146, 73, 0.18) 0%, rgba(184, 146, 73, 0) 100%);
    }

    .skeleton-block {
        background: linear-gradient(90deg, rgba(56, 61, 74, 0.5) 25%, rgba(74, 80, 94, 0.85) 50%, rgba(56, 61, 74, 0.5) 75%);
        border-color: rgba(255, 255, 255, 0.06);
    }

    .theme-gold .tab-item:not(.active) { color: #8a7c6b; }
    .theme-silver .tab-item:not(.active) { color: #797e85; }
    .theme-platinum .tab-item:not(.active) { color: #6b7285; }

    .theme-gold .tab-item.active { color: #e8d5a8; background: rgba(198, 163, 95, 0.12); box-shadow: 0 0 0 1px rgba(198, 163, 95, 0.18); }
    .theme-silver .tab-item.active { color: #c0c8d6; background: rgba(140, 150, 170, 0.12); box-shadow: 0 0 0 1px rgba(140, 150, 170, 0.18); }
    .theme-platinum .tab-item.active { color: #b8c0de; background: rgba(120, 130, 175, 0.12); box-shadow: 0 0 0 1px rgba(120, 130, 175, 0.18); }

    .theme-gold .tab-dot { background: #6b5f46; }
    .theme-gold .tab-item.active .tab-dot { background: #c6a35f; }
    .theme-silver .tab-dot { background: #555a63; }
    .theme-silver .tab-item.active .tab-dot { background: #8c96aa; }
    .theme-platinum .tab-dot { background: #525870; }
    .theme-platinum .tab-item.active .tab-dot { background: #7882af; }
    
    .price-change-pill.down { background: rgba(0, 181, 120, 0.12); }
    .price-change-pill.up { background: rgba(255, 77, 79, 0.12); }
    .price-change-pill.flat { background: rgba(255, 255, 255, 0.08); color: #d7dbe3; border-color: rgba(255, 255, 255, 0.08); }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", STHeiti, "Microsoft Yahei", Tahoma, Simsun, sans-serif;
    background-color: var(--bg-base);
    color: var(--text-main);
    line-height: 1.5;
    font-size: 14px;
    letter-spacing: 0.2px;
}

#app {
    position: relative;
    width: 100%;
    height: 100dvh;
    max-width: none;
    margin: 0;
    background-color: var(--bg-base);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Dynamic Background */
.top-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 350px;
    z-index: 0;
    background: linear-gradient(180deg, var(--gold-bg-top) 0%, var(--bg-base) 100%);
    transition: background-image 0.3s ease;
}

.theme-gold .top-bg { background: linear-gradient(180deg, var(--gold-bg-mid) 0%, var(--gold-bg-top) 30%, var(--bg-base) 100%); }
.theme-silver .top-bg { background: linear-gradient(180deg, var(--silver-bg-mid) 0%, var(--silver-bg-top) 30%, var(--bg-base) 100%); }
.theme-platinum .top-bg { background: linear-gradient(180deg, var(--plat-bg-mid) 0%, var(--plat-bg-top) 30%, var(--bg-base) 100%); }

/* Header */
.header {
    position: relative;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px 8px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    flex-shrink: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-icon {
    width: 24px;
    height: 24px;
    padding: 4px;
    border-radius: 7px;
    background: linear-gradient(180deg, #5f4a34 0%, #473522 100%);
    color: #f1d089;
    fill: currentColor;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-size: 16px;
    font-weight: 700;
    color: #362c21;
    display: flex;
    align-items: center;
    gap: 4px;
    line-height: 1.2;
}

.logo-title .dot {
    font-size: 20px;
    line-height: 1;
}

.logo-subtitle {
    font-size: 10px;
    color: rgba(116, 104, 90, 0.88);
    letter-spacing: 0.8px;
}

.alert-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(255,255,255,0.88);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.5);
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 11px;
    color: #4b4339;
    font-weight: 600;
    letter-spacing: 0.2px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06), inset 0 1px 0 rgba(255,255,255,0.8);
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.alert-btn:active {
    transform: scale(0.96);
    background: rgba(255,255,255,0.95);
}

.alert-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(92, 116, 232, 0.3), var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,0.8);
}

.bell-icon {
    width: 14px;
    height: 14px;
    padding: 3px;
    border-radius: 50%;
    background: #f8e8a8;
    color: #d4a84a;
    fill: currentColor;
}

/* Main Tabs (Inline Style) */
.main-tabs {
    position: relative;
    z-index: 12;
    display: flex;
    margin: 0;
    padding: 10px 12px 0;
    align-items: center;
    isolation: isolate;
    transform: translateZ(0);
    overflow: visible;
    gap: 4px;
    border-bottom: none;
}

.market-viewport {
    position: relative;
    transform: translateZ(0);
}

.market-viewport.transition-leave.effect-fade {
    opacity: 0.78;
    transform: translateY(4px) scale(0.995);
    transition: opacity 0.14s ease, transform 0.14s ease;
}

.market-viewport.transition-enter.effect-fade {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.26s ease, transform 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}

.market-viewport.transition-leave.effect-slide {
    opacity: 0.8;
    transform: translateX(-10px);
    transition: opacity 0.16s ease, transform 0.16s cubic-bezier(0.33, 1, 0.68, 1);
}

.market-viewport.transition-enter.effect-slide {
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.26s ease, transform 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}

.market-viewport.transition-leave.effect-zoom {
    opacity: 0.82;
    transform: scale(0.985);
    transition: opacity 0.16s ease, transform 0.16s ease;
}

.market-viewport.transition-enter.effect-zoom {
    opacity: 1;
    transform: scale(1);
    transition: opacity 0.26s ease, transform 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}

.market-skeleton {
    position: absolute;
    inset: 98px 0 0;
    z-index: 20;
    pointer-events: none;
}

.skeleton-block {
    border-radius: 20px;
    background: linear-gradient(90deg, rgba(225, 229, 238, 0.52) 25%, rgba(239, 242, 248, 0.9) 50%, rgba(225, 229, 238, 0.52) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1s linear infinite;
    border: 1px solid rgba(236, 239, 245, 0.8);
}

.skeleton-main {
    height: 220px;
    margin-bottom: 12px;
}

.skeleton-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.skeleton-card {
    height: 100px;
}

.skeleton-chart {
    height: 300px;
}

.tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 8px 14px;
    font-size: 14px;
    font-weight: 500;
    position: relative;
    transition: color 0.28s ease, background 0.28s ease, box-shadow 0.28s ease;
    cursor: pointer;
    background: transparent;
    z-index: 1;
    border: none;
    outline: none;
    border-radius: 12px;
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
    color: #b5aa98;
}

#app.is-switching .tab-item {
    pointer-events: none;
}

.tab-item:focus-visible {
    box-shadow: inset 0 0 0 2px #5c74e8;
}

.tab-item[aria-selected='true'] {
    cursor: default;
}

.tab-item.active {
    font-weight: 700;
    font-size: 15px;
    color: #5a4a2e;
    background: rgba(198, 163, 95, 0.10);
    border: none;
    box-shadow: 0 0 0 1px rgba(198, 163, 95, 0.12);
}

.tab-item:active .tab-text {
    transform: scale(0.98);
}

.tab-item:not(.active):active {
    transform: translateY(0);
}

.main-layout {
    position: relative;
    z-index: 10;
    margin: 0;
    padding: 0;
    background: var(--card-bg);
    border-radius: 20px;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    flex-shrink: 0;
    contain: layout style paint;
}

.main-layout::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 80px;
    pointer-events: none;
    z-index: 0;
    border-radius: 20px 20px 0 0;
    transition: background 0.4s ease;
}

.theme-gold .main-layout::before {
    background: linear-gradient(180deg, rgba(245, 218, 160, 0.28) 0%, rgba(245, 218, 160, 0.08) 55%, transparent 100%);
}

.theme-silver .main-layout::before {
    background: linear-gradient(180deg, rgba(200, 205, 215, 0.25) 0%, rgba(200, 205, 215, 0.06) 55%, transparent 100%);
}

.theme-platinum .main-layout::before {
    background: linear-gradient(180deg, rgba(180, 185, 210, 0.25) 0%, rgba(180, 185, 210, 0.06) 55%, transparent 100%);
}

/* Inactive Tab Styles */
.theme-gold .tab-item:not(.active) { color: #b5aa98; }
.theme-silver .tab-item:not(.active) { color: #9a9da6; }
.theme-platinum .tab-item:not(.active) { color: #8e92a5; }

/* Active Tab Theme Styles */
.theme-gold .tab-item.active {
    color: #5a4a2e;
    background: rgba(198, 163, 95, 0.10);
    box-shadow: 0 0 0 1px rgba(198, 163, 95, 0.12);
}
.theme-silver .tab-item.active {
    color: #3a3f4a;
    background: rgba(140, 150, 170, 0.10);
    box-shadow: 0 0 0 1px rgba(140, 150, 170, 0.12);
}
.theme-platinum .tab-item.active {
    color: #363c4e;
    background: rgba(120, 130, 175, 0.10);
    box-shadow: 0 0 0 1px rgba(120, 130, 175, 0.12);
}

/* Tab Dot Theme Colors */
.theme-gold .tab-dot { background: #d4c4a0; }
.theme-gold .tab-item.active .tab-dot { background: #c6a35f; box-shadow: 0 0 6px rgba(198, 163, 95, 0.4); }
.theme-silver .tab-dot { background: #c0c4cc; }
.theme-silver .tab-item.active .tab-dot { background: #8c96aa; box-shadow: 0 0 6px rgba(140, 150, 170, 0.4); }
.theme-platinum .tab-dot { background: #b8bcce; }
.theme-platinum .tab-item.active .tab-dot { background: #7882af; box-shadow: 0 0 6px rgba(120, 130, 175, 0.4); }

/* Tab Line Theme Colors */
.theme-gold .tab-line { background: linear-gradient(90deg, #c6a35f, #dbb978); }
.theme-silver .tab-line { background: linear-gradient(90deg, #8c96aa, #a8b0c0); }
.theme-platinum .tab-line { background: linear-gradient(90deg, #7882af, #96a0cc); }


.tab-text {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    letter-spacing: 0.4px;
    transition: transform 0.22s ease;
}

.tab-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #d4c4a0;
    transition: background 0.28s ease, box-shadow 0.28s ease, transform 0.28s ease;
    flex-shrink: 0;
}

.tab-item.active .tab-dot {
    transform: scale(1.15);
}

.tab-line {
    position: absolute;
    bottom: 4px;
    width: 24px;
    height: 3px;
    border-radius: 3px;
    opacity: 0;
    transform: scaleX(0.5);
    transition: opacity 0.28s ease, transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
    background: linear-gradient(90deg, #c6a35f, #dbb978);
}

.tab-item.active .tab-line {
    opacity: 1;
    transform: scaleX(1);
}

/* Content Area */
.content-scroll {
    position: relative;
    z-index: 11;
    padding: 0 16px;
    padding-bottom: 8px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    flex: 1 1 0;
    overflow: hidden;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.card {
    background: var(--card-bg);
    border-radius: 24px;
    padding: 24px 20px;
    margin-bottom: 0;
    box-shadow: var(--shadow-md);
    position: relative;
    border: 1px solid var(--color-border);
    overflow: hidden;
}

/* Main Price Card */
.main-price-card {
    text-align: center;
    padding-top: 10px;
    padding-bottom: 6px;
    border-radius: 0;
    margin-top: 0;
    z-index: 11;
    position: relative;
    box-shadow: none;
    border: none;
    background: transparent;
    transition: none;
}

.main-price-card::before {
    display: none;
}

.main-price-card.card-refresh {
    animation: card-refresh 0.42s ease;
}


.main-card-header {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    margin-bottom: 0;
    min-height: 36px;
}

.title-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.main-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.15;
    letter-spacing: 0.5px;
}

.subtitle {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 5px;
    letter-spacing: 0.3px;
}

.icon-help {
    width: 13px;
    height: 13px;
    color: #999;
    fill: currentColor;
}

.icon-help-sm {
    width: 14px;
    height: 14px;
    margin-left: 2px;
    vertical-align: -2px;
}

.price-change-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 4px;
    margin-bottom: 8px;
    transition: transform 0.32s ease, opacity 0.32s ease;
    border: 1px solid transparent;
}

.price-change-pill.down {
    background: #ebf8f3;
    color: var(--color-down);
    border-color: rgba(0, 181, 120, 0.16);
}

.price-change-pill.up {
    background: #fdf0f0;
    color: var(--color-up);
    border-color: rgba(255, 77, 79, 0.18);
}

.price-change-pill.flat {
    background: rgba(125, 125, 125, 0.08);
    color: var(--text-sub);
    border-color: rgba(125, 125, 125, 0.12);
}

.price-change-pill.change-update {
    animation: pill-refresh 0.38s ease;
}

.icon-arrow {
    width: 12px;
    height: 12px;
    color: currentColor;
    fill: currentColor;
}

.icon-arrow-sm {
    width: 10px;
    height: 10px;
    vertical-align: -1px;
}

.price-columns {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    padding: 0;
    gap: 10px;
}

.price-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(184, 146, 73, 0.05);
    border: 1px solid rgba(184, 146, 73, 0.10);
    border-radius: 16px;
    padding: 10px 6px;
    overflow: hidden;
}

.col-title {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}

.price-large {
    font-size: clamp(22px, 7vw, 30px);
    font-weight: 800;
    font-family: DIN Alternate, "Helvetica Neue", sans-serif;
    line-height: 1;
    margin-bottom: 0;
    letter-spacing: -0.5px;
    white-space: nowrap;
    transition: color 0.3s ease;
}

.price-large.down { color: var(--color-down); }
.price-large.up { color: var(--color-up); }
.price-large.flat { color: var(--text-main); }

.price-large.price-update {
    animation: price-update 0.4s ease;
}

.time-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 8px;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(125, 125, 125, 0.06);
    border: 1px solid rgba(125, 125, 125, 0.10);
    font-size: 11px;
    color: var(--text-light);
    letter-spacing: 0.2px;
    min-height: 24px;
    text-align: center;
}

.time-label::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #d04d4f;
    margin-right: 6px;
    flex-shrink: 0;
    box-shadow: 0 0 4px rgba(208, 77, 79, 0.4);
    animation: pulse-dot 2s ease infinite alternate;
}

.time-label.ok::before {
    background: #00b578;
    box-shadow: 0 0 4px rgba(0, 181, 120, 0.4);
}

.data-status {
    margin-top: 10px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-sub);
    text-align: center;
}

.data-status.warning {
    color: #c98710;
}

.data-status.error {
    color: #d04d4f;
}

/* Sub Markets */
.sub-markets {
    display: flex;
    gap: 8px;
    margin: 0;
    flex-shrink: 0;
}

.market-card {
    flex: 1;
    background: var(--card-bg);
    border-radius: 16px;
    padding: 10px 8px 8px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    contain: layout style paint;
    border: 1px solid var(--color-border);
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
    position: relative;
    overflow: hidden;
}

.market-card::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 32px;
    background: linear-gradient(180deg, rgba(184, 146, 73, 0.08) 0%, rgba(184, 146, 73, 0) 100%);
    pointer-events: none;
}

.market-card:active {
    transform: translateY(2px);
    box-shadow: none;
}

.market-name {
    font-size: 14px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    margin-bottom: 6px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.market-price {
    font-size: 22px;
    font-weight: 800;
    font-family: DIN Alternate, "Helvetica Neue", sans-serif;
    margin-bottom: 5px;
    letter-spacing: -0.3px;
}

.market-price.down { color: var(--color-down); }
.market-price.up { color: var(--color-up); }
.market-price.normal { color: var(--text-main); }

.market-desc {
    font-size: 10px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    white-space: nowrap;
    letter-spacing: 0.2px;
}

.market-desc.down { color: var(--color-down); }
.market-desc.up { color: var(--color-up); }

.status-tag {
    background: rgba(0, 0, 0, 0.04);
    padding: 2px 5px;
    border-radius: 4px;
    color: var(--text-light);
    font-size: 10px;
}

/* Chart Section */
.chart-section {
    padding: 8px 16px 7px;
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    margin: 0;
    contain: layout style;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    flex-shrink: 0;
}

.chart-title {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.chart-dropdown {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #333;
    background: #faf9f7;
    padding: 5px 12px;
    border-radius: 999px;
    border: 1px solid #e7e3da;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.chart-dropdown:focus-visible {
    outline: none;
    border-color: rgba(92, 116, 232, 0.45);
    box-shadow: 0 0 0 2px rgba(92, 116, 232, 0.18);
}

.chart-dropdown[aria-expanded='true'] {
    background: var(--card-bg);
    border-color: rgba(92, 116, 232, 0.25);
}

.chart-dropdown-container {
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    list-style: none;
    padding: 4px 0;
    min-width: 100px;
    z-index: 100;
    border: 1px solid var(--color-border);
}

.dropdown-menu.show {
    display: block;
    animation: dropdown-in 0.18s ease;
}

.dropdown-item {
    padding: 8px 16px;
    font-size: 13px;
    color: var(--text-sub);
    cursor: pointer;
    text-align: center;
    transition: background-color 0.2s;
}

.dropdown-item:hover {
    background-color: var(--bg-base);
}

.dropdown-item.active {
    color: var(--text-main);
    font-weight: 600;
    background-color: rgba(0,0,0,0.02);
}

.icon-down {
    width: 14px;
    height: 14px;
    color: #333;
    fill: currentColor;
    transition: transform 0.2s ease;
}

.chart-dropdown[aria-expanded='true'] .icon-down {
    transform: rotate(180deg);
}



.legend-top {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.legend-label {
    color: var(--text-light);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-light);
}

.legend-item.active {
    color: #333;
    font-weight: 500;
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.dot-yellow-light { background: #fae1b1; }
.dot-blue { background: #5c74e8; }
.dot-grey { background: #e5e5e5; }
.dot-red { background: #f3a6a6; }

.chart-container {
    position: relative;
    width: 100%;
    flex: 1 1 0;
    min-height: 60px;
    margin-bottom: 8px;
    border-radius: 16px;
    border: 1px solid rgba(92, 116, 232, 0.08);
    background: linear-gradient(180deg, rgba(250, 252, 255, 0.92) 0%, rgba(255, 255, 255, 0.95) 100%);
    transition: opacity 0.32s ease, transform 0.32s ease;
    will-change: opacity, transform;
    overflow: hidden;
}

.chart-container.chart-transition {
    opacity: 0.84;
    transform: translateY(2px);
}

.trend-chart {
    width: 100%;
    height: 100%;
    display: block;
}

.watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0.14;
    pointer-events: none;
}

.watermark-icon {
    width: 24px;
    height: 24px;
    color: #dcdcdc;
    fill: currentColor;
}

.watermark span {
    font-size: 24px;
    font-weight: bold;
    color: #e7e7e7;
    letter-spacing: 2px;
}

.legend-bottom {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-shrink: 0;
    font-size: 12px;
    color: #333;
}

.legend-bottom .legend-item {
    background: rgba(184, 146, 73, 0.1);
    border: 1px solid rgba(184, 146, 73, 0.2);
    border-radius: 999px;
    padding: 3px 8px;
}

.line {
    display: inline-block;
    width: 12px;
    height: 3px;
    border-radius: 2px;
    margin-right: 4px;
    vertical-align: middle;
}

.line-yellow { background: #f5c760; }
.line-blue { background: #5c74e8; }
.line-grey { background: #b0b4c3; }

.spacer {
    height: 0;
}

/* Bottom Navigation */
.bottom-nav {
    flex-shrink: 0;
    align-self: center;
    width: min(calc(100% - 24px), 1200px);
    margin-bottom: 2px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: var(--shadow-lg);
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: #a0a0a0;
    font-size: 11px;
    transition: color 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
    position: relative;
    padding: 4px 10px;
    border-radius: 14px;
    border: none;
    background: transparent;
    font: inherit;
    line-height: 1.2;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    text-decoration: none;
}

.nav-item.active {
    color: var(--brand-primary);
    transform: translateY(-1px);
    background: var(--brand-soft);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: -4px;
    height: 2px;
    border-radius: 2px;
    background: var(--brand-primary);
    box-shadow: 0 0 10px var(--brand-glow);
}

.nav-item:focus-visible {
    outline: none;
    box-shadow: inset 0 0 0 2px rgba(92, 116, 232, 0.45);
}

.bottom-nav .nav-item:first-child {
    color: #b89b52;
}

.nav-icon {
    width: 24px;
    height: 24px;
    color: currentColor;
    fill: currentColor;
}

/* Helpers */
.hidden { display: none !important; }

@supports not ((backdrop-filter: blur(2px)) or (-webkit-backdrop-filter: blur(2px))) {
    .bottom-nav {
        background: var(--card-bg);
    }
}

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

@keyframes dropdown-in {
    0% { opacity: 0; transform: translateY(6px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-dot {
    0% { transform: scale(0.8); opacity: 0.6; }
    100% { transform: scale(1.15); opacity: 1; }
}

/* Announcement Bar - Marquee */
.announcement-bar {
    margin: 0 0 10px;
    padding: 0;
    height: 30px;
    border-radius: 15px;
    overflow: hidden;
    display: flex;
    align-items: center;
    font-size: 12px;
    line-height: 1;
    background: linear-gradient(90deg, rgba(197,163,95,0.08), rgba(197,163,95,0.02));
    border: 1px solid rgba(197,163,95,0.12);
}
.announcement-bar.has-urgent {
    background: linear-gradient(90deg, rgba(255,77,79,0.08), rgba(255,77,79,0.03));
    border-color: rgba(255,77,79,0.18);
}
.announcement-bar.has-warning {
    background: linear-gradient(90deg, rgba(250,173,20,0.08), rgba(250,173,20,0.03));
    border-color: rgba(250,173,20,0.18);
}
.ann-label {
    flex-shrink: 0;
    padding: 0 12px;
    height: 100%;
    display: flex;
    align-items: center;
    border-radius: 15px 0 0 15px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #c6a35f, #d4b474);
    color: #fff;
}
.has-urgent .ann-label { background: linear-gradient(135deg, #ff4d4f, #ff7875); }
.has-warning .ann-label { background: linear-gradient(135deg, #faad14, #ffc53d); }

.ann-track {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    height: 30px;
    margin-left: 10px;
}
.ann-scroll {
    display: block;
    white-space: nowrap;
    height: 30px;
    line-height: 30px;
}
.ann-scroll:hover { animation-play-state: paused; }
.ann-scroll-item {
    display: inline-block;
    font-size: 12px;
    color: var(--text-sub, #666);
    margin-right: 50px;
}
.ann-scroll-item .ann-title-text { font-weight: 600; color: var(--text-main, #1a1a1a); }
.ann-scroll-item .ann-content-text { opacity: 0.75; margin-left: 4px; }
.ann-scroll-item .ann-dot {
    display: inline-block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    vertical-align: middle;
    margin-right: 5px;
}
.ann-dot-info { background: #c6a35f; }
.ann-dot-warning { background: #faad14; }
.ann-dot-urgent { background: #ff4d4f; }

@media (prefers-color-scheme: dark) {
    .announcement-bar { background: linear-gradient(90deg, rgba(197,163,95,0.08), rgba(197,163,95,0.03)); border-color: rgba(197,163,95,0.12); }
    .announcement-bar.has-urgent { background: linear-gradient(90deg, rgba(255,77,79,0.10), rgba(255,77,79,0.04)); border-color: rgba(255,77,79,0.15); }
    .announcement-bar.has-warning { background: linear-gradient(90deg, rgba(250,173,20,0.10), rgba(250,173,20,0.04)); border-color: rgba(250,173,20,0.15); }
}

@keyframes card-refresh {
    0% { opacity: 0.85; }
    100% { opacity: 1; }
}

@keyframes pill-refresh {
    0% { opacity: 0.7; }
    100% { opacity: 1; }
}

@keyframes price-update {
    0% { opacity: 0.5; }
    100% { opacity: 1; }
}

@media (max-width: 360px) {
    .header {
        padding: calc(10px + env(safe-area-inset-top)) 12px 10px;
        gap: 10px;
    }

    .logo {
        gap: 6px;
        min-width: 0;
    }

    .logo-title {
        font-size: 14px;
    }

    .logo-subtitle {
        font-size: 9px;
        letter-spacing: 0.5px;
    }

    .alert-btn {
        padding: 6px 10px;
        font-size: 11px;
        flex-shrink: 0;
    }

    .bell-icon {
        width: 18px;
        height: 18px;
    }

    .main-layout {
        margin: 0 -12px;
        padding: 0 12px;
    }

    .tab-item {
        font-size: 14px;
        font-weight: 520;
    }

    .tab-item.active {
        font-size: 15px;
        font-weight: 680;
    }

    .tab-text {
        letter-spacing: 0;
    }

    .main-tabs {
        gap: 1px;
    }

    .tab-line {
        width: 24px;
    }

    .content-scroll {
        padding: 0 12px;
        padding-bottom: 6px;
        gap: 6px;
    }

    .card {
        border-radius: 22px;
        padding: 14px 12px;
    }

    .main-price-card {
        padding-top: 6px;
        padding-bottom: 4px;
    }

    .main-card-header {
        flex-direction: column;
        align-items: center;
        gap: 4px;
        min-height: 0;
        margin-bottom: 4px;
    }

    .main-title {
        font-size: 22px;
    }

    .subtitle {
        font-size: 12px;
    }

    .price-change-pill {
        margin-top: 0;
        margin-bottom: 6px;
        font-size: 12px;
    }

    .price-columns {
        gap: 8px;
    }

    .price-col {
        padding: 10px 8px 8px;
        border-radius: 12px;
    }

    .col-title {
        font-size: 12px;
        margin-bottom: 4px;
    }

    .price-large {
        font-size: 26px;
        margin-bottom: 0;
    }

    .time-label {
        font-size: 11px;
        line-height: 1.35;
    }

    .sub-markets {
        gap: 6px;
    }

    .market-card {
        border-radius: 14px;
        padding: 10px 6px 6px;
    }

    .market-name {
        font-size: 15px;
        margin-bottom: 5px;
    }

    .market-price {
        font-size: 16px;
    }

    .market-desc {
        font-size: 9px;
        white-space: normal;
        line-height: 1.25;
    }

    .chart-section {
        padding: 10px 12px 6px;
    }

    .chart-header {
        flex-wrap: wrap;
        gap: 6px;
        margin-bottom: 6px;
    }

    .chart-dropdown {
        max-width: 100%;
        padding: 5px 10px;
        font-size: 11px;
        cursor: pointer;
    }

    .chart-dropdown span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }



    .legend-top {
        gap: 6px;
        font-size: 10px;
    }

    .legend-bottom {
        gap: 14px;
        font-size: 11px;
    }

    .chart-container {
        min-height: 80px;
        margin-bottom: 4px;
    }

    .chart-section {
        padding: 8px 12px 7px;
    }

    .market-skeleton {
        inset: 96px 0 0;
    }

    .skeleton-main {
        height: 198px;
    }

    .skeleton-card {
        height: 86px;
    }

    .skeleton-chart {
        height: 244px;
    }

    .watermark span {
        font-size: 20px;
    }

    .bottom-nav {
        padding: 6px 0;
    }

    .nav-item {
        font-size: 10px;
        gap: 3px;
    }

    .nav-icon {
        width: 22px;
        height: 22px;
    }
}

@media (min-width: 900px) {
    .content-scroll {
        padding: 0 28px;
        padding-bottom: 8px;
    }

    .header {
        max-width: 1200px;
        margin: 0 auto;
        width: 100%;
        padding: 10px 28px 8px;
    }

    .main-title {
        font-size: 36px;
    }

    .price-large {
        font-size: 41px;
    }

    .sub-markets {
        gap: 12px;
    }

    .chart-container {
        min-height: 160px;
    }
}

@media (max-width: 340px) {
    .header {
        padding: calc(8px + env(safe-area-inset-top)) 10px 8px;
    }

    .logo-title {
        font-size: 13px;
    }

    .logo-subtitle {
        display: none;
    }

    .alert-btn {
        padding: 6px 8px;
    }

    .content-scroll {
        padding: 0 10px;
        padding-bottom: calc(58px + env(safe-area-inset-bottom));
        gap: 5px;
    }

    .main-layout {
        margin: 0 -10px;
        padding: 0 10px;
    }

    .main-title {
        font-size: 23px;
    }

    .price-large {
        font-size: 24px;
    }

    .chart-container {
        min-height: 70px;
    }

    .market-skeleton {
        inset: 90px 0 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

@media (hover: hover) {
    .tab-item:not(.active):hover {
        background: rgba(0, 0, 0, 0.03);
        color: inherit;
    }

    .market-card:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-md);
        border-color: rgba(92, 116, 232, 0.16);
    }
}

@media (hover: none) {
    .tab-item:not(.active):hover {
        transform: none;
    }

    .market-card:hover {
        transform: none;
        box-shadow: var(--shadow-sm);
        border-color: var(--color-border);
    }
}
