
    :root {
      color-scheme: light dark;
      --bg: #f7f7f4;
      --panel: #ffffff;
      --ink: #17202a;
      --muted: #687383;
      --line: #dde1e6;
      --green: #159947;
      --red: #c43f3f;
      --blue: #2563eb;
      --amber: #a16207;
      --shadow: 0 10px 28px rgba(15, 23, 42, .08);
      --chart-bg: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
      --chart-border: #e7ebef;
      --tooltip-bg: #1e293b;
      --tooltip-text: #f1f5f9;
      --row-border: #edf0f2;
      --skeleton: #e5e7eb;
    }

    /* 鏆楄壊妯″紡 */
    @media (prefers-color-scheme: dark) {
      :root {
        --bg: #0f172a;
        --panel: #1e293b;
        --ink: #f1f5f9;
        --muted: #94a3b8;
        --line: #334155;
        --green: #4ade80;
        --red: #f87171;
        --blue: #60a5fa;
        --amber: #fbbf24;
        --shadow: 0 10px 28px rgba(0, 0, 0, .3);
        --chart-bg: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
        --chart-border: #334155;
        --tooltip-bg: #0f172a;
        --tooltip-text: #e2e8f0;
        --row-border: #334155;
        --skeleton: #334155;
      }
    }

    * { box-sizing: border-box; }
    html {
      width: 100%;
      overflow-x: hidden;
    }
    body {
      margin: 0;
      font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      background: var(--bg);
      color: var(--ink);
      font-variant-numeric: tabular-nums;
      width: 100%;
      overflow-x: hidden;
    }
    main {
      width: min(100%, 980px);
      margin: 0 auto;
      padding: 18px 14px 36px;
    }
    header {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 14px;
      padding: 14px 2px 18px;
      min-width: 0;
    }
    h1 {
      margin: 0;
      font-size: 24px;
      line-height: 1.1;
      letter-spacing: 0;
    }
    .sub {
      margin: 7px 0 0;
      color: var(--muted);
      font-size: 13px;
      line-height: 1.4;
    }
    .internal-warn {
      display: inline-block;
      margin: 6px 0 0;
      padding: 2px 8px;
      border: 1px solid #dc2626;
      border-radius: 4px;
      color: #dc2626;
      font-size: 12px;
      font-weight: 600;
      letter-spacing: 0.5px;
    }
    button {
      appearance: none;
      border: 0;
      border-radius: 8px;
      min-height: 44px;
      padding: 0 16px;
      background: var(--ink);
      color: var(--panel);
      font-weight: 700;
      font-size: 15px;
      white-space: nowrap;
      cursor: pointer;
      transition: opacity 0.2s, transform 0.1s;
    }
    button:active:not(:disabled) { transform: scale(0.97); }
    .top-actions {
      display: grid;
      gap: 8px;
      justify-items: end;
      min-width: 0;
    }
    .language-select {
      min-height: 36px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--panel);
      color: var(--ink);
      font-size: 13px;
      font-weight: 800;
      padding: 0 8px;
    }
    .desktop-mode-toggle {
      display: none;
    }
    button:disabled { opacity: .55; }

    /* 鍒锋柊鎸夐挳鍔犳棆杞浘鏍囧姩鐢?*/
    #refresh {
      position: relative;
    }
    #refresh.loading::before {
      content: '';
      position: absolute;
      left: 12px;
      top: 50%;
      width: 14px;
      height: 14px;
      margin-top: -7px;
      border: 2px solid currentColor;
      border-top-color: transparent;
      border-radius: 50%;
      animation: spin 0.8s linear infinite;
    }
    #refresh.loading { padding-left: 36px; }
    @keyframes spin { to { transform: rotate(360deg); } }

    .countdown {
      font-variant-numeric: tabular-nums;
      color: var(--ink);
      font-weight: 700;
      font-size: 13px;
      margin-left: 8px;
      font-family: ui-monospace, "SF Mono", Consolas, monospace;
    }
    .status #countdown {
      font-variant-numeric: tabular-nums;
      color: var(--blue);
      font-weight: 700;
    }
    .status {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      min-height: 38px;
      margin-bottom: 12px;
      color: var(--muted);
      font-size: 13px;
    }
    .tap-hint {
      display: none;
    }

    /* Cross-device collapsible cards: hide all heavy content until explicitly opened. */
    .card.is-collapsible:not(.expanded) > :not(.card-head):not(.tap-hint) {
      display: none !important;
    }
    .card.is-collapsible:not(.expanded) > .tap-hint {
      display: block !important;
      margin: 0 12px 12px;
      padding: 12px 14px;
      border: 1px solid rgba(37, 99, 235, 0.28);
      border-radius: 8px;
      background: rgba(37, 99, 235, 0.08);
      text-align: center;
      color: var(--blue);
      font-size: 13px;
      font-weight: 750;
      opacity: 1;
      letter-spacing: 0;
    }
    .card.is-collapsible > .card-head {
      cursor: pointer;
      user-select: none;
      -webkit-tap-highlight-color: transparent;
    }
    .collapse-open-btn {
      min-height: 32px;
      margin-left: 8px;
      padding: 0 14px;
      border-radius: 999px;
      background: var(--blue);
      color: #fff;
      font-size: 13px;
      font-weight: 800;
      vertical-align: middle;
      box-shadow: 0 3px 10px rgba(37, 99, 235, 0.24);
    }
    .grid {
      display: grid;
      gap: 16px;
      min-width: 0;
    }

    /* P0 淇锛氱Щ闄?overflow: hidden锛岃 tooltip 鍙孩鍑?*/
    .card {
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: 8px;
      box-shadow: var(--shadow);
      overflow: visible;
      transition: box-shadow 0.2s, transform 0.2s;
      min-width: 0;
    }
    /* 鍗＄墖 hover 寰氦浜?*/
    .card:hover {
      box-shadow: 0 14px 36px rgba(15, 23, 42, .12);
    }
    .card-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      padding: 14px 14px 10px;
      border-bottom: 1px solid var(--line);
      min-width: 0;
    }
    h2 {
      margin: 0;
      font-size: 16px;
      letter-spacing: 0;
    }
    .badge {
      padding: 4px 8px;
      border-radius: 999px;
      background: #ecfdf3;
      color: #14763b;
      font-size: 12px;
      font-weight: 700;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      max-width: 220px;
    }
    .badge.warn {
      background: #fef3c7;
      color: var(--amber);
    }
    .rows {
      display: grid;
    }
    .row {
      display: grid;
      grid-template-columns: 1fr auto;
      gap: 12px;
      align-items: center;
      min-height: 56px;
      padding: 10px 14px;
      border-bottom: 1px solid var(--row-border);
      min-width: 0;
    }
    .row:last-child { border-bottom: 0; }
    .pair {
      font-size: 13px;
      color: var(--muted);
    }
    .pair a {
      color: var(--blue);
      text-decoration: none;
    }
    .pair a:hover { text-decoration: underline; }
    .pair.up { color: var(--green); font-weight: 600; }
    .pair.down { color: var(--red); font-weight: 600; }
    .pair a:hover { text-decoration: underline; }
    .label {
      margin-top: 3px;
      font-weight: 700;
      font-size: 15px;
    }
    .value {
      font-variant-numeric: tabular-nums;
      font-size: 20px;
      font-weight: 800;
      text-align: right;
    }
    .delta {
      margin-top: 4px;
      font-size: 12px;
      color: var(--muted);
      text-align: right;
      font-variant-numeric: tabular-nums;
    }
    .delta.muted { color: #94a3b8; }
    .delta.muted a { color: #94a3b8; text-decoration: none; }
    .delta.muted a:hover { text-decoration: underline; }
    /* P2-12: 鍙樺寲鍊奸鑹叉洿鏄庢樉 */
    .delta.up { color: var(--green); font-weight: 700; }
    .delta.down { color: var(--red); font-weight: 700; }
    .platforms {
      display: grid;
      gap: 5px;
      min-width: 158px;
      text-align: right;
      max-width: 100%;
    }
    .platform-rate {
      display: flex;
      align-items: baseline;
      justify-content: flex-end;
      gap: 8px;
      white-space: nowrap;
      font-variant-numeric: tabular-nums;
    }
    .platform-name {
      color: var(--muted);
      font-size: 12px;
      font-weight: 700;
    }
    .platform-value {
      color: var(--ink);
      font-size: 16px;
      font-weight: 800;
    }
    .note {
      padding: 10px 14px 14px;
      color: var(--muted);
      font-size: 12px;
      line-height: 1.45;
      border-top: 1px solid var(--row-border);
    }
    .links {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      padding: 12px 0 0;
    }
    a {
      color: var(--blue);
      text-decoration: none;
      font-size: 13px;
      font-weight: 700;
    }
    .error {
      color: var(--red);
      font-size: 12px;
      line-height: 1.4;
      padding: 0 14px 12px;
    }

    /* P1-6: 閿欒鐘舵€佸崱鐗?*/
    .card.error-state {
      border-color: var(--red);
      box-shadow: 0 0 0 3px rgba(196, 63, 63, 0.1);
    }
    .card.error-state .card-head h2 {
      color: var(--red);
    }
    .error-retry-btn {
      min-height: 32px;
      padding: 0 12px;
      font-size: 12px;
      background: var(--red);
      color: #fff;
      border: none;
      border-radius: 6px;
      cursor: pointer;
      margin-top: 8px;
    }

    .chart-wrap {
      position: relative;
      padding: 14px;
      min-width: 0;
    }
    .chart {
      width: 100%;
      height: 140px;
      display: block;
      background: var(--chart-bg);
      border: 1px solid var(--chart-border);
      border-radius: 8px;
      transition: opacity 0.3s;
    }
    /* P2-13: range 鍒囨崲鏃跺浘琛?fade 鍔ㄧ敾 */
    .chart.fading {
      opacity: 0.4;
    }
    .legend {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      margin-top: 10px;
      color: var(--muted);
      font-size: 12px;
    }
    .legend .chart-legend-toggle {
      display: inline-flex;
      align-items: center;
      border: 1px solid var(--line);
      border-radius: 7px;
      background: var(--panel);
      padding: 5px 8px;
      margin: 0;
      color: inherit;
      font: inherit;
      font-weight: 600;
      cursor: pointer;
      box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    }
    .legend .chart-legend-toggle:hover {
      background: var(--hover-bg, rgba(148, 163, 184, 0.16));
      border-color: var(--blue);
      color: var(--text);
    }
    .legend .chart-legend-toggle.is-hidden {
      opacity: 0.52;
      background: transparent;
      border-style: dashed;
      text-decoration: line-through;
    }
    .legend .chart-legend-toggle.is-hidden .dot {
      filter: grayscale(1);
    }
    .dot {
      display: inline-block;
      width: 9px;
      height: 9px;
      border-radius: 999px;
      margin-right: 5px;
      vertical-align: -1px;
      background: var(--blue);
    }
    .dot.green { background: var(--green); }
    .dot.amber { background: #d97706; }
    .dot.red { background: var(--red); }
    .dot.purple { background: #8b5cf6; }
    .dot.gray { background: #64748b; }
    .dot.teal { background: #0f766e; }
    .dot.pink { background: #db2777; }
    /* 缁勫悎鍥炬姌绾垮浘渚嬫爣璇?*/
    .line-dot {
      display: inline-block;
      width: 16px;
      height: 0;
      border-top: 2.5px solid var(--blue);
      margin-right: 5px;
      vertical-align: -1px;
    }
    /* 骞宠甯傚満鍥捐〃鍖哄煙锛氬浘渚?鎽樿/鐘舵€佽 宸﹀彸鐣欑櫧 */
    #legend-manual-rate,
    #changes-manual-rate {
      margin-left: 18px;
      margin-right: 18px;
    }
    #rate-line-manual-rate {
      margin-left: 18px;
      margin-right: 18px;
    }
    .chart-tools {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 10px;
      margin-top: 10px;
      color: var(--muted);
      font-size: 12px;
      min-width: 0;
    }
    .chart-mode {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      font-weight: 700;
      color: var(--ink);
    }
    .chart-mode input {
      width: 18px;
      height: 18px;
      accent-color: var(--blue);
    }

    /* P1-5: 楠ㄦ灦灞?*/
    .skeleton {
      background: var(--skeleton);
      border-radius: 4px;
      animation: skeleton-pulse 1.5s ease-in-out infinite;
    }
    @keyframes skeleton-pulse {
      0%, 100% { opacity: 1; }
      50% { opacity: 0.5; }
    }
    .skeleton-row {
      height: 56px;
      padding: 10px 14px;
      display: grid;
      grid-template-columns: 1fr auto;
      gap: 12px;
      align-items: center;
      border-bottom: 1px solid var(--row-border);
    }
    .skeleton-text {
      height: 14px;
      border-radius: 4px;
    }
    .skeleton-value {
      height: 20px;
      width: 60px;
      border-radius: 4px;
    }

    .chart-tooltip {
      position: absolute;
      display: none;
      background: var(--tooltip-bg);
      color: var(--tooltip-text);
      padding: 8px 12px;
      border-radius: 8px;
      font-size: 12px;
      font-variant-numeric: tabular-nums;
      pointer-events: none;
      white-space: nowrap;
      z-index: 100;
      box-shadow: 0 4px 16px rgba(0,0,0,0.3);
      max-width: min(320px, calc(100vw - 28px));
      overflow-wrap: anywhere;
    }
    /* P2-14: tooltip 搴曢儴绠ご */
    .chart-tooltip::after {
      content: '';
      position: absolute;
      bottom: -6px;
      left: 20px;
      width: 0;
      height: 0;
      border-left: 6px solid transparent;
      border-right: 6px solid transparent;
      border-top: 6px solid var(--tooltip-bg);
    }
    .chart-tooltip .tt-time {
      color: #94a3b8;
      margin-bottom: 4px;
      font-size: 11px;
    }
    .chart-tooltip .tt-row {
      display: flex;
      align-items: center;
      gap: 6px;
      margin: 2px 0;
    }
    .chart-tooltip .tt-dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      flex-shrink: 0;
    }
    .change-list {
      display: grid;
      gap: 4px;
      margin-top: 8px;
      color: var(--muted);
      font-size: 12px;
      font-variant-numeric: tabular-nums;
    }
    .ref-links {
      margin-top: 12px;
      display: grid;
      gap: 10px;
    }
    .ref-item {
      display: grid;
      grid-template-columns: 1fr auto;
      gap: 10px;
      align-items: center;
      padding: 12px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--panel);
      min-width: 0;
    }
    .ref-title {
      font-weight: 800;
      font-size: 14px;
    }
    .ref-url {
      margin-top: 4px;
      color: var(--muted);
      font-size: 12px;
      line-height: 1.35;
      overflow-wrap: anywhere;
    }
    .copy-btn {
      min-height: 38px;
      padding: 0 12px;
      background: #eef2ff;
      color: #1d4ed8;
      border: 1px solid #c7d2fe;
      font-size: 13px;
    }
    .head-actions {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
      justify-content: flex-end;
    }
    .mini-btn {
      min-height: 32px;
      padding: 0 10px;
      border-radius: 999px;
      background: var(--panel);
      color: var(--ink);
      border: 1px solid var(--line);
      font-size: 12px;
      font-weight: 800;
    }
    .mini-btn.active {
      background: #fff7ed;
      color: #c2410c;
      border-color: #fed7aa;
    }
    .range-tabs {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 8px;
      margin-top: 12px;
    }
    .range-btn {
      min-height: 38px;
      padding: 0 10px;
      background: var(--panel);
      color: var(--ink);
      border: 1px solid var(--line);
      font-size: 13px;
      transition: all 0.2s;
    }
    .range-btn.active {
      background: #fff7ed;
      color: #c2410c;
      border-color: #fed7aa;
    }
    .chart-selectors {
      display: grid;
      grid-template-columns: 1fr auto 1fr;
      gap: 8px;
      align-items: center;
      margin-bottom: 12px;
      min-width: 0;
    }
    .currency-select {
      width: 100%;
      min-height: 42px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--panel);
      color: var(--ink);
      font-size: 15px;
      font-weight: 800;
      padding: 0 10px;
    }
    .swap-mark {
      color: var(--muted);
      font-weight: 900;
    }
    .rate-line {
      display: flex;
      justify-content: space-between;
      gap: 12px;
      align-items: baseline;
      margin: 8px 0 12px;
      font-variant-numeric: tabular-nums;
    }
    .rate-line strong {
      font-size: 18px;
    }

    /* 绉诲姩绔紭鍏堟柇鐐?*/
    @media (min-width: 760px) {
      main { padding-top: 28px; }
      h1 { font-size: 30px; }
      .grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
      .wide { grid-column: 1 / -1; }
    }

    @media (min-width: 1120px) {
      main {
        width: min(100%, 1180px);
        padding-left: 18px;
        padding-right: 18px;
      }
      .grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        align-items: start;
      }
      .wide { grid-column: 1 / -1; }
      .chart { height: 170px; }
      .chart-wrap { padding: 18px; }
    }

    /* P0-2/P0-3: 绉诲姩绔€傞厤 */
    @media (max-width: 759px) {
      main { padding: 12px 10px 24px; }
      header { flex-direction: column; gap: 10px; padding: 10px 0 14px; }
      h1 { font-size: 20px; }
      .sub { font-size: 12px; }
      .grid { gap: 12px; }
      .card { border-radius: 6px; }
      .card-head { padding: 12px 12px 8px; flex-wrap: wrap; }
      h2 { font-size: 14px; }
      .row { min-height: 48px; padding: 8px 12px; }
      .value { font-size: 17px; }
      .platform-value { font-size: 14px; }
      .chart-wrap { padding: 10px; }
      .chart { height: 110px; }
      .chart-selectors { grid-template-columns: 1fr auto 1fr; gap: 6px; }
      .currency-select { min-height: 38px; font-size: 13px; }
      .range-btn { min-height: 34px; font-size: 12px; padding: 0 6px; }
      button { min-height: 40px; font-size: 14px; padding: 0 12px; }
      .chart-tools { flex-wrap: wrap; justify-content: flex-start; }
      .rate-line { flex-wrap: wrap; align-items: flex-start; gap: 4px 10px; }

      /* Badge 鍦ㄤ腑绛夊睆骞曚篃鍏佽鎴柇 */
      .badge {
        max-width: 200px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

      .mr-form { grid-template-columns: 1fr; gap: 10px; }
      .mr-table { font-size: 11px; }
      .mr-table th, .mr-table td { padding: 4px 6px; }

      /* 骞冲彴鏁版嵁鍦ㄤ腑绛夋墜鏈轰笂绋嶅井绱у噾 */
      .platforms { min-width: 120px; }

      /* 鍐呴儴璀﹀憡鏍囩鍦ㄦ墜鏈轰笂鏇寸揣鍑?*/
      .internal-warn { font-size: 11px; padding: 2px 6px; }

      /* 鐘舵€佹爮鍦ㄦ墜鏈轰笂鎹㈣ */
      .status { flex-wrap: wrap; gap: 6px; min-height: auto; }

      /* 璇█閫夋嫨 + 鍒锋柊鎸夐挳妯帓 */
      .top-actions { 
        display: flex;
        flex-direction: row; 
        align-items: center; 
        justify-content: flex-start;
        width: 100%;
      }
    }

    /* 瓒呭皬灞忓箷锛?520px 鎵嬫満绔栧睆锛?*/
    @media (max-width: 519px) {
      main { padding: 8px 6px 20px; }
      h1 { font-size: 18px; }
      .sub { font-size: 11px; }

      /* Header 鏇寸揣鍑?*/
      header > div:first-child { gap: 4px; }
      .internal-warn { font-size: 10px; padding: 2px 5px; display: inline-block; max-width: fit-content; }

      /* Badge: 鍏佽鎹㈣锛屼笉鍐嶆埅鏂?*/
      .badge {
        white-space: normal;
        max-width: none;
        font-size: 11px;
        line-height: 1.3;
        text-align: right;
      }

      /* Row: 鍗曞垪鍫嗗彔锛宲air 淇℃伅绱у噾 */
      .row {
        grid-template-columns: 1fr;
        gap: 6px;
        min-height: auto;
        padding: 10px 12px;
      }
      .row > div:first-child {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
      }
      .row .pair { font-size: 12px; min-width: 0; flex-shrink: 0; }
      .row .label { font-size: 13px; margin-top: 0; }
      .row .rev-btn { 
        min-height: 28px; padding: 0 8px; font-size: 11px; 
        flex-shrink: 0;
      }

      /* Platforms: 鍗曞垪绾靛悜鍫嗗彔锛屾瘡涓钩鍙颁竴琛岋紙鍚嶇О宸?鏁板€煎彸锛?*/
      .platforms {
        min-width: 0 !important;
        width: 100%;
        text-align: left !important;
        grid-template-columns: 1fr !important;
        gap: 3px;
      }
      .platform-rate {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 8px;
        padding: 5px 8px;
        background: rgba(127,127,127,0.06);
        border: 1px solid var(--line);
        border-radius: 6px;
        white-space: normal !important;
        overflow: hidden;
        min-width: 0;
      }
      .platform-rate .platform-name { 
        font-size: 12px; 
        line-height: 1.3;
        white-space: normal;
        word-break: break-word;
        flex: 1;
        min-width: 0;
      }
      .platform-rate .platform-name small { font-size: 10px; }
      .platform-rate .platform-value { font-size: 15px; line-height: 1.3; flex-shrink: 0; }

      /* Delta: 鏇寸揣鍑戯紝鍏佽鎹㈣ */
      .delta {
        font-size: 11px;
        line-height: 1.5;
        text-align: left !important;
        margin-top: 2px;
        padding-top: 4px;
        border-top: 1px dashed var(--line);
        white-space: normal !important;
        word-break: break-word;
        overflow-wrap: anywhere;
      }

      /* 鍥捐〃楂樺害澧炲姞 */
      .chart { height: 120px; }
      .chart-selectors {
        grid-template-columns: 1fr;
        gap: 6px;
      }
      .swap-mark {
        text-align: center;
        line-height: 1;
      }
      .range-tabs {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
      }
      .legend {
        gap: 6px 10px;
        font-size: 11px;
      }
      .change-list {
        font-size: 11px;
        line-height: 1.45;
      }
      .chart-tooltip {
        white-space: normal;
        font-size: 11px;
      }
      .ref-item {
        grid-template-columns: 1fr;
        align-items: stretch;
      }
      .copy-btn {
        width: 100%;
      }

      /* Card head: badge 鎹㈣涓嶆孩鍑?*/
      .card-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding: 10px 12px 8px;
      }
      .head-actions {
        justify-content: flex-start;
        width: 100%;
      }
      .head-actions .badge {
        max-width: none;
        display: inline;
      }
      .head-actions .countdown {
        margin-left: 0;
        font-size: 12px;
      }
    }

    /* ===== Manual Rate Entry (榛戝競姹囩巼鎻愭姤) ===== */
    .mr-form {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 16px 24px;
      margin-bottom: 12px;
      padding: 14px 18px;
    }
    .mr-form .mr-field {
      display: flex;
      flex-direction: column;
      gap: 4px;
    }
    .mr-field-pair { min-width: 0; } /* pair select fits nicely */
    .mr-field-btn { grid-column: 1 / -1; display: flex; justify-content: flex-start; }
    .mr-field-btn label { visibility: hidden; }
    .mr-form label {
      font-size: 12px;
      color: var(--muted);
      font-weight: 600;
    }
    .mr-form input, .mr-form select {
      padding: 8px 10px;
      border: 1px solid var(--line);
      border-radius: 8px;
      font-size: 14px;
      font-family: inherit;
      background: var(--panel);
      color: var(--ink);
    }
    .mr-form input:focus, .mr-form select:focus {
      outline: none;
      border-color: var(--blue);
      box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
    }
    .mr-submit {
      align-self: end;
      padding: 8px 20px;
      border: none;
      border-radius: 8px;
      background: #3b82f6;
      color: #fff;
      font-size: 14px;
      font-weight: 600;
      cursor: pointer;
      transition: background 0.2s;
    }
    .mr-submit:hover { background: #2563eb; }
    .mr-submit:disabled { background: #94a3b8; cursor: not-allowed; }
    .mr-tz-toggle {
      display: inline-flex;
      gap: 0;
      border: 1px solid var(--line);
      border-radius: 8px;
      overflow: hidden;
    }
    .mr-tz-toggle button {
      padding: 8px 12px;
      border: none;
      background: transparent;
      font-size: 13px;
      cursor: pointer;
      color: var(--ink);
      font-family: inherit;
    }
    .mr-tz-toggle button.active {
      background: #3b82f6 !important;
      color: #fff !important;
      font-weight: 600 !important;
    }

    /* P2-15: 鎵嬪姩褰曞叆琛ㄦ牸鍥哄畾鍓嶄袱鍒?*/
    .mr-table-wrap {
      overflow-x: auto;
      max-height: 480px;
      overflow-y: auto;
      border: 1px solid var(--line);
      border-radius: 8px;
      -webkit-overflow-scrolling: touch;
      margin: 0 18px;
    }
    .mr-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 12px;
      font-variant-numeric: tabular-nums;
    }
    .mr-table th {
      position: sticky;
      top: 0;
      background: var(--panel);
      color: var(--muted);
      font-weight: 600;
      padding: 8px 10px;
      text-align: left;
      border-bottom: 1px solid var(--line);
      white-space: nowrap;
      z-index: 2;
    }
    /* 鍥哄畾鍓嶄袱鍒?*/
    .mr-table th:nth-child(1),
    .mr-table td:nth-child(1) {
      position: sticky;
      left: 0;
      z-index: 1;
      background: var(--panel);
    }
    .mr-table th:nth-child(2),
    .mr-table td:nth-child(2) {
      position: sticky;
      left: 0;
      z-index: 1;
      background: var(--panel);
    }
    .mr-table td {
      padding: 5px 8px;
      border-bottom: 1px solid var(--row-border);
      white-space: nowrap;
    }
    .mr-table tr:hover td {
      background: var(--bg);
    }
    .mr-diff-neg { color: #ef4444; font-weight: 700; }
    .mr-diff-pos { color: #22c55e; font-weight: 700; }
    .mr-diff-null { color: #94a3b8; }
    .mr-actions {
      display: flex;
      gap: 12px;
      align-items: center;
      margin-bottom: 10px;
      flex-wrap: wrap;
      padding: 0 18px;
    }
    .mr-range-tabs {
      display: inline-flex;
      gap: 2px;
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 2px;
    }
    .mr-range-tabs button {
      padding: 4px 12px;
      border: none;
      background: transparent;
      color: var(--muted);
      font-size: 12px;
      border-radius: 6px;
      cursor: pointer;
      transition: all 0.15s;
      font-family: inherit;
    }
    .mr-range-tabs button:hover { color: var(--ink); }
    .mr-range-tabs button.active {
      background: var(--blue);
      color: #fff;
    }
    .mr-filter-hint {
      font-size: 11px;
      color: var(--muted);
      margin-left: 4px;
    }
    .mr-download {
      padding: 6px 16px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: transparent;
      color: var(--ink);
      font-size: 13px;
      font-weight: 600;
      cursor: pointer;
      text-decoration: none;
      display: inline-flex;
      align-items: center;
      gap: 4px;
      font-family: inherit;
    }
    .mr-download:hover { background: var(--bg); }
    .mr-count {
      font-size: 13px;
      color: var(--muted);
    }
    .mr-inverted-tag {
      display: inline-block;
      padding: 1px 6px;
      border-radius: 4px;
      font-size: 11px;
      font-weight: 600;
      background: #fef3c7;
      color: #92400e;
      margin-left: 4px;
    }
    .mr-delete-btn {
      padding: 2px 8px;
      border: none;
      border-radius: 4px;
      background: transparent;
      color: #ef4444;
      cursor: pointer;
      font-size: 12px;
      font-family: inherit;
    }
    .mr-delete-btn:hover { background: #fef2f2; }
    .mr-status {
      font-size: 13px;
      padding: 6px 18px;
      color: var(--muted);
    }
    .mr-status.error { color: #ef4444; }
    .mr-status.success { color: #22c55e; }

    /* 鍙屾椂鍖虹湅鏉?*/
    .mr-clock {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 4px 10px;
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: 8px;
      font-size: 12px;
    }
    .mr-clock-item {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 1px;
    }
    .mr-clock-label {
      font-size: 10px;
      color: var(--muted);
      font-weight: 600;
      white-space: nowrap;
    }
    .mr-clock-time {
      font-size: 14px;
      font-weight: 700;
      color: var(--ink);
      font-variant-numeric: tabular-nums;
      line-height: 1.2;
    }
    .mr-clock-divider {
      width: 1px;
      height: 22px;
      background: var(--line);
    }

    /* 鎵归噺褰曞叆妯″紡 */
    .mr-mode-tabs {
      display: flex;
      gap: 0;
      margin: 0 18px 10px;
      border-bottom: 2px solid var(--line);
      align-items: center;
    }
    .mr-tz-shared {
      margin-left: auto;
      display: flex;
      align-items: center;
      gap: 6px;
      font-size: 12px;
      color: var(--muted);
      font-weight: 600;
    }
    .mr-mode-tabs button {
      padding: 8px 18px;
      border: none;
      background: none;
      cursor: pointer;
      font-size: 13px;
      font-weight: 600;
      color: var(--muted);
      border-bottom: 2px solid transparent;
      margin-bottom: -2px;
      transition: all 0.2s;
    }
    .mr-mode-tabs button.active {
      color: var(--blue);
      border-bottom-color: var(--blue);
    }
    .mr-mode-tabs button:hover:not(.active) {
      color: var(--ink);
    }
    .mr-batch {
      padding: 0 18px 12px;
    }
    /* 瀛愭ā寮忓垏鎹?*/
    .mr-sub-tabs {
      display: flex;
      gap: 4px;
      margin-bottom: 10px;
      flex-wrap: wrap;
    }
    .mr-sub-tabs button {
      padding: 6px 12px;
      border: 1px solid var(--line);
      border-radius: 6px;
      background: var(--panel);
      cursor: pointer;
      font-size: 12px;
      font-weight: 600;
      color: var(--muted);
      transition: all 0.2s;
    }
    .mr-sub-tabs button.active {
      background: var(--blue);
      color: #fff;
      border-color: var(--blue);
    }
    .mr-sub-tabs button:hover:not(.active) {
      border-color: var(--blue);
      color: var(--blue);
    }
    .mr-sub-panel { animation: fadeIn 0.2s ease; }
    @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
    /* 鏋侀€熻繛缁綍鍏?*/
    .mr-rapid-form {
      display: grid;
      grid-template-columns: 1fr 1.3fr 1fr 1fr auto;
      gap: 10px;
      align-items: end;
    }
    .mr-rapid-field label {
      display: block; font-size: 11px; color: var(--muted);
      font-weight: 600; margin-bottom: 4px;
    }
    .mr-rapid-field input {
      width: 100%; padding: 8px 10px; border: 1px solid var(--line);
      border-radius: 6px; font-size: 13px; font-family: inherit;
      background: var(--panel); color: var(--ink); box-sizing: border-box;
    }
    .mr-rapid-field input:focus {
      outline: none; border-color: var(--blue);
      box-shadow: 0 0 0 2px rgba(59,130,246,0.15);
    }
    .mr-rapid-btn button { padding: 8px 16px; white-space: nowrap; }
    .mr-rapid-log {
      margin-top: 10px; max-height: 150px; overflow-y: auto; font-size: 12px;
    }
    .mr-rapid-log-item {
      padding: 4px 8px; border-radius: 4px; margin-bottom: 3px;
      font-variant-numeric: tabular-nums;
    }
    .mr-rapid-log-item.ok { background: rgba(34,197,94,0.08); color: var(--green); }
    .mr-rapid-log-item.err { background: rgba(239,68,68,0.08); color: var(--red); }
    .mr-batch-hint {
      font-size: 12px;
      color: var(--muted);
      line-height: 1.7;
      margin-bottom: 8px;
      padding: 8px 10px;
      background: rgba(59,130,246,0.05);
      border-radius: 6px;
      border-left: 3px solid var(--blue);
    }
    .mr-batch-hint code {
      background: rgba(0,0,0,0.06);
      padding: 1px 4px;
      border-radius: 3px;
      font-size: 11px;
      color: var(--ink);
    }
    .mr-batch-input {
      width: 100%;
      min-height: 120px;
      padding: 10px 12px;
      border: 1px solid var(--line);
      border-radius: 8px;
      font-family: 'Courier New', Consolas, monospace;
      font-size: 13px;
      line-height: 1.6;
      resize: vertical;
      background: var(--panel);
      color: var(--ink);
      box-sizing: border-box;
    }
    .mr-batch-input:focus {
      outline: none;
      border-color: var(--blue);
      box-shadow: 0 0 0 2px rgba(59,130,246,0.15);
    }
    .mr-batch-actions {
      display: flex;
      align-items: center;
      gap: 10px;
      margin-top: 8px;
    }
    .mr-batch-parse, .mr-batch-submit {
      padding: 8px 18px;
      border: none;
      border-radius: 6px;
      font-size: 13px;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s;
    }
    .mr-batch-parse {
      background: var(--panel);
      color: var(--ink);
      border: 1px solid var(--line);
    }
    .mr-batch-parse:hover { border-color: var(--blue); color: var(--blue); }
    .mr-batch-submit {
      background: var(--blue);
      color: #fff;
    }
    .mr-batch-submit:hover:not(:disabled) { background: #2563eb; }
    .mr-batch-submit:disabled { background: #94a3b8; cursor: not-allowed; }
    .mr-batch-count {
      font-size: 12px;
      color: var(--muted);
      font-weight: 600;
    }
    .mr-batch-preview-wrap {
      margin-top: 10px;
      max-height: 300px;
      overflow-y: auto;
      border: 1px solid var(--line);
      border-radius: 8px;
    }
    .mr-batch-preview {
      width: 100%;
      border-collapse: collapse;
      font-size: 12px;
    }
    .mr-batch-preview th {
      background: var(--panel);
      padding: 6px 8px;
      text-align: left;
      font-weight: 700;
      color: var(--muted);
      border-bottom: 1px solid var(--line);
      position: sticky;
      top: 0;
      z-index: 1;
    }
    .mr-batch-preview td {
      padding: 5px 8px;
      border-bottom: 1px solid var(--row-border);
      font-variant-numeric: tabular-nums;
    }
    .mr-batch-preview tr.row-ok td { color: var(--ink); }
    .mr-batch-preview tr.row-err td { color: #ef4444; background: rgba(239,68,68,0.04); }
    .mr-batch-preview .pv-status-ok { color: var(--green); font-weight: 700; }
    .mr-batch-preview .pv-status-err { color: var(--red); font-weight: 700; }

    /* 鎵嬫満绔墜鍔ㄥ綍鍏ヨ〃鏍间紭鍖?*/
    @media (max-width: 519px) {
      .mr-form { gap: 10px; padding: 4px 14px 12px; }
      .mr-form label { font-size: 11px; }
      .mr-form input, .mr-form select {
        padding: 8px 10px; font-size: 13px; min-height: 38px;
      }
      .mr-submit { min-height: 38px; padding: 8px 18px; font-size: 13px; }

      /* 鏋侀€熻繛缁綍鍏?鈥?鎵嬫満绔崟鍒楀爢鍙?*/
      .mr-rapid-form { grid-template-columns: 1fr; gap: 8px; }
      .mr-rapid-field input { font-size: 14px; min-height: 38px; }
      .mr-rapid-btn button { width: 100%; min-height: 38px; }
      .mr-sub-tabs button { font-size: 11px; padding: 5px 8px; }

      /* 褰曞叆鍗＄墖鍐呮墍鏈夊瓙鍏冪礌宸﹀彸鐣欑櫧 */
      .card:has(#mr-form) > .mr-form,
      .card:has(#mr-form) > .mr-actions,
      .card:has(#mr-form) > .mr-cards,
      .card:has(#mr-form) > .mr-status,
      .card:has(#mr-form) > .note {
        padding-left: 14px;
        padding-right: 14px;
      }
      .mr-form { padding-top: 4px; padding-bottom: 12px; }
      .mr-actions { padding-top: 0; padding-bottom: 4px; }
      .mr-cards { padding-top: 0; padding-bottom: 4px; }
      .mr-mode-tabs {
        margin: 0 14px 10px;
        flex-wrap: wrap;
        gap: 6px;
      }
      .mr-mode-tabs button {
        flex: 1 1 auto;
        min-width: 0;
        padding: 7px 8px;
        font-size: 11px;
      }
      .mr-tz-shared {
        flex: 1 0 100%;
        margin-left: 0;
        display: grid;
        grid-template-columns: 1fr;
        align-items: stretch;
        gap: 6px;
        font-size: 11px;
      }
      .mr-tz-toggle {
        display: grid;
        grid-template-columns: 1fr 1fr;
        width: 100%;
      }
      .mr-tz-toggle button {
        min-width: 0;
        width: 100%;
        padding: 7px 6px;
        font-size: 11px;
      }

      /* 鎵嬫満绔殣钘忔í鍚戞粴鍔ㄨ〃鏍硷紝鏀圭敤鍗＄墖鍒楄〃 */
      .mr-table-wrap { display: none; }
      .mr-cards { display: block; }

      /* 鍗＄墖鍒楄〃鏍峰紡 鈥?绮剧編鐗?*/
      .mr-card {
        background: var(--panel);
        border: 1px solid var(--line);
        border-radius: 10px;
        padding: 8px 12px;
        margin-bottom: 8px;
        font-size: 12px;
        box-shadow: 0 1px 2px rgba(0,0,0,0.04);
      }
      /* 澶撮儴锛氬渾褰㈠簭鍙?+ 閿€鍞悕 + 鏃堕棿 */
      .mr-card-head {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 6px;
      }
      .mr-num-badge {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 20px; height: 20px;
        border-radius: 50%;
        background: #3b82f6;
        color: #fff;
        font-size: 10px;
        font-weight: 700;
        flex-shrink: 0;
      }
      .mr-card-sales {
        font-weight: 700;
        font-size: 14px;
        flex: 1;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        color: var(--ink);
      }
      .mr-card-time {
        font-size: 11px;
        color: var(--muted);
        font-weight: 600;
        flex-shrink: 0;
        font-variant-numeric: tabular-nums;
      }

      /* 涓绘暟鎹锛氬甫娴呰壊鑳屾櫙鐨勫唴鍗?*/
      .mr-main-box {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 8px 10px;
        background: rgba(59,130,246,0.06);
        border-radius: 8px;
        margin-bottom: 6px;
      }
      .mr-main-item {
        display: flex;
        flex-direction: column;
        gap: 1px;
        flex: 1;
        min-width: 0;
      }
      .mr-main-label { font-size: 9px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; }
      .mr-main-val { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ink); line-height: 1.2; }
      .mr-main-val.mr-std { color: #3b82f6; }
      .mr-arrow { color: #3b82f6; font-size: 18px; font-weight: 700; flex-shrink: 0; opacity: 0.6; }
      .mr-inv { font-size: 8px; color: var(--muted); background: rgba(127,127,127,0.12); padding: 0 3px; border-radius: 3px; margin-left: 2px; }

      /* 鍙傝€冩眹鐜囷細鏍囩 badge + 鍊?*/
      .mr-refs {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 4px 12px;
        margin-bottom: 6px;
      }
      .mr-ref {
        display: flex;
        align-items: center;
        gap: 6px;
        min-width: 0;
      }
      .mr-tag {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 28px;
        padding: 2px 6px;
        border-radius: 4px;
        background: rgba(127,127,127,0.1);
        color: var(--muted);
        font-size: 9px;
        font-weight: 700;
        letter-spacing: 0.3px;
        flex-shrink: 0;
      }
      .mr-ref-val {
        font-size: 13px;
        font-weight: 600;
        font-variant-numeric: tabular-nums;
        color: var(--ink);
        word-break: break-all;
      }

      /* 宸€硷細pill badge 鏍峰紡 */
      .mr-diffs {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px;
        margin-bottom: 6px;
      }
      .mr-diff {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 4px;
        padding: 4px 8px;
        border-radius: 6px;
        font-variant-numeric: tabular-nums;
      }
      .mr-diff.pos {
        background: rgba(34,197,94,0.1);
        border: 1px solid rgba(34,197,94,0.2);
      }
      .mr-diff.neg {
        background: rgba(239,68,68,0.1);
        border: 1px solid rgba(239,68,68,0.2);
      }
      .mr-diff.muted {
        background: rgba(127,127,127,0.06);
        border: 1px solid var(--line);
      }
      .mr-diff-k { font-size: 10px; color: var(--muted); font-weight: 600; }
      .mr-diff-v { font-size: 13px; font-weight: 800; }
      .mr-diff.pos .mr-diff-v { color: var(--green); }
      .mr-diff.neg .mr-diff-v { color: var(--red); }
      .mr-diff.muted .mr-diff-v { color: var(--muted); }

      /* 搴曢儴锛氬厓淇℃伅 + 鍒犻櫎鎸夐挳 */
      .mr-foot {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        padding-top: 4px;
        border-top: 1px solid var(--row-border);
      }
      .mr-meta {
        font-size: 10px;
        color: var(--muted);
        font-weight: 500;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }
      .mr-foot .mr-delete-btn {
        min-width: 40px; min-height: 26px;
        padding: 3px 12px; font-size: 11px;
        border-radius: 6px;
        flex-shrink: 0;
      }

      /* 琛ㄥご瀛椾綋鏇村皬 */
      .mr-table th { padding: 6px 5px; font-size: 10px; }
      .mr-table td { padding: 4px 5px; font-size: 10px; }
      /* 鍒犻櫎鎸夐挳鏇存槗鐐瑰嚮 */
      .mr-delete-btn { 
        min-width: 32px; min-height: 24px; 
        padding: 2px 6px; font-size: 11px;
      }
      /* 鎿嶄綔鏍忕揣鍑?*/
      .mr-actions { gap: 8px; margin-bottom: 8px; }
      .mr-download { 
        padding: 5px 12px; font-size: 12px; min-height: 34px;
      }
      /* Note 瀛椾綋 */
      .note { font-size: 11px; padding: 8px 10px 10px; }
    }
    /* 妗岄潰绔殣钘忓崱鐗囧垪琛?*/
    @media (min-width: 520px) {
      .mr-cards { display: none; }
    }

    /* 鍝嶅簲寮忥細灏婇噸鐢ㄦ埛鍑忓皯鍔ㄧ敾鍋忓ソ */
    @media (prefers-reduced-motion: reduce) {
      *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
      }
    }

    /* ===== 绉诲姩绔揣鍑戞ā寮忥紙<520px锛?===== */

    /* 蹇€熸眹鐜囨í婊氭潯 */
    .quick-rates { display: none; }
    @media (max-width: 519px) {
      .quick-rates {
        display: block;
        background: var(--panel);
        border: 1px solid var(--line);
        border-radius: 8px;
        margin-bottom: 10px;
        overflow: hidden;
      }
      .quick-rates-scroll {
        display: flex;
        gap: 0;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        padding: 10px 4px;
        scrollbar-width: none;
      }
      .quick-rates-scroll::-webkit-scrollbar { display: none; }
      .quick-item {
        flex-shrink: 0;
        scroll-snap-align: start;
        text-align: center;
        padding: 6px 14px;
        min-width: 82px;
        border-right: 1px solid var(--line);
      }
      .quick-item:last-child { border-right: none; }
      .quick-pair { font-size: 10px; color: var(--muted); font-weight: 600; margin-bottom: 2px; }
      .quick-value { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
      .quick-delta { font-size: 10px; font-weight: 600; margin-top: 2px; }
      .quick-delta.up { color: var(--green); }
      .quick-delta.down { color: var(--red); }

      /* 鍗＄墖鎶樺彔锛氬ご閮ㄥ彲鐐瑰嚮 */
      .card-head {
        cursor: pointer;
        position: relative;
        user-select: none;
        -webkit-tap-highlight-color: transparent;
      }
      .card-head::after {
        content: '';
        position: absolute;
        right: 12px;
        top: 50%;
        width: 7px;
        height: 7px;
        border-right: 2px solid var(--muted);
        border-bottom: 2px solid var(--muted);
        transform: translateY(-50%) rotate(45deg);
        transition: transform 0.2s;
      }
      .card.expanded .card-head::after {
        transform: translateY(-70%) rotate(-135deg);
      }

      /* 榛樿闅愯棌鍗＄墖鍐呭锛屽睍寮€鏄剧ず */
      .card > .rows,
      .card > .chart-wrap,
      .card > .note,
      .card > .mr-form,
      .card > .mr-status,
      .card > .mr-actions,
      .card > .mr-table-wrap { display: none; }
      .card.expanded > .rows { display: grid; }
      .card.expanded > .chart-wrap,
      .card.expanded > .note,
      .card.expanded > .mr-status { display: block; }
      .card.expanded > .mr-form { display: grid; }
      .card.expanded > .mr-actions { display: flex; }
      .card.expanded > .mr-actions { flex-direction: row; }
      .card.expanded > .mr-table-wrap { display: block; }
      .card.expanded > .note + .note { display: block; }

      /* 鎶樺彔鏃舵樉绀烘憳瑕佽 */
      .card-summary {
        display: flex;
        padding: 8px 12px;
        gap: 16px;
        border-bottom: 1px solid var(--row-border);
        font-size: 13px;
        font-variant-numeric: tabular-nums;
      }
      .card.expanded .card-summary { display: none; }
      .cs-item { text-align: center; }
      .cs-pair { font-size: 10px; color: var(--muted); font-weight: 600; }
      .cs-val { font-weight: 800; font-size: 15px; }
      .cs-delta { font-size: 10px; font-weight: 600; margin-top: 1px; }
      .cs-delta.up { color: var(--green); }
      .cs-delta.down { color: var(--red); }

      /* Delta 宸€兼姌鍙犱负鍗曡鎽樿 */
      .delta .delta-full { display: none; }
      .card.expanded .delta .delta-full { display: inline; }
      .delta .delta-brief { display: inline; color: var(--muted); font-size: 11px; }
      .card.expanded .delta .delta-brief { display: none; }

      /* 鐐瑰嚮鎻愮ず */
      .tap-hint { display: block; text-align: center; font-size: 11px; color: var(--muted); padding: 4px 0; opacity: 0.5; letter-spacing: 0.3px; }
      .expanded .tap-hint { display: none; }

      /* Note 榛樿闅愯棌 */
      .card > .note { display: none; }
      .card.expanded > .note { display: block; }

      /* 绱у噾澶撮儴 */
      .card-head { padding: 10px 32px 8px 10px; }
      h2 { font-size: 14px; }
      .badge { font-size: 10px; padding: 3px 6px; line-height: 1.25; }
      .rev-btn { min-height: 24px; padding: 0 6px; font-size: 10px; }

      /* 鍥捐〃鍗＄墖涔熸敮鎸佹姌鍙?*/
      .card.wide .chart-wrap,
      .card.wide .legend,
      .card.wide .change-list,
      .card.wide .chart-tools,
      .card.wide .range-tabs,
      .card.wide .rate-line,
      .card.wide .chart-selectors { display: none; }
      .card.wide.expanded .chart-wrap,
      .card.wide.expanded .legend,
      .card.wide.expanded .change-list { display: block; }
      .card.wide.expanded .chart-tools { display: flex; }
      .card.wide.expanded .range-tabs { display: grid; }
      .card.wide.expanded .chart-selectors { display: grid; }
      .card.wide.expanded .rate-line { display: flex; }

      /* 娆¤鍗＄墖鎺掓渶鍚?*/
      .card.wide:has(#source-rows),
      .card.wide:has(.ref-links) { order: 99; }
    }

    /* ===== Mobile Pro Layout: readable phone UI, not a squeezed desktop ===== */
    @media (max-width: 700px) {
      body {
        font-size: 16px;
        line-height: 1.45;
      }
      main {
        width: 100%;
        padding: 10px 10px 28px;
      }
      header {
        gap: 12px;
        padding: 12px 2px 14px;
      }
      h1 {
        font-size: 24px;
        line-height: 1.15;
      }
      .sub {
        font-size: 15px;
        line-height: 1.45;
      }
      .internal-warn {
        font-size: 13px;
        line-height: 1.35;
        padding: 4px 8px;
      }
      .top-actions {
        display: flex;
        width: 100%;
        justify-content: space-between;
        gap: 10px;
      }
      .language-select,
      .desktop-mode-toggle,
      #refresh {
        min-height: 46px;
        font-size: 16px;
      }
      #refresh {
        flex: 1;
      }
      .language-select {
        flex: 0 0 138px;
      }
      .desktop-mode-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 1;
        background: #eef2ff;
        color: #1d4ed8;
        border: 1px solid #c7d2fe;
      }
      .desktop-mode-toggle.active {
        background: var(--ink);
        color: var(--panel);
        border-color: var(--ink);
      }
      .status {
        font-size: 14px;
        padding: 0 2px;
      }
      .grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 14px;
      }
      .card {
        border-radius: 10px;
        box-shadow: 0 6px 18px rgba(15, 23, 42, .08);
      }
      .card-head {
        padding: 14px 42px 12px 14px;
        gap: 8px;
      }
      h2 {
        font-size: 18px;
        line-height: 1.25;
      }
      .badge {
        font-size: 12px;
        line-height: 1.35;
      }
      .countdown {
        font-size: 13px;
      }
      .tap-hint {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        flex-wrap: wrap;
        font-size: 14px;
        padding: 10px 12px;
      }
      .collapse-open-btn {
        min-height: 40px;
        margin-left: 0;
        padding: 0 16px;
        font-size: 15px;
      }
      .card-summary {
        gap: 10px;
        padding: 10px 12px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
      }
      .cs-item {
        min-width: 108px;
      }
      .cs-pair {
        font-size: 12px;
      }
      .cs-val {
        font-size: 19px;
      }
      .cs-delta {
        font-size: 12px;
      }
      .row {
        padding: 14px;
        gap: 10px;
      }
      .row > div:first-child {
        gap: 10px;
      }
      .row .pair {
        font-size: 15px;
      }
      .row .label {
        font-size: 15px;
      }
      .rev-btn,
      .mini-btn {
        min-height: 36px;
        font-size: 13px;
        padding: 0 11px;
      }
      .platform-rate {
        padding: 9px 10px;
      }
      .platform-rate .platform-name {
        font-size: 15px;
      }
      .platform-rate .platform-name small {
        font-size: 12px;
      }
      .platform-rate .platform-value,
      .platform-value,
      .value {
        font-size: 18px;
      }
      .delta {
        font-size: 14px;
        line-height: 1.55;
      }
      .note {
        font-size: 14px;
        line-height: 1.55;
        padding: 10px 14px 14px;
      }
      .quick-rates {
        border-radius: 10px;
      }
      .quick-item {
        min-width: 118px;
        padding: 10px 14px;
      }
      .quick-pair {
        font-size: 12px;
      }
      .quick-value {
        font-size: 22px;
      }
      .quick-delta {
        font-size: 12px;
      }

      /* Charts: keep readable width and allow horizontal drag instead of shrinking text. */
      .chart-wrap {
        padding: 12px;
        overflow-x: auto;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
      }
      .chart-wrap::after {
        content: '横向拖动查看完整曲线';
        display: block;
        color: var(--muted);
        font-size: 12px;
        padding-top: 6px;
      }
      .chart,
      #chart-manual-rate {
        width: 780px !important;
        max-width: none !important;
        min-width: 780px !important;
        height: 240px;
      }
      #chart-manual-rate {
        min-height: 260px !important;
      }
      .chart-selectors {
        width: 100%;
        min-width: 0;
        grid-template-columns: 1fr;
        gap: 8px;
        margin-bottom: 12px;
      }
      .currency-select {
        min-height: 46px;
        font-size: 16px;
      }
      .swap-mark {
        text-align: center;
        font-size: 18px;
      }
      .rate-line {
        min-width: 780px;
        font-size: 15px;
      }
      .rate-line strong {
        font-size: 22px;
      }
      .range-tabs {
        grid-template-columns: repeat(3, minmax(112px, 1fr));
        min-width: 360px;
        overflow-x: auto;
      }
      .range-btn {
        min-height: 42px;
        font-size: 15px;
      }
      .legend,
      .change-list,
      .chart-tools {
        min-width: 780px;
        font-size: 14px;
        line-height: 1.5;
      }

      /* Manual-rate area: card-first on phones. */
      .mr-form {
        grid-template-columns: 1fr !important;
        gap: 12px;
        padding: 12px 14px 14px;
      }
      .mr-form label,
      .mr-rapid-field label,
      .mr-batch-field label {
        font-size: 14px;
      }
      .mr-form input,
      .mr-form select,
      .mr-rapid-field input,
      .mr-batch-field textarea,
      .mr-batch-field input,
      .mr-batch-field select {
        min-height: 46px;
        font-size: 16px;
      }
      .mr-submit,
      .mr-rapid-btn button,
      .mr-batch-actions button,
      .mr-download {
        min-height: 44px;
        font-size: 15px;
      }
      .mr-mode-tabs {
        margin: 0 14px 12px;
        gap: 8px;
      }
      .mr-mode-tabs button {
        min-height: 40px;
        font-size: 14px;
      }
      .mr-tz-shared {
        font-size: 14px;
      }
      .mr-tz-toggle button {
        min-height: 38px;
        font-size: 14px;
      }
      .mr-clock {
        width: 100%;
        justify-content: space-around;
        padding: 8px 10px;
      }
      .mr-clock-label {
        font-size: 12px;
      }
      .mr-clock-time {
        font-size: 17px;
      }
      .mr-table-wrap {
        display: none !important;
      }
      .mr-cards {
        display: block !important;
        padding-left: 14px;
        padding-right: 14px;
      }
      .mr-card {
        padding: 12px 14px;
        border-radius: 10px;
        font-size: 14px;
      }
      .mr-card-sales {
        font-size: 16px;
      }
      .mr-card-time {
        font-size: 13px;
      }
      .mr-main-label,
      .mr-tag,
      .mr-diff-k {
        font-size: 12px;
      }
      .mr-main-val {
        font-size: 20px;
      }
      .mr-ref-val,
      .mr-diff-v {
        font-size: 16px;
      }
      .mr-status {
        font-size: 14px;
        line-height: 1.5;
      }
      .mr-batch-preview-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
      }
      .mr-batch-preview {
        min-width: 720px;
        font-size: 13px;
      }
    }

    @media (max-width: 700px) {
      html:is(.zoom-out-desktop, .force-desktop-mode),
      html:is(.zoom-out-desktop, .force-desktop-mode) body {
        overflow-x: auto;
      }
      html:is(.zoom-out-desktop, .force-desktop-mode) body {
        font-size: 13px;
      }
      html:is(.zoom-out-desktop, .force-desktop-mode) main {
        width: 1180px;
        max-width: none;
        padding: 18px 16px 36px;
      }
      html:is(.zoom-out-desktop, .force-desktop-mode) header {
        flex-direction: row;
        align-items: flex-start;
        justify-content: space-between;
      }
      html:is(.zoom-out-desktop, .force-desktop-mode) h1 {
        font-size: 30px;
      }
      html:is(.zoom-out-desktop, .force-desktop-mode) .sub {
        font-size: 13px;
      }
      html:is(.zoom-out-desktop, .force-desktop-mode) .top-actions {
        display: grid;
        width: auto;
        justify-content: end;
      }
      html:is(.zoom-out-desktop, .force-desktop-mode) .language-select,
      html:is(.zoom-out-desktop, .force-desktop-mode) .desktop-mode-toggle,
      html:is(.zoom-out-desktop, .force-desktop-mode) #refresh {
        min-height: 40px;
        font-size: 14px;
      }
      html:is(.zoom-out-desktop, .force-desktop-mode) .desktop-mode-toggle {
        display: inline-flex;
      }
      html:is(.zoom-out-desktop, .force-desktop-mode) .quick-rates {
        display: none;
      }
      html:is(.zoom-out-desktop, .force-desktop-mode) .grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 20px;
      }
      html:is(.zoom-out-desktop, .force-desktop-mode) .wide {
        grid-column: 1 / -1;
      }
      html:is(.zoom-out-desktop, .force-desktop-mode) .card {
        border-radius: 8px;
      }
      html:is(.zoom-out-desktop, .force-desktop-mode) .card-head {
        cursor: default;
        flex-direction: row;
        align-items: center;
        padding: 14px 14px 10px;
      }
      html:is(.zoom-out-desktop, .force-desktop-mode) .card-head::after {
        display: none;
      }
      html:is(.zoom-out-desktop, .force-desktop-mode) .tap-hint,
      html:is(.zoom-out-desktop, .force-desktop-mode) .card-summary {
        display: none !important;
      }
      html:is(.zoom-out-desktop, .force-desktop-mode) .card > .rows,
      html:is(.zoom-out-desktop, .force-desktop-mode) .card > .chart-wrap,
      html:is(.zoom-out-desktop, .force-desktop-mode) .card > .note,
      html:is(.zoom-out-desktop, .force-desktop-mode) .card > .mr-form,
      html:is(.zoom-out-desktop, .force-desktop-mode) .card > .mr-status,
      html:is(.zoom-out-desktop, .force-desktop-mode) .card > .mr-actions {
        display: revert;
      }
      html:is(.zoom-out-desktop, .force-desktop-mode) .card > .rows {
        display: grid;
      }
      html:is(.zoom-out-desktop, .force-desktop-mode) .card > .chart-wrap {
        display: block;
      }
      html:is(.zoom-out-desktop, .force-desktop-mode) .card > .mr-form {
        display: grid;
      }
      html:is(.zoom-out-desktop, .force-desktop-mode) .row {
        grid-template-columns: 1fr auto;
        padding: 10px 14px;
      }
      html:is(.zoom-out-desktop, .force-desktop-mode) .row > div:first-child {
        display: block;
      }
      html:is(.zoom-out-desktop, .force-desktop-mode) h2 {
        font-size: 16px;
      }
      html:is(.zoom-out-desktop, .force-desktop-mode) .chart-wrap {
        overflow-x: visible;
        padding: 16px;
      }
      html:is(.zoom-out-desktop, .force-desktop-mode) .chart-wrap::after {
        display: none;
      }
      html:is(.zoom-out-desktop, .force-desktop-mode) .chart,
      html:is(.zoom-out-desktop, .force-desktop-mode) #chart-manual-rate {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        height: 170px;
      }
      html:is(.zoom-out-desktop, .force-desktop-mode) #chart-manual-rate {
        min-height: 240px !important;
      }
      html:is(.zoom-out-desktop, .force-desktop-mode) .chart-selectors {
        grid-template-columns: 1fr auto 1fr;
      }
      html:is(.zoom-out-desktop, .force-desktop-mode) .rate-line,
      html:is(.zoom-out-desktop, .force-desktop-mode) .legend,
      html:is(.zoom-out-desktop, .force-desktop-mode) .change-list,
      html:is(.zoom-out-desktop, .force-desktop-mode) .chart-tools {
        min-width: 0;
        font-size: 12px;
      }
      html:is(.zoom-out-desktop, .force-desktop-mode) .range-tabs {
        min-width: 0;
      }
      html:is(.zoom-out-desktop, .force-desktop-mode) .mr-table-wrap {
        display: block !important;
      }
      html:is(.zoom-out-desktop, .force-desktop-mode) .mr-cards {
        display: none !important;
      }
    }

/* Mobile responsive mode is disabled; phones use the desktop layout. */
.desktop-mode-toggle {
  display: none !important;
}

