/* Local type suite: Google Sans Flex Latin (weight-only) + Noto Sans SC UI subset. See md/frontend/FONTS.md in the repository.
 * Font-display swap keeps content usable during the first font download.
 * Unbundled characters fall back to the system CJK font; no remote font requests. */
@font-face {
    font-family: "GTX Google Sans Flex";
    src: url("../../fonts/google-sans-flex-latin-wght-normal.woff2") format("woff2");
    font-style: normal;
    font-weight: 1 1000;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "GTX Noto Sans SC";
    src: url("../../fonts/noto-sans-sc-ui.woff2") format("woff2");
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    unicode-range: U+3000-303F, U+3400-9FFF, U+FF00-FFEF;
}

@font-face {
    font-family: "GTX Brand Inter";
    src: url("../../fonts/inter-latin-variable.woff2") format("woff2");
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
}

/* 全站外观参数；默认值沿用现有样式，同类颜色、字体与圆角在此统一调整。
 * 带有 -rgb 的颜色在 RGB 通道处修改，本色及透明背景/阴影会一起更新。
 * 保留现有场景色（例如发送按钮的 sky 色），页面不再自行写颜色常量。 */
/* Public website palette. Scope these roles so app controls stay unchanged. */
body.marketing-page {
    --public-ink: #10254b;
    --public-copy: #536782;
    --public-muted: #788aa1;
    --public-accent: #426ff2;
    --public-accent-hover: #335edb;
    --public-accent-soft: #e7edff;
    --public-step-ink: #8ba5dc;
    --public-button-border: #d4ddec;
    --public-button-surface: rgba(255, 255, 255, .5);
    --public-header-height: var(--nav-height);
    --layout-public-width: 984px;
}

:root {
    --bg-page-rgb: 244, 247, 252;
    --bg-page: rgb(var(--bg-page-rgb));
    --bg-card: rgb(var(--bg-card-rgb));
    --bg-input: #f5f6f8;
    --bg-hover: #eef1f6;
    --border: rgb(var(--border-rgb));
    --border-strong: #d8dde7;
    --text-primary: #1c2024;
    --text-secondary: #60646c;
    --text-muted: #98a2b3;
    --accent-blue: rgb(var(--accent-blue-rgb));
    --accent-green: rgb(var(--accent-green-rgb));
    --accent-red: rgb(var(--accent-red-rgb));
    --accent-amber: rgb(var(--accent-amber-rgb));
    --accent-purple: #765be9;
    --font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    --font-sans: var(--site-font);
    --wordmark-font: "GTX Brand Inter", var(--site-font);
    --wordmark-color: #071d49;
    --wordmark-weight: 850;
    --wordmark-spacing: -.065em;
    --playground-dot-ink: #17385e;
    --playground-dot-highlight: #6588af;
    --playground-hint-ink: #637e9e;
    --layout-login-width: 1024px;
    --login-field-height: 76px;
    --login-button-height: 56px;
    --login-transition-duration: 680ms;
    --radius-lg: var(--surface-radius);
    --radius-md: var(--control-radius);
    --radius-sm: var(--badge-radius);
    --shadow-card: none;
    --shadow-press: none;
    --agent-pulse: rgb(var(--agent-pulse-rgb));
    --agent-pulse-soft: rgba(var(--agent-pulse-rgb), 0.40);
    --agent-fail: rgb(var(--agent-fail-rgb));
    --agent-grad-a: var(--accent-blue);
    --agent-grad-b: var(--accent-purple);
    --agent-hairline: rgba(var(--text-primary-rgb), 0.075);
    --agent-capsule-bg: var(--bg-card);
    --agent-bar-bg: var(--bg-page);
    --focus-ring: 0 0 0 3px rgba(var(--accent-blue-rgb), 0.12);
    --site-page: rgb(var(--site-page-rgb));
    --site-surface: rgba(var(--bg-card-rgb), 0.82);
    --site-brand-deep: #4054e8;
    --site-brand-soft: #eef0ff;
    --site-radius-xl: var(--surface-radius);
    --site-radius-lg: var(--surface-radius);
    --site-radius-md: var(--surface-inset-radius);
    --site-shadow: none;
    --site-font: "GTX Google Sans Flex", "GTX Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
    --font-size-8: 8px;
    --font-size-9: 9px;
    --font-size-10: 10px;
    --font-size-10-5: 10.5px;
    --font-size-11: 11px;
    --font-size-12: 12px;
    --font-size-13: 13px;
    --font-size-13-5: 13.5px;
    --font-size-14: 14px;
    --font-size-15: 15px;
    --font-size-16: 16px;
    --font-size-17: 17px;
    --font-size-18: 18px;
    --font-size-20: 20px;
    --font-size-21: 21px;
    --font-size-22: 22px;
    --font-size-23: 23px;
    --font-size-24: 24px;
    --font-size-25: 25px;
    --font-size-26: 26px;
    --font-size-28: 28px;
    --font-size-30: 30px;
    --font-size-32: 32px;
    --font-size-42: 42px;
    --font-size-46: 46px;
    --font-weight-300: 300;
    --font-weight-400: 400;
    --font-weight-500: 500;
    --font-weight-550: 550;
    --font-weight-600: 600;
    --font-weight-620: 620;
    --font-weight-650: 650;
    --font-weight-700: 700;
    --font-weight-720: 720;
    --font-weight-760: 760;
    --font-weight-800: 800;
    --font-weight-820: 820;
    --font-weight-850: 850;
    --font-weight-900: 900;
    --radius-3: 3px;
    --radius-4: 4px;
    --radius-5: 5px;
    --radius-6: 6px;
    --radius-7: 7px;
    --radius-8: 8px;
    --radius-9: 9px;
    --radius-10: 10px;
    --radius-11: 11px;
    --radius-12: 12px;
    --radius-13: 13px;
    --radius-14: 14px;
    --radius-15: 15px;
    --radius-16: 16px;
    --radius-18: 18px;
    --radius-20: 20px;
    --radius-23: 23px;
    --radius-24: 24px;
    --radius-25: 25px;
    --radius-pill: 999px;
    --radius-28: 28px;
    /* Shared page headers: all pages use the same title and navigation scale. */
    --nav-title-font-family: var(--site-font);
    --nav-title-font-size: var(--font-size-16);
    --nav-title-font-weight: var(--font-weight-650);
    --nav-title-letter-spacing: 0;
    --nav-title-line-height: 1.5;
    --nav-title-optical-offset: 1px;
    --nav-title-gap: 12px;
    --nav-height: 52px;
    --nav-block-padding: 4px;
    --nav-content-gap: 7px;
    --nav-padding: var(--nav-block-padding) var(--page-gutter);
    --nav-back-size: 44px;
    --nav-back-icon-size: 20px;
    --nav-back-radius: var(--control-radius);
    /* Module labels are quieter than item titles; compact data labels keep their own scale. */
    --section-title-font-family: var(--site-font);
    --section-title-font-size: var(--font-size-14);
    --section-title-font-weight: var(--font-weight-500);
    --section-title-letter-spacing: 0;
    --section-title-line-height: 20px;
    --detail-title-font-size: var(--font-size-11);
    --detail-title-letter-spacing: .6px;
    --list-title-font-size: var(--font-size-16);
    --list-title-font-weight: var(--font-weight-500);
    --list-title-line-height: 24px;
    --list-description-font-size: var(--font-size-14);
    --list-description-line-height: 20px;
    /* Semantic design tokens: component roles, not page-specific overrides. */
    /* Responsive reading widths shared by every entry document. */
    --layout-app-width: 480px;
    --layout-market-width: 920px;
    --layout-public-width: 1200px;
    --layout-dialog-width: 440px;
    --layout-confirm-width: 320px;
    --layout-media-width: 1000px;
    --layout-viewport-gutter: 16px;
    --layout-bottom-gap: 7px;
    --surface-radius: 20px;
    --surface-inset-radius: 16px;
    --dialog-radius: 24px;
    --sheet-max-width: var(--layout-app-width);
    --sheet-gutter: 16px;
    --sheet-top-clearance: 16px;
    --sheet-bottom-padding: 24px;
    --sheet-grip-height: 22px;
    --sheet-close-size: 44px;
    --sheet-close-icon-size: 18px;
    --sheet-enter-duration: 220ms;
    --sheet-enter-easing: cubic-bezier(.2, .8, .2, 1);
    --control-radius: 12px;
    --control-compact-radius: 8px;
    --badge-radius: 6px;
    --page-gutter: 16px;
    --surface-padding: 16px;
    --surface-padding-compact: 16px;
    --section-gap: 24px;
    --group-gap: 16px;
    --section-title-inset: 8px;
    --section-title-gap: 12px;
    --list-row-gap: 3px;
    --list-row-radius: 4px;
    --list-row-min-height: 76px;
    --summary-row-height: 64px;
    --summary-icon-size: 32px;
    /* Foreground-only palette, based on Radix Slate / Iris / Jade / Ruby / Amber.
     * Jade and Amber are deeper for small text on the existing tinted surfaces.
     * RGB channels, fills, gradients, and chart-series colors stay independent. */
    --text-brand: #5753c6;
    --text-positive: #00824b;
    --text-negative: #d92323;
    --text-warning: #995a00;
    /* Functional icons: monochrome outlines in the existing layout slots.
     * Semantic status backgrounds stay precomputed for older WebViews. */
    --icon-badge-size: 40px;
    --icon-glyph-size: 22px;
    --icon-entry-ink: var(--text-primary);
    --icon-entry-stroke: 1.8;
    --icon-status-glyph-size: 20px;
    --icon-status-stroke: 1.65;
    --icon-tone-cyan-bg: #adefff;
    --icon-tone-cyan-ink: #00566b;
    --icon-status-cyan-bg: #e0f9ff;
    --icon-tone-purple-bg: #e6d7ff;
    --icon-tone-purple-ink: #6044a7;
    --icon-status-purple-bg: #f6f0ff;
    --icon-tone-blue-bg: #d1e2ff;
    --icon-tone-blue-ink: #154c9a;
    --icon-status-blue-bg: #eef4ff;
    --icon-tone-orange-bg: #ffdfc6;
    --icon-tone-orange-ink: #813b00;
    --icon-status-orange-bg: #fff3e9;
    --icon-tone-green-bg: #bdefbd;
    --icon-tone-green-ink: #005b3a;
    --icon-status-green-bg: #e6f9e6;
    --icon-tone-rose-bg: #ffdbef;
    --icon-tone-rose-ink: #930052;
    --icon-status-rose-bg: #fff1f9;
    --icon-tone-yellow-bg: #ffe37b;
    --icon-tone-yellow-ink: #714500;
    --icon-status-yellow-bg: #fff4cd;
    --icon-tone-neutral-bg: #e7e3e7;
    --icon-tone-neutral-ink: #454746;
    --icon-status-neutral-bg: #f6f4f6;
    --body-font-size: var(--font-size-13);
    --body-large-size: var(--font-size-14);
    --meta-font-size: var(--font-size-11);
    --body-line-height: 1.6;
    --heading-line-height: 1.4;
    --border-width: 1px;
    --chart-card-head-height: 84px;
    --chart-card-plot-height: 185px;
    --market-overview-height: 192px;
    --market-trend-height: 160px;
    --space-xl: 20px;
    --space-2xl: 24px;
    --space-3xl: 32px;
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 12px;
    --space-lg: 16px;
    --control-height: 44px;
    --control-height-compact: 40px;
    --control-height-lg: 48px;
    --control-height-sm: 32px;
    --control-height-xs: 28px;
    --control-icon-size: 36px;
    --control-font-size: var(--font-size-13);
    --control-font-weight: var(--font-weight-600);
    --field-font-size: var(--font-size-16);
    --field-label-size: var(--font-size-12);
    --caption-font-size: var(--font-size-12);
    --badge-font-size: var(--font-size-11);
    --badge-height: 20px;
    --surface-inset: #f6f7ff;
    --surface-field: #f9faff;
    /* Headers and dialogs share blur, with independent tints and opacity. */
    --glass-opacity: .6;
    --glass-title-surface: rgba(var(--bg-page-rgb), var(--glass-opacity));
    --glass-title-fallback: var(--bg-page);
    --glass-filter: blur(10px);
    --dialog-backdrop-filter: var(--glass-filter);
    --dialog-surface: var(--bg-page);
    --dialog-scrim-rgb: 0, 0, 0;
    --dialog-scrim-opacity: .4;
    --dialog-scrim: rgba(var(--dialog-scrim-rgb), var(--dialog-scrim-opacity));
    --border-field: #e7ebf4;
    --divider-color: #edf0f5;
    --tone-brand-bg: #eef0ff;
    --tone-success-bg: #edf9f2;
    --tone-danger-bg: #fff0f2;
    --tone-warning-bg: #fff7e9;
    --tone-neutral-bg: #f2f4f8;
    --control-positive-solid: #12845c;
    --control-negative-solid: #c8424f;
    --control-gradient: linear-gradient(110deg, var(--accent-blue), var(--accent-purple));
    --control-shadow: 0 5px 14px rgba(var(--accent-blue-rgb), .11);
    --motion-control: 150ms ease;
    --list-row-padding: 16px;
    --settings-row-padding: var(--list-row-padding);
    --font-icon: Arial, sans-serif;
    --site-hero-font-size: var(--font-size-46);
    --site-heading-font-size: var(--font-size-28);

    /* Existing palette variants shared by all pages, including AI Studio. */
    --color-neutral-rgb: 128, 128, 128;
    --accent-error-bright: #e5484d;
    --accent-success-bright: #30a46c;
    --text-chart-muted: #5b7691;
    --accent-sky-rgb: 59, 130, 246;
    --bg-subtle: #f7f8fa;
    --gradient-blue-soft: #788deb;
    --agent-pulse-rgb: 16, 185, 129;
    --accent-emerald: #059669;
    --accent-danger-rgb: 239, 68, 68;
    --accent-violet-rgb: 139, 92, 246;
    --accent-warning-rgb: 245, 158, 11;
    --text-warning-strong: #d97706;
    --accent-neutral-rgb: 107, 114, 128;
    --accent-cyan-rgb: 6, 182, 212;
    --accent-cyan-deep: #0891b2;
    --accent-indigo-rgb: 99, 102, 241;
    --accent-indigo: rgb(var(--accent-indigo-rgb));
    --accent-teal-rgb: 13, 148, 136;
    --accent-teal: rgb(var(--accent-teal-rgb));
    --color-black-rgb: 0, 0, 0;
    --agent-fail-rgb: 244, 63, 94;
    --text-on-accent: #ffffff;
    --shadow-brand-light-rgb: 80, 100, 246;
    --toast-bg-rgb: 28, 28, 30;
    --gradient-green-light: #80dd70;
    --shadow-blue-ink-rgb: 30, 64, 175;
    --text-warning-dark: #854f0b;
    --accent-lime-rgb: 34, 197, 94;
    --text-warning-deep: #b45309;
    --bg-card-rgb: 255, 255, 255;
    --accent-blue-rgb: 89, 104, 239;
    --gradient-violet-light: #667eea;
    --gradient-purple-deep: #764ba2;
    --accent-slate-rgb: 100, 116, 139;
    --accent-pink-rgb: 236, 72, 153;
    --accent-pink: rgb(var(--accent-pink-rgb));
    --accent-sky: rgb(var(--accent-sky-rgb));
    --accent-green-rgb: 24, 166, 106;
    --accent-amber-rgb: 217, 144, 34;
    --toast-bg: rgb(var(--toast-bg-rgb));
    --accent-danger: rgb(var(--accent-danger-rgb));
    --surface-dark: #1e2230;
    --text-dark-muted: #9aa3b2;
    --text-on-dark: #cbd2dd;
    --action-danger-pressed: #dc2626;
    --text-canceled: rgb(var(--text-canceled-rgb));
    --text-canceled-rgb: 136, 136, 136;
    --accent-executing: rgb(var(--accent-executing-rgb));
    --accent-executing-rgb: 224, 160, 0;
    --shadow-card-ink-rgb: 48, 61, 112;
    --font-size-19: 19px;
    --radius-21: 21px;
    --border-welcome: #e3e7ff;
    --welcome-mark-color: #6572e9;
    --font-size-27: 27px;
    --border-rgb: 232, 235, 241;
    --border-focus: #9da6f6;
    --bg-chat-bubble: #e9edff;
    --border-chat-bubble: #e0e5ff;
    --border-progress: #b8c0ff;
    --text-progress: #69738e;
    --text-tool-marker: #8a95be;
    --text-primary-rgb: 21, 24, 36;
    --overlay-ink-rgb: 24, 32, 51;
    --border-selected: #a9b2fb;
    --bg-selected: #f0f2ff;
    --status-idle: #b9c0ce;
    --bg-code: #e9edfa;
    --border-link: #a6aff4;
    --bg-code-panel: #edf0fc;
    --text-link-muted: #4655b1;
    --border-panel: #dfe4f0;
    --bg-table: #f8f9fd;
    --bg-loading: #edf0f8;
    --border-code-soft: #dfe5fc;
    --text-table-strong: #26334d;
    --text-table: #46516c;
    --bg-panel: rgb(var(--bg-panel-rgb));
    --spinner-track: #bcc4ff;
    --bg-image-view: #e9edf4;
    --radius-17: 17px;
    --text-control-muted: #78849b;
    --bg-segment: #e9edf5;
    --shadow-control-ink-rgb: 35, 53, 91;
    --provider-grok-label: #202637;
    --bg-danger-hover: #fff0f0;
    --provider-grok-bg: hsl(224, 18%, 96%);
    --provider-grok-ink: #252c3f;
    --provider-grok-bubble: #eaf0f3;
    --provider-grok-border: #dde5ea;
    --border-approval: #e8cf9e;
    --bg-approval: #fff9ed;
    --upload-remove-bg: #424b60;
    --bg-control-hover: #eef1f8;
    --pulse-blue-rgb: 91, 116, 255;
    --pulse-violet-rgb: 130, 88, 240;
    --shadow-panel-ink-rgb: 46, 55, 102;
    --bg-panel-rgb: 249, 250, 255;
    --accent-ready-bright-rgb: 32, 184, 107;
    --gradient-blue-mid: #5367ef;
    --gradient-blue-light: #467ff4;
    --gradient-indigo: #6264ef;
    --shadow-brand-strong-rgb: 81, 98, 235;
    --text-axis: #8b91a4;
    --border-muted: #c7cad4;
    --shadow-brand-muted-rgb: 75, 88, 195;
    --shadow-link-ink-rgb: 51, 63, 126;
    --shadow-button-ink-rgb: 55, 67, 126;
    --accent-link-strong: #4159e7;
    --gradient-purple-mid: #6a5ce9;
    --shadow-brand-deep-rgb: 70, 81, 202;
    --shadow-deep-ink-rgb: 12, 15, 30;
    --text-heading-deep: #161a2b;
    --bg-panel-muted: #e9edf6;
    --text-placeholder: #adb5c5;
    --border-code: #a6b0ec;
    --accent-red-rgb: 224, 82, 96;
    --bg-terminal: #f8fafd;
    --shadow-surface-ink-rgb: 38, 51, 91;
    --text-terminal: #8d96a6;
    --text-separator: #c4cad5;
    --bg-search-glass-rgb: 245, 245, 247;
    --text-placeholder-soft: #b2bacb;
    --bg-code-header: #f8f9ff;
    --bg-table-head: #e9ecf6;
    --bg-surface-tint: #fcfcff;
    --bg-budget: rgb(var(--bg-budget-rgb));
    --border-subtle: #f1f3f7;
    --status-offline: #bdc5d4;
    --bg-ready: #eff8f4;
    --text-ready: #27835b;
    --bg-warning: #fff7e9;
    --avatar-gradient-start: #6875ef;
    --avatar-gradient-end: #7157d9;
    --shadow-press-ink-rgb: 16, 24, 40;
    --action-long-bg: #168a5b;
    --action-short-bg: #d84c5a;
    --bg-budget-rgb: 247, 248, 252;
    --site-page-rgb: 245, 247, 251;
    --viewport-height: 100vh;
    --control-disabled-opacity: .45;
    --control-active-opacity: .8;
    /* Canvas 图表也从同一份主题取值，沿用原来的行情配色和字体。 */
    --chart-text: var(--text-secondary);
    --chart-grid: #f2f2f4;
    --chart-border: #e5e5ea;
    --chart-font-family: ui-monospace, 'SF Mono', Menlo, monospace;
    --chart-font-size: var(--font-size-10);
    --accent-lime: rgb(var(--accent-lime-rgb));
    --accent-warning: rgb(var(--accent-warning-rgb));
}

@supports (height: 100dvh) {
    :root { --viewport-height: 100dvh; }
}
@supports (font-size: clamp(1px, 2vw, 3px)) {
    :root {
        --site-hero-font-size: clamp(46px, 5vw, 68px);
        --site-heading-font-size: clamp(28px, 3.4vw, 42px);
    }
}
