﻿/* ================================================================
   OpenCodex+ styles 闁?dark terminal-inspired aesthetic
   ================================================================ */

:root {
    --bg:        #f7fafc;
    --bg-elev:   #ffffff;
    --bg-card:   #ffffff;
    --border:    #d8e1ea;
    --border-soft: #e8eef4;
    --text:      #17202a;
    --text-dim:  #435466;
    --text-mute: #66788c;
    --accent:    #0f8f73;
    --accent-hi: #0ca37f;
    --accent-dim:#cceee6;
    --accent-rgb: 15 143 115;
    --warn:      #b7791f;
    --danger:    #dc2626;
    --success:   #0f8f73;
    --radius:    10px;
    --radius-sm: 6px;
    --shadow:    0 18px 48px rgba(20,35,55,.08);
    --mono: 'JetBrains Mono', 'SF Mono', ui-monospace, 'Cascadia Mono', 'Roboto Mono', Consolas, Menlo, monospace;
    --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}

body.theme-chatgpt {
    --accent:    #2563eb;
    --accent-hi: #1d4ed8;
    --accent-dim:#dbeafe;
    --accent-rgb: 37 99 235;
}

body.theme-grok {
    --accent:    #0f8f73;
    --accent-hi: #0ca37f;
    --accent-dim:#cceee6;
    --accent-rgb: 15 143 115;
}

body.theme-claude {
    --accent:    #c15f2c;
    --accent-hi: #9f4820;
    --accent-dim:#f8dccb;
    --accent-rgb: 193 95 44;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
    overflow-x: hidden;
}

/* ====== background ====== */
.bg-grid {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(22,32,42,.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(22,32,42,.045) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(ellipse at top, black 0%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at top, black 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
}
.bg-glow {
    position: fixed;
    top: -20vh;
    left: 50%;
    width: 120vw;
    height: 70vh;
    transform: translateX(-50%);
    background: radial-gradient(ellipse at center, rgb(var(--accent-rgb) / .12) 0%, transparent 62%);
    z-index: -1;
    pointer-events: none;
    filter: blur(40px);
}

/* ====== header ====== */
.site-header {
    border-bottom: 1px solid var(--border-soft);
    background: rgba(255,255,255,.82);
    backdrop-filter: saturate(180%) blur(10px);
    -webkit-backdrop-filter: saturate(180%) blur(10px);
    position: sticky; top: 0;
    z-index: 10;
}
.site-header .wrap,
.site-footer .wrap {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.language-switch {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,.75);
}
.language-switch a {
    min-width: 42px;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    border-radius: 4px;
    color: var(--text-dim);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    line-height: 1;
}
.language-switch a:hover,
.language-switch a:focus-visible {
    color: var(--text);
    background: #f0f5f8;
    outline: none;
}
.language-switch a.active {
    color: #fff;
    background: var(--accent);
    box-shadow: 0 6px 16px rgb(var(--accent-rgb) / .18);
}
.product-switch {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.page-switch {
    --switch-accent: var(--accent);
    --switch-accent-hi: var(--accent-hi);
    --switch-accent-rgb: var(--accent-rgb);
    min-width: 118px;
    min-height: 54px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 22px;
    border: 1px solid rgb(var(--switch-accent-rgb) / .34);
    border-radius: 8px;
    background: linear-gradient(180deg, rgb(var(--switch-accent-rgb) / .12), rgb(var(--switch-accent-rgb) / .06));
    color: var(--switch-accent);
    box-shadow: 0 10px 24px rgb(var(--switch-accent-rgb) / .12), inset 0 1px 0 rgba(255,255,255,.72);
    font-weight: 800;
    font-size: 15px;
    text-decoration: none;
    letter-spacing: 0;
    transition: transform .15s, box-shadow .15s, border-color .15s, background .15s, color .15s;
}
.page-switch::before {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--switch-accent);
    box-shadow: 0 0 0 5px rgb(var(--switch-accent-rgb) / .16);
    flex: 0 0 auto;
}
.page-switch:hover,
.page-switch:focus-visible {
    transform: translateY(-1px);
    border-color: rgb(var(--switch-accent-rgb) / .58);
    background: linear-gradient(180deg, rgb(var(--switch-accent-rgb) / .18), rgb(var(--switch-accent-rgb) / .09));
    box-shadow: 0 14px 32px rgb(var(--switch-accent-rgb) / .18), inset 0 1px 0 rgba(255,255,255,.78);
    color: var(--switch-accent-hi);
    outline: none;
}
.page-switch.target-grok {
    --switch-accent: #0f8f73;
    --switch-accent-hi: #0b755f;
    --switch-accent-rgb: 15 143 115;
}
.page-switch.target-gpt {
    --switch-accent: #2563eb;
    --switch-accent-hi: #1d4ed8;
    --switch-accent-rgb: 37 99 235;
}
.page-switch.target-claude {
    --switch-accent: #c15f2c;
    --switch-accent-hi: #9f4820;
    --switch-accent-rgb: 193 95 44;
}
.page-switch.active {
    color: #fff;
    background: linear-gradient(180deg, var(--switch-accent), var(--switch-accent-hi));
    border-color: transparent;
}
.page-switch.active::before {
    background: #fff;
    box-shadow: 0 0 0 5px rgb(255 255 255 / .18);
}
.brand {
    display: inline-flex;
    align-items: baseline;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
}
.brand-mark {
    font-family: var(--mono);
    color: var(--accent);
    font-size: 18px;
    font-weight: 700;
    display: inline-block;
    animation: caret 1.2s steps(2) infinite;
}
@keyframes caret { 50% { opacity: .3; } }
.brand-name {
    font-weight: 700;
    font-size: 18px;
    letter-spacing: -.01em;
}
.nav-link {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 14px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: color .15s, background .15s;
}
.nav-link:hover { color: var(--text); background: #f0f5f8; }
nav { display: flex; gap: 4px; }

/* ====== main ====== */
.container {
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
    padding: 60px 24px 80px;
}

/* hero */
.hero {
    text-align: center;
    margin-bottom: 28px;
}
.badge {
    display: inline-block;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: .16em;
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--accent);
    background: rgb(var(--accent-rgb) / .06);
    margin-bottom: 24px;
}
.hero h1 {
    font-size: clamp(28px, 5vw, 44px);
    line-height: 1.15;
    letter-spacing: -.02em;
    margin: 0 0 16px;
    font-weight: 700;
}
.accent { color: var(--accent); }
.lead {
    color: var(--text-dim);
    font-size: 17px;
    max-width: 760px;
    margin: 0 auto;
    overflow-wrap: anywhere;
}
/* ====== workflow tabs ====== */
.workflow-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    background: rgba(255,255,255,.82);
    overflow: hidden;
    margin: 0 0 20px;
}
.workflow-tabs button {
    min-width: 0;
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    border: 0;
    background: transparent;
    color: var(--text-dim);
    font-weight: 700;
    font-family: var(--sans);
    font-size: 14px;
    text-decoration: none;
    border-right: 1px solid var(--border-soft);
    cursor: pointer;
}
.workflow-tabs button:last-child { border-right: none; }
.workflow-tabs button.active {
    margin: 10px;
    min-height: 38px;
    border: 0;
    border-radius: var(--radius-sm);
    background: var(--accent);
    color: #fff;
    box-shadow: 0 10px 24px rgb(var(--accent-rgb) / .22);
}
.tab-panel {
    margin-bottom: 36px;
}

/* ====== stepper ====== */
.stepper {
    list-style: none;
    padding: 0;
    margin: 0 0 32px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    background: var(--bg-elev);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(20,35,55,.05);
}
.stepper li {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    font-size: 13px;
    color: #718198;
    border-right: 1px solid var(--border-soft);
    position: relative;
    transition: color .2s, background .2s;
}
.stepper li:last-child { border-right: none; }
.stepper li span {
    font-family: var(--mono);
    font-weight: 700;
    font-size: 11px;
    opacity: .6;
}
.stepper li em {
    font-style: normal;
    font-weight: 500;
}
.stepper li.active {
    color: var(--accent);
    background: rgb(var(--accent-rgb) / .06);
}
.stepper li.active span { opacity: 1; }
.stepper li.done {
    color: var(--text-dim);
}
.stepper li.done::after {
    content: 'OK';
    position: absolute;
    right: 14px;
    color: var(--accent);
    font-weight: 700;
}

/* ====== card ====== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 32px;
    animation: cardIn .4s cubic-bezier(.2,.8,.2,1);
}
@keyframes cardIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.card-head {
    padding: 24px 28px 16px;
    border-bottom: 1px solid var(--border-soft);
}
.card-head h2 {
    margin: 0 0 6px;
    font-size: 18px;
    letter-spacing: -.01em;
}
.card-head p {
    margin: 0;
    color: var(--text-dim);
    font-size: 14px;
}
.card-body {
    padding: 24px 28px 28px;
}
.hidden { display: none !important; }

/* ====== form ====== */
.field {
    display: block;
    margin-bottom: 20px;
}
.field-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #26374a;
    margin-bottom: 8px;
    letter-spacing: .01em;
}
.field-hint {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    color: #5f7185;
}
.input {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    color: var(--text);
    font-size: 15px;
    font-family: var(--sans);
    transition: border-color .15s, box-shadow .15s, background .15s;
    outline: none;
}
.input.mono { font-family: var(--mono); font-size: 14px; letter-spacing: .02em; }
.input::placeholder { color: var(--text-mute); }
.input:hover { border-color: #b9c7d6; }
.input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgb(var(--accent-rgb) / .15);
    background: #ffffff;
}
textarea.input { resize: vertical; min-height: 120px; line-height: 1.6; }

/* ====== buttons ====== */
.btn-primary, .btn-ghost, .btn-accent {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--sans);
    cursor: pointer;
    text-decoration: none;
    transition: all .15s;
    user-select: none;
    white-space: nowrap;
}
.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 2px 8px rgb(var(--accent-rgb) / .2);
}
.btn-primary:hover:not(:disabled) {
    background: var(--accent-hi);
    box-shadow: 0 4px 12px rgb(var(--accent-rgb) / .3);
    transform: translateY(-1px);
}
.btn-primary:disabled {
    opacity: .5;
    cursor: not-allowed;
}
.btn-ghost {
    background: transparent;
    color: var(--text-dim);
    border-color: var(--border);
}
.btn-ghost:hover {
    color: var(--text);
    border-color: #b9c7d6;
    background: #f0f5f8;
}
.btn-accent { background: var(--accent); color: #fff; padding: 14px 28px; font-size: 15px; }

.actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}
.actions.center { justify-content: center; }

/* ====== notice ====== */
.notice {
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    line-height: 1.6;
    margin: 16px 0;
}
.notice strong {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
}
.notice.warn {
    background: #fff8e6;
    border: 1px solid #f3d28b;
    color: #7c4a03;
}
.tab-panel .card {
    margin-bottom: 0;
}
.tab-copy {
    margin: 0 0 18px;
    color: var(--text-dim);
}
.tab-action {
    width: 100%;
}
.query-result-card {
    margin-top: 18px;
}
.query-row-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.notice.warn strong { color: var(--warn); }
.notice.danger {
    background: #fff1f2;
    border: 1px solid #fecdd3;
    color: #9f1239;
}
.notice.danger strong { color: var(--danger); }
.notice ul {
    margin: 8px 0 0;
    padding-left: 20px;
    color: var(--text-dim);
}
.notice ul li { margin: 4px 0; }
.notice ul b { color: var(--text); }

/* ====== CDK chip ====== */
.cdk-chip {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.product-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: -8px 0 24px;
    padding: 16px 18px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    flex-wrap: wrap;
}
.product-summary-label {
    color: var(--text-dim);
    font-size: 14px;
    font-weight: 700;
}
.chip-label { color: var(--text-mute); font-size: 13px; }
.cdk-chip code {
    flex: 1;
    font-size: 14px;
    color: var(--text);
    min-width: 140px;
}
.chip-plan {
    padding: 4px 10px;
    background: rgb(var(--accent-rgb) / .12);
    color: var(--accent);
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    font-family: var(--mono);
}
.chip-plan-large {
    padding: 8px 14px;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: .02em;
}
.product-price {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 6px 12px;
    border-radius: 4px;
    background: #ffffff;
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 16px;
    font-weight: 800;
    font-family: var(--mono);
}
.chip-plan.plan-pro {
    background: rgba(168,85,247,.12);
    color: #7e22ce;
}
.chip-plan.plan-plus-1y {
    background: rgba(245,158,11,.12);
    color: #a16207;
}
.chip-plan.plan-grok {
    background: rgb(var(--accent-rgb) / .12);
    color: var(--accent);
}
.chip-plan.plan-claude {
    background: rgba(193,95,44,.14);
    color: #9f4820;
}

/* ====== guide ====== */
.guide {
    margin: 0 0 24px;
    padding: 0;
    list-style: none;
    counter-reset: step;
}
.guide li {
    position: relative;
    padding: 12px 12px 12px 44px;
    margin-bottom: 8px;
    color: var(--text-dim);
    font-size: 14px;
    line-height: 1.7;
    background: var(--bg);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    counter-increment: step;
}
.guide li::before {
    content: counter(step);
    position: absolute;
    left: 14px;
    top: 13px;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-dim);
    color: var(--accent);
    border-radius: 50%;
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 700;
}
.guide li b { color: var(--text); }

.link-outline {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
    padding: 3px 10px;
    border: 1px solid var(--accent-dim);
    color: var(--accent);
    border-radius: 4px;
    text-decoration: none;
    font-size: 12px;
    transition: all .15s;
}
.link-outline:hover {
    background: rgb(var(--accent-rgb) / .1);
    border-color: var(--accent);
}

kbd {
    display: inline-block;
    padding: 2px 6px;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-bottom-width: 2px;
    border-radius: 3px;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--text);
}

/* ====== confirm list ====== */
.confirm-list {
    margin: 0 0 20px;
    padding: 0;
}
.confirm-list div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-soft);
    gap: 16px;
}
.confirm-list div:last-child { border-bottom: none; }
.confirm-list dt {
    color: var(--text-dim);
    font-size: 14px;
    margin: 0;
}
.confirm-list dd {
    margin: 0;
    font-size: 15px;
    color: var(--text);
    text-align: right;
    word-break: break-all;
}

/* ====== result states ====== */
.result-body {
    padding: 48px 28px;
    text-align: center;
}
.result-body h2 {
    margin: 16px 0 8px;
    font-size: 22px;
    letter-spacing: -.01em;
}
.result-body p.muted {
    color: var(--text-dim);
    margin: 0 0 24px;
    font-size: 14px;
}
.result-body .confirm-list {
    text-align: left;
    max-width: 440px;
    margin: 20px auto;
}
.result-body .notice { text-align: left; max-width: 440px; margin-left: auto; margin-right: auto; }
.result-body .actions { flex-wrap: wrap; }

.spinner-big {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    margin: 0 auto;
    animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.status-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    animation: popIn .4s cubic-bezier(.34,1.6,.64,1);
}
@keyframes popIn {
    from { transform: scale(0); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}
.status-icon.success {
    background: rgb(var(--accent-rgb) / .14);
    color: var(--accent);
    box-shadow: 0 0 40px rgb(var(--accent-rgb) / .25);
}
.status-icon.failed {
    background: rgba(239,68,68,.14);
    color: var(--danger);
    box-shadow: 0 0 40px rgba(239,68,68,.25);
}

.progress-log {
    background: var(--bg);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 12px;
    color: var(--text-dim);
    max-width: 440px;
    margin: 24px auto 0;
    text-align: left;
    max-height: 160px;
    overflow-y: auto;
}
.progress-log div { margin: 2px 0; }
.progress-log div span { color: var(--accent); }

/* ====== cookie guide modal ====== */
.field-label-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.field-label-row .field-label {
    margin-bottom: 0;
}
.field-help-btn {
    width: auto;
    height: 24px;
    min-height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    border: 1px solid rgb(var(--accent-rgb) / .38);
    border-radius: 4px;
    background: rgb(var(--accent-rgb) / .1);
    color: var(--accent);
    font-size: 12px;
    line-height: 1;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, border-color .15s, transform .15s;
    white-space: nowrap;
    flex: 0 0 auto;
}
.field-help-btn:hover,
.field-help-btn:focus-visible {
    background: rgb(var(--accent-rgb) / .18);
    border-color: rgb(var(--accent-rgb) / .65);
    outline: none;
    transform: translateY(-1px);
}
.modal-open {
    overflow: hidden;
}
.cookie-guide-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.cookie-guide-modal.hidden {
    display: none;
}
.cookie-guide-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(60,72,88,.34);
    backdrop-filter: blur(2px);
}
.cookie-guide-panel {
    position: relative;
    width: min(950px, 100%);
    max-height: min(860px, calc(100vh - 48px));
    overflow: auto;
    background: #ffffff;
    color: #20252d;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 6px;
    box-shadow: 0 24px 80px rgba(20,35,55,.22);
    padding: 28px 30px 24px;
}
.cookie-guide-close {
    position: absolute;
    top: 18px;
    right: 22px;
    width: 32px;
    height: 32px;
    border: 0;
    background: transparent;
    color: #59616d;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
}
.cookie-guide-close:hover,
.cookie-guide-close:focus-visible {
    color: #111827;
    outline: none;
}
.cookie-guide-panel h2 {
    margin: 0 44px 22px 0;
    color: #20252d;
    font-size: 24px;
    line-height: 1.35;
    font-weight: 700;
    letter-spacing: 0;
}
.cookie-guide-warning {
    margin-bottom: 22px;
    padding: 16px 18px;
    border: 1px solid #f0dfbd;
    border-radius: 4px;
    background: #fffaf0;
    color: #303742;
    font-size: 15px;
    line-height: 1.8;
}
.cookie-guide-steps {
    margin: 0;
    padding-left: 20px;
    color: #303742;
    font-size: 16px;
    line-height: 1.95;
}
.cookie-guide-steps li {
    margin: 8px 0;
}
.cookie-guide-steps strong {
    color: #20252d;
}
.cookie-guide-steps code,
.cookie-guide-steps kbd {
    padding: 1px 5px;
    border: 1px solid #d8dee8;
    border-radius: 4px;
    background: #f6f8fb;
    color: #111827;
    font-family: var(--mono);
    font-size: .92em;
}
.cookie-guide-steps a {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    margin-left: 10px;
    padding: 0 12px;
    border: 1px solid rgb(var(--accent-rgb) / .42);
    border-radius: 4px;
    color: var(--accent);
    text-decoration: none;
    font-size: 14px;
    line-height: 1;
}
.cookie-guide-steps a:hover,
.cookie-guide-steps a:focus-visible {
    background: rgb(var(--accent-rgb) / .08);
    border-color: rgb(var(--accent-rgb) / .68);
    outline: none;
}
.session-guide-panel {
    max-width: 760px;
}
.session-guide-steps {
    padding-left: 0;
    list-style: none;
    counter-reset: guide-step;
}
.session-guide-steps li {
    counter-increment: guide-step;
    position: relative;
    padding: 14px 16px 14px 54px;
    margin: 12px 0;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #f9fafb;
}
.session-guide-steps li::before {
    content: counter(guide-step);
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 700;
}
.cookie-guide-image {
    display: block;
    width: 100%;
    margin-top: 20px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #f8fafc;
}

/* ====== stock status ====== */
.stock-status {
    border: 1px solid var(--border-soft);
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin: 12px 0 18px;
}
.hero-stock {
    width: min(520px, 100%);
    margin: 24px auto 0;
    background: rgba(255,255,255,.72);
    border-color: rgb(var(--accent-rgb) / .24);
    box-shadow: 0 14px 34px rgba(20,35,55,.08);
}
.hero-stock .stock-status-main {
    justify-content: center;
}
.hero-stock .stock-desc,
.hero-stock .stock-time {
    text-align: center;
}
.stock-status-main {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.stock-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--text-mute);
    box-shadow: 0 0 0 4px rgba(107,112,117,.12);
    flex: 0 0 auto;
}
.stock-title {
    color: #435466;
    font-size: 13px;
}
.stock-status strong {
    font-size: 14px;
    color: #101827;
}
.stock-desc {
    color: #4f6175;
    font-size: 13px;
    margin-top: 6px;
}
.stock-time {
    color: #66788c;
    font-size: 12px;
    margin-top: 4px;
}
.stock-variants {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}
.stock-variant {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border: 1px solid rgb(var(--accent-rgb) / .14);
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,.62);
    text-align: left;
}
.stock-variant-name {
    min-width: 0;
    color: #435466;
    font-size: 13px;
}
.stock-variant strong {
    font-size: 13px;
    color: #101827;
}
.stock-status[data-stock-level="high"] .stock-dot {
    background: var(--success);
    box-shadow: 0 0 0 4px rgb(var(--accent-rgb) / .14);
}
.stock-status[data-stock-level="medium"] .stock-dot {
    background: #38bdf8;
    box-shadow: 0 0 0 4px rgba(56,189,248,.14);
}
.stock-status[data-stock-level="low"] .stock-dot {
    background: var(--warn);
    box-shadow: 0 0 0 4px rgba(245,158,11,.14);
}
.stock-status[data-stock-level="none"] .stock-dot {
    background: var(--danger);
    box-shadow: 0 0 0 4px rgba(239,68,68,.14);
}
.stock-variant[data-stock-level="high"] .stock-dot {
    background: var(--success);
    box-shadow: 0 0 0 4px rgb(var(--accent-rgb) / .14);
}
.stock-variant[data-stock-level="medium"] .stock-dot {
    background: #38bdf8;
    box-shadow: 0 0 0 4px rgba(56,189,248,.14);
}
.stock-variant[data-stock-level="low"] .stock-dot {
    background: var(--warn);
    box-shadow: 0 0 0 4px rgba(245,158,11,.14);
}
.stock-variant[data-stock-level="none"] .stock-dot {
    background: var(--danger);
    box-shadow: 0 0 0 4px rgba(239,68,68,.14);
}

/* ====== usage guide ====== */
.guide-section {
    margin-top: 40px;
}
.guide-section h2 {
    margin: 0 0 10px;
    font-size: 24px;
    letter-spacing: 0;
}
.guide-lead {
    margin: 0 0 24px;
    color: var(--text-dim);
    font-size: 15px;
}
.guide-cards {
    display: grid;
    gap: 16px;
}
.guide-cards article {
    position: relative;
    padding: 22px 24px 22px 70px;
    border: 1px solid rgb(var(--accent-rgb) / .18);
    border-radius: var(--radius);
    background: rgba(255,255,255,.82);
    box-shadow: 0 12px 34px rgba(20,35,55,.05);
}
.theme-grok .guide-cards article {
    background: rgb(var(--accent-rgb) / .035);
}
.theme-claude .guide-cards article {
    background: rgba(255,250,247,.86);
}
.claude-guide-cards {
    grid-template-columns: 1fr;
}
.guide-inline-link {
    color: var(--accent);
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-style: dotted;
}
.claude-guide-warning {
    margin-top: 18px;
    padding: 18px 20px;
    border: 1px solid rgba(193,95,44,.28);
    border-radius: var(--radius);
    background: rgba(255,247,241,.92);
    color: #9f4820;
    font-size: 14px;
    line-height: 1.8;
}
.guide-num {
    position: absolute;
    left: 22px;
    top: 22px;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgb(var(--accent-rgb) / .14);
    color: var(--accent);
    font-weight: 800;
}
.guide-cards h3 {
    margin: 1px 0 12px;
    color: var(--accent);
    font-size: 17px;
}
.guide-cards p,
.guide-cards li {
    color: #26374a;
    font-size: 14px;
    line-height: 1.85;
}
.guide-cards ol,
.guide-cards ul {
    margin: 0;
    padding-left: 18px;
}
.guide-cards li + li {
    margin-top: 4px;
}
.guide-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    margin-top: 16px;
    padding: 0 16px;
    border: 1px solid rgb(var(--accent-rgb) / .28);
    border-radius: 999px;
    color: var(--accent);
    background: rgba(255,255,255,.68);
    text-decoration: none;
    font-weight: 700;
}
.guide-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 18px;
}
.guide-actions .btn-primary,
.guide-actions .btn-ghost {
    width: 100%;
}
.json-sample {
    margin: 14px 0;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    background: #172133;
    color: #d9f7ff;
    overflow-x: auto;
    font-size: 12px;
    line-height: 1.7;
}
.guide-checks {
    list-style: none;
    padding-left: 0 !important;
}
.guide-checks li::before {
    content: 'OK';
    display: inline-block;
    min-width: 24px;
    margin-right: 8px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
}

/* ====== faq ====== */
.faq {
    margin-top: 48px;
    padding: 32px;
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
}
.faq h3 {
    margin: 0 0 20px;
    font-size: 16px;
    color: var(--text-dim);
    font-weight: 600;
    letter-spacing: .02em;
    text-transform: uppercase;
}
.faq details {
    border-top: 1px solid var(--border-soft);
    padding: 14px 0;
}
.faq details:first-of-type { border-top: none; padding-top: 0; }
.faq summary {
    cursor: pointer;
    font-weight: 500;
    color: var(--text);
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 4px 0;
    transition: color .15s;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
    content: '+';
    font-family: var(--mono);
    color: var(--accent);
    font-size: 18px;
    transition: transform .2s;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq summary:hover { color: var(--accent); }
.faq details p {
    margin: 8px 0 0;
    color: var(--text-dim);
    font-size: 14px;
    line-height: 1.7;
}
.faq code {
    background: var(--bg);
    padding: 1px 6px;
    border-radius: 3px;
    border: 1px solid var(--border-soft);
    font-size: 13px;
    color: var(--text);
}

/* ====== toast ====== */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 18px;
    color: var(--text);
    font-size: 14px;
    box-shadow: 0 14px 36px rgba(20,35,55,.18);
    z-index: 100;
    opacity: 0;
    transition: transform .3s, opacity .3s;
    max-width: 90vw;
}
.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}
.toast.error { border-color: rgba(239,68,68,.4); }
.toast.error::before { content: '!'; color: var(--danger); margin-right: 8px; font-weight: 700; }
.toast.success { border-color: rgb(var(--accent-rgb) / .4); }
.toast.success::before { content: 'OK'; color: var(--accent); margin-right: 8px; font-weight: 700; }

/* ====== footer ====== */
.site-footer {
    border-top: 1px solid var(--border-soft);
    margin-top: 40px;
    color: var(--text-mute);
    font-size: 13px;
}
.site-footer .wrap {
    padding: 24px;
}
.mono { font-family: var(--mono); }
.muted { color: var(--text-mute); }
.small { font-size: 12px; }

/* ====== button spinner ====== */
.btn-primary .spinner,
.btn-accent .spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

/* ====== responsive ====== */
@media (max-width: 640px) {
    .container { padding: 36px 16px 60px; }
    .card-head, .card-body { padding-left: 20px; padding-right: 20px; }
    .hero h1 { font-size: 28px; }
    .lead { max-width: 320px; font-size: 15px; line-height: 1.65; }
    .workflow-tabs button { min-height: 50px; padding: 0 4px; font-size: 12px; white-space: nowrap; }
    .workflow-tabs button.active { margin: 7px; }
    .stepper { grid-template-columns: repeat(4, 1fr); }
    .stepper li { padding: 10px 6px; font-size: 11px; flex-direction: column; gap: 2px; text-align: center; }
    .stepper li.done::after { top: 4px; right: 4px; font-size: 10px; }
    .actions { flex-direction: column-reverse; }
    .actions button, .actions a { width: 100%; }
    .confirm-list div { flex-direction: column; align-items: flex-start; gap: 4px; }
    .confirm-list dd { text-align: left; }
    .site-header .wrap { padding: 12px 16px; gap: 10px; }
    .page-switch { min-width: 132px; min-height: 42px; padding: 0 12px; font-size: 13px; gap: 7px; }
    .page-switch::before { width: 8px; height: 8px; box-shadow: 0 0 0 4px rgb(var(--switch-accent-rgb) / .14); }
    .language-switch { gap: 2px; }
    .language-switch a { min-width: 34px; min-height: 30px; padding: 0 7px; font-size: 12px; }
    .site-footer .wrap { flex-direction: column; gap: 8px; text-align: center; }
    .cookie-guide-modal { padding: 12px; align-items: flex-start; }
    .cookie-guide-panel {
        max-height: calc(100vh - 24px);
        padding: 22px 18px 18px;
    }
    .cookie-guide-panel h2 {
        font-size: 20px;
        margin-right: 38px;
    }
    .cookie-guide-warning,
    .cookie-guide-steps {
        font-size: 14px;
    }
    .guide-cards article { padding: 62px 18px 18px; }
    .guide-num { left: 18px; top: 18px; }
    .guide-actions { grid-template-columns: 1fr; }
}

/* ====== query page ====== */
.query-results {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.query-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 12px;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    font-size: 13px;
}
.query-row .q-code { font-family: var(--mono); color: var(--text); }
.query-row .q-meta { color: var(--text-dim); font-size: 12px; }
.q-badge {
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    font-family: var(--mono);
    text-transform: uppercase;
    letter-spacing: .03em;
}
.q-badge.unused     { background: rgba(148,163,184,.15); color: #94a3b8; }
.q-badge.processing { background: rgba(59,130,246,.15); color: #60a5fa; }
.q-badge.used       { background: rgb(var(--accent-rgb) / .15); color: var(--accent); }
.q-badge.failed     { background: rgba(239,68,68,.15); color: var(--danger); }
.q-badge.not_found  { background: rgba(107,112,117,.15); color: var(--text-mute); }

