/* =========================================================
   CM Group — Tungsten Price page stylesheet
   PART 1 is copied VERBATIM from tungsten.css (header, mega menu, sidebar,
   filters, chart cards, footer) so every tungsten page shares one template.
   Do NOT edit PART 1 here — change the template everywhere or not at all.
   PART 2 holds only what is specific to the price page.
   ========================================================= */

/* ===================== PART 1 — shared template ===================== */
*{margin:0;padding:0;box-sizing:border-box}
.header{background:#fff;border-bottom:1px solid #e0e0e0;position:sticky;top:0;z-index:1000}
.header-inner{max-width:1400px;margin:0 auto;padding:0 48px;display:flex;align-items:center;height:80px;gap:36px}
.header-logo img{height:40px}
.header-nav{display:flex;gap:32px;list-style:none;align-items:center}
.header-nav>li{position:relative}
.header-nav>li>a,.header-nav>li>a:visited,.header-nav>li>a:active{color:#333!important;text-decoration:none!important;font-size:15px;font-weight:500;cursor:pointer;display:inline-flex;align-items:center;gap:4px}
.header-nav>li>a:hover{color:#024d8f!important;text-decoration:none!important}
.header-nav>li>a.active{color:#024d8f;font-weight:600}
.header-nav>li>a .arrow{font-size:9px;color:#80868b;transition:transform .2s}
.header-nav>li.open>a .arrow{transform:rotate(180deg)}
.header-nav>li>a.locked{color:#b0b8c4;cursor:default}
.header-nav>li>a.locked:hover{color:#b0b8c4}
.soon-badge{font-size:8px;background:#dadce0;color:#8892a0;padding:2px 6px;border-radius:8px;font-weight:600;letter-spacing:.5px;text-transform:uppercase}
.mega-menu{display:none;position:fixed;top:64px;left:0;right:0;background:#fff;border-top:1px solid #e0e0e0;box-shadow:0 12px 40px rgba(0,0,0,.08);z-index:9999}
.header-nav>li.open .mega-menu{display:block}
.mega-inner{max-width:1400px;margin:0 auto;padding:40px 48px;display:grid;grid-template-columns:1fr 1fr 1fr;gap:48px;align-items:start}
.mega-col h4{font-size:14px;font-weight:600;color:#1a1a1a;margin-bottom:20px;padding-left:14px}
.mega-item{display:flex;align-items:flex-start;gap:14px;padding:12px 14px;border-radius:8px;text-decoration:none;color:inherit;transition:background .15s;margin-bottom:2px}
.mega-item:hover{background:#f4f7fc}
.mega-item-icon{width:40px;height:40px;border-radius:8px;background:#f0f4f9;display:flex;align-items:center;justify-content:center;flex-shrink:0}
.mega-item-icon svg{width:20px;height:20px;stroke:#024d8f;fill:none;stroke-width:2}
.mega-item-text h5{font-size:14px;font-weight:500;color:#1a1a1a;margin-bottom:2px}
.mega-item-text p{font-size:12px;color:#80868b;line-height:1.4}
.mega-links h4{font-size:14px;font-weight:600;color:#1a1a1a;margin-bottom:16px}
.mega-links a{display:block;font-size:14px;color:#3c4043;text-decoration:none;padding:8px 0;transition:color .15s}
.mega-links a:hover{color:#024d8f}
.mega-links .section{margin-bottom:24px}
.mega-promo{background:#f8f9fb;border-radius:12px;padding:28px}
.mega-promo h5{font-size:16px;font-weight:500;color:#1a1a1a;margin-bottom:10px}
.mega-promo p{font-size:13px;color:#5f6368;line-height:1.7;margin-bottom:16px}
.mega-promo .promo-btn{color:#024d8f;font-size:14px;font-weight:600;text-decoration:none}
.mega-promo .promo-btn:hover{text-decoration:underline}
.header-signin{display:flex;align-items:center;font-size:14px;font-weight:400;text-decoration:none;color:#2a2a2a}
.header-right{display:flex;align-items:center;gap:20px;margin-left:auto}
.header-right a{color:#024d8f;text-decoration:none;font-size:13px;font-weight:400}
.header-right a:hover{text-decoration:underline}
.header-right .signout{color:#80868b}
.header-right .signout:hover{color:#c62828;text-decoration:none}
body{font-family:Inter,Helvetica Neue,Helvetica,Arial,sans-serif;background:#fff;color:#202124;font-size:14px}
.main-layout{display:grid;grid-template-columns:280px 1fr;max-width:1400px;margin:0 auto;min-height:calc(100vh - 80px)}
.page-title{font-size:24px;font-weight:400;color:#202124;margin-bottom:2px}
.page-subtitle{font-size:13px;color:#80868b;font-weight:400;margin-bottom:20px}
.ccy-toggle{display:flex;gap:0;border:1px solid #dadce0;border-radius:20px;overflow:hidden}
.tb-btn{padding:6px 14px;border:1px solid #dadce0;border-radius:20px;font-size:12px;font-weight:500;color:#3c4043;background:#fff;cursor:pointer;display:inline-flex;align-items:center;gap:5px;font-family:inherit;transition:all .15s}
.tb-btn:hover{background:#f1f3f4}
.tb-btn.active{border-color:#1a1a1a;color:#1a1a1a;background:#f0f0f0}
.ccy-toggle button{padding:7px 16px;border:none;background:#fff;font-size:13px;font-weight:500;color:#5f6368;cursor:pointer;transition:all .15s;font-family:inherit}
.ccy-toggle button:not(:last-child){border-right:1px solid #dadce0}
.ccy-toggle button.active{background:#f0f0f0;color:#1a1a1a;font-weight:600}
.ccy-toggle button:hover:not(.active){background:#f1f3f4}
.sidebar-toggle-full{width:100%}
.sidebar-toggle-full button{flex:1;padding:7px 0;font-size:12px}
.mega-overlay{display:none;position:fixed;top:64px;left:0;right:0;bottom:0;background:rgba(0,0,0,.12);z-index:998}

.user-dropdown{position:relative;display:inline-flex}
.user-dropdown-btn{display:flex;align-items:center;gap:6px;font-size:14px;font-weight:400;color:#2a2a2a;background:none;border:none;outline:none;cursor:pointer;font-family:inherit;padding:4px 0}
.user-dropdown-btn:hover{color:#024d8f}
.user-dropdown-menu{visibility:hidden;opacity:0;pointer-events:none;position:absolute;top:calc(100% + 10px);right:0;background:#fff;border:1px solid #e0e0e0;border-radius:10px;box-shadow:0 8px 24px rgba(0,0,0,.10);min-width:180px;z-index:10000;overflow:hidden;transition:opacity .15s}
.user-dropdown-menu.open{visibility:visible;opacity:1;pointer-events:auto}
.user-dropdown-menu a{display:flex;align-items:center;gap:10px;padding:10px 16px;font-size:13px;color:#3c4043!important;text-decoration:none!important}
.user-dropdown-menu a:hover{background:#f8f9fa}
.dd-divider{height:1px;background:#f1f3f4;margin:4px 0}
.dd-logout{color:#c62828!important}

.sidebar{border-right:1px solid #ebebeb;overflow-y:auto;max-height:calc(100vh - 80px);position:sticky;top:80px;background:#fff;padding:20px 0}
.sb-section{padding:12px 22px 16px;margin-bottom:4px;border-bottom:1px solid #f1f3f4}
.sb-section:last-child{border-bottom:none}
.sb-label{font-size:11px;font-weight:600;color:#5f6368;text-transform:uppercase;letter-spacing:.5px;margin-bottom:10px;display:flex;justify-content:space-between;align-items:center}
.tab-row{display:flex;flex-direction:column;gap:2px}
.tab-btn{padding:10px 16px;border:none;border-radius:8px;font-size:13px;font-weight:500;color:#3c4043;background:transparent;cursor:pointer;font-family:inherit;transition:all .15s;text-align:left;display:flex;align-items:center;gap:8px}
.tab-btn:hover{background:#f1f3f4}
.tab-btn.active{background:#f0f0f0;color:#1a1a1a;font-weight:600}

.sidebar select{width:100%;padding:8px 14px;border:1px solid #dadce0;border-radius:20px;font-size:13px;font-family:inherit;background:#fff;outline:none;color:#3c4043;cursor:pointer;-webkit-appearance:none;appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235f6368' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 12px center;padding-right:32px}
.sidebar select:focus{border-color:#1a1a1a;box-shadow:0 0 0 2px rgba(26,26,26,.15)}
.sidebar select:hover{background-color:#f8f9fa}

.quick-btn{padding:4px 10px;border:1px solid #dadce0;border-radius:20px;font-size:10px;font-weight:600;color:#8892a0;background:#fff;cursor:pointer;transition:all .15s}
.quick-btn:hover{border-color:#1a1a1a;color:#1a1a1a}
.quick-btn.active{background:#f0f0f0;color:#1a1a1a;border-color:#1a1a1a;font-weight:600}
.filter-label{font-size:9px;text-transform:uppercase;letter-spacing:1px;color:#b0b8c4;font-weight:600}
.content{padding:16px 28px 40px;min-width:0}
.chart-section{background:#f8f9fa;border-radius:16px;padding:20px 24px;margin-bottom:20px}
.chart-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}
.chart-title{font-size:18px;font-weight:400;color:#202124}
.chart-subtitle{font-size:13px;color:#80868b;margin-top:2px;font-weight:400}
.chart-wrap{overflow:hidden;height:420px;position:relative}
.legend-row{display:flex;gap:6px;flex-wrap:wrap;margin-top:12px;justify-content:center}
.legend-item{display:inline-flex;align-items:center;gap:5px;font-size:12px;color:#3c4043;padding:4px 12px;border:1px solid #dadce0;border-radius:20px;background:#fff;box-shadow:0 1px 2px rgba(0,0,0,.04)}
.legend-swatch{width:10px;height:10px;border-radius:3px;border:1px solid #1a1a1a}
.detail-panel{background:#fff;border:1px solid #ebebeb;border-radius:16px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,.04);margin-bottom:20px;overflow-x:auto}
.detail-header{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:16px}
.detail-title{font-size:22px;font-weight:400;color:#202124}
.detail-sub{font-size:13px;color:#80868b;margin-top:3px}
.footer{max-width:1440px;margin:0 auto;padding:0 40px 40px;text-align:center}
.footer-text{font-size:11px;color:#ccc}
.filter-dd{position:relative}
.filter-dd-btn{width:100%;padding:8px 14px;border:1px solid #dadce0;border-radius:20px;font-size:13px;background:#fff;cursor:pointer;text-align:left;color:#3c4043;display:flex;justify-content:space-between;align-items:center;box-sizing:border-box;transition:all .15s;outline:none}
.filter-dd-btn:hover{border-color:#1a1a1a}
.filter-dd-btn.active{border-color:#1a1a1a;background:#f5f5f5;font-weight:500}
.filter-dd-list{display:none;max-height:200px;overflow-y:auto;background:#fff;border:1px solid #dadce0;border-radius:12px;margin-top:4px;padding:4px 0;box-sizing:border-box;box-shadow:0 4px 16px rgba(0,0,0,.12);position:relative;left:0;right:0;z-index:500}
.filter-dd-list.open{display:block}
.filter-dd-item{display:flex;align-items:center;gap:8px;padding:7px 14px;font-size:13px;cursor:pointer;color:#3c4043;transition:background .1s}
.filter-dd-item:hover{background:#f1f3f4}
.filter-dd-item input{margin:0;accent-color:#1a1a1a;width:16px;height:16px}
.user-avatar{width:32px;height:32px;border-radius:50%;background:#024d8f;color:#fff;display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:600;cursor:pointer;letter-spacing:.5px}

/* ===================== PART 2 — price-page specific ===================== */
.page-header{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:20px}
.page-actions{display:flex;gap:8px;align-items:center;padding-top:4px}
.tb-btn:disabled{opacity:.45;cursor:not-allowed}
.tb-btn:disabled:hover{background:#fff}
.preview-badge{background:#fbbc04;color:#202124;font-size:11px;padding:3px 10px;border-radius:12px;font-weight:600;vertical-align:middle;margin-left:8px}
.icon-16{width:16px;height:16px}
.full-width{width:100%}
.mb-8{margin-bottom:8px}
.mb-10{margin-bottom:10px}
.mb-12{margin-bottom:12px}
/* quick-btn-row segmented style is defined in tungsten.css — no override needed here */
.dd-val-wrap{color:#555;font-weight:400}
.hl-input{width:100%;padding:8px 14px;border:1px solid #dadce0;border-radius:20px;font-size:12px;font-family:inherit;background:#fff;box-sizing:border-box;outline:none}
.empty-note{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;color:#80868b;font-size:13px;pointer-events:none;text-align:center}
.empty-note b{font-weight:500;color:#5f6368;font-size:14px}

/* ===================== PART 3 — 2-column price layout ===================== */

/* Two-column layout: overview table (left, sticky) + charts (right) */
.price-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 20px;
  align-items: start;
}

/* Overview panel — sticky left column */
.overview-panel {
  position: sticky;
  top: 88px;
  max-height: calc(100vh - 108px);
  overflow-y: auto;
  margin-bottom: 0;
  border-radius: 10px;
  padding: 0;
}
.overview-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 14px 10px;
  border-bottom: 1px solid #f1f3f4;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
  border-radius: 10px 10px 0 0;
}
.overview-panel-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.6px; color: #5f6368; }

/* Instrument watchlist cards */
.inst-group { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; color: #5f6368; padding: 10px 14px 4px; border-top: 1px solid #f1f3f4; margin-top: 2px; }
.inst-group:first-child { border-top: none; margin-top: 0; padding-top: 8px; }
.inst-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background 0.1s, border-color 0.1s;
  gap: 10px;
}
.inst-card:hover { background: #f8f9fa; }
.inst-card.selected { background: #eef4fb; border-left-color: #024d8f; }
.inst-main { flex: 1; min-width: 0; }
.inst-name { font-size: 13px; font-weight: 500; color: #1a1a1a; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.35; }
.inst-card.selected .inst-name { color: #024d8f; font-weight: 600; }
.inst-meta { font-size: 11px; color: #5f6368; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.inst-price-col { text-align: right; flex-shrink: 0; }
.inst-last { font-size: 13px; font-weight: 600; color: #1a1a1a; font-variant-numeric: tabular-nums; letter-spacing: -0.2px; }
.inst-fx-tag { font-size: 9px; font-weight: 600; color: #80868b; letter-spacing: 0.3px; margin-left: 3px; vertical-align: middle; }
.inst-chg { font-size: 11px; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; }
.inst-loading { padding: 20px 14px; font-size: 12px; color: #9aa0a6; }

/* Chart area — right column */
.chart-area { min-width: 0; }

/* Hero price display */
.price-hero-wrap {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 16px;
  padding: 16px 20px;
  background: #f8f9fa;
  border-radius: 10px;
}
.price-hero-label { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: #80868b; font-weight: 600; margin-bottom: 4px; }
.price-hero-row { display: flex; align-items: baseline; gap: 10px; }
.price-hero-value { font-size: 32px; font-weight: 400; color: #1a1a1a; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.price-hero-change { font-size: 13px; font-weight: 600; }
.price-hero-change.pos { color: #188038; }
.price-hero-change.neg { color: #c62828; }
.price-hero-meta { font-size: 11px; color: #80868b; margin-top: 2px; }

/* Stat chips — right side of hero */
.price-stat-line { display: flex; gap: 20px; flex-wrap: wrap; }
.stat-chip { display: flex; flex-direction: column; gap: 2px; }
.stat-chip .l { font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: #98a2b3; }
.stat-chip .v { font-size: 14px; font-weight: 600; color: #1a1a1a; font-variant-numeric: tabular-nums; }

/* Main chart + sub-pane in one seamless container */
.price-chart-container {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 20px 20px 16px;
  margin-bottom: 16px;
}
.price-chart-container .chart-header { margin-bottom: 8px; }
.price-chart-container .chart-title { font-size: 15px; font-weight: 500; }
.price-chart-container .chart-wrap { height: 320px; overflow: hidden; position: relative; }
.price-chart-container .legend-row { margin-top: 8px; justify-content: flex-start; }

/* Subpane attached below main chart */
.subpane-divider { height: 1px; background: #e8eaed; margin: 14px -20px; }
.subpane-header { margin-bottom: 6px; }
.subpane-title { font-size: 12px !important; font-weight: 500 !important; color: #5f6368 !important; text-transform: uppercase; letter-spacing: .4px; }
.sub-chart-wrap { height: 140px; overflow: hidden; position: relative; }

/* Monthly diff panel */
.diff-panel { margin-bottom: 16px; }

/* Difference table */
.diff-table{width:100%;border-collapse:collapse;font-size:12px}
.diff-table th{text-align:left;font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.5px;color:#80868b;padding:7px 10px;border-bottom:1px solid #e4e9f0;background:#f8fafc}
.diff-table td{padding:7px 10px;border-bottom:1px solid #f1f3f4;color:#3c4043;font-variant-numeric:tabular-nums}
.diff-table th.r,.diff-table td.r{text-align:right}
.diff-table .empty-row td{text-align:center;color:#80868b;padding:24px 10px}
.diff-pos{color:#188038}
.diff-neg{color:#c62828}

/* ---- Tick flash （价格变动时闪烁）---- */
@keyframes tick-up {
  0%   { background: rgba(24, 128, 56, 0.28); }
  100% { background: transparent; }
}
@keyframes tick-down {
  0%   { background: rgba(198, 40, 40, 0.28); }
  100% { background: transparent; }
}
.tick-up   { animation: tick-up   0.75s ease-out forwards; border-radius: 3px; }
.tick-down { animation: tick-down 0.75s ease-out forwards; border-radius: 3px; }

/* ---- 固定 Tooltip 卡片（右上角） ---- */
.price-tt {
  position: absolute;
  top: 8px; right: 8px;
  background: rgba(13, 24, 40, 0.93);
  border: 1px solid rgba(100, 140, 180, 0.28);
  border-radius: 4px;
  padding: 8px 11px;
  min-width: 118px;
  pointer-events: none;
  z-index: 10;
  backdrop-filter: blur(4px);
}
.ptt-date { color: #7a9bb5; font-size: 10px; letter-spacing: 0.3px; margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.ptt-row  { display: flex; align-items: center; gap: 7px; margin-bottom: 3px; }
.ptt-dot  { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.ptt-val  { font-size: 13px; font-weight: 600; color: #e2e8f0; font-variant-numeric: tabular-nums; letter-spacing: -0.3px; }
.ccy-toggle button:disabled{opacity:.35;cursor:not-allowed;text-decoration:line-through}
.ccy-note{font-size:11px;color:#80868b;margin-top:6px;line-height:1.5}
.rank-scroll{overflow-x:auto}
.filter-dd-item-disabled{opacity:.4;cursor:not-allowed}
.filter-dd-item-empty{color:#80868b}
