:root {
    --font-sans: 'MiSans', 'HarmonyOS Sans SC', 'HarmonyOS Sans', 'Alibaba PuHuiTi', 'Alibaba PuHuiTi 3.0', 'Source Han Sans SC', 'Noto Sans CJK SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    --font-display: 'MiSans', 'HarmonyOS Sans SC', 'HarmonyOS Sans', 'Alibaba PuHuiTi', 'Alibaba PuHuiTi 3.0', 'Source Han Sans SC', 'Noto Sans CJK SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    --bg-color: #FFFFFF;
    --surface: #FFFFFF;
    --surface-muted: #F4F4F4;
    --bubble-agent-bg: #FFFFFF;
    --bubble-user-bg: #000000;
    --text-primary: #000000;
    --text-secondary: #3A3A3A;
    --text-muted: #777777;
    --text-on-accent: #FFFFFF;
    --accent: #000000;
    --accent-soft: #EDEDED;
    --border-color: #000000;
    --radius-lg: 0;
    --radius-md: 0;
    --radius-sm: 0;
    --shadow-soft: 8px 8px 0 #000000;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font-sans);
    background:
        linear-gradient(90deg, rgba(0, 0, 0, 0.06) 1px, transparent 1px),
        linear-gradient(0deg, rgba(0, 0, 0, 0.06) 1px, transparent 1px),
        var(--bg-color);
    background-size: 48px 48px;
    color: var(--text-primary);
    overflow: hidden;
}
.initial-view, .chat-view { display: none; }
body.show-initial-view .initial-view { display: flex; }
body.show-chat-view .chat-view { display: flex; flex-direction: column; height: 100vh; }
.logo { height: clamp(40px, 7vw, 120px); width: auto; display: block; }


.language-switcher {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 100;
    background: #fff;
    border: 1px solid #000;
    border-radius: 0;
    padding: 0;
    display: flex;
    box-shadow: 4px 4px 0 #000;
}
.language-switcher button {
    border: none;
    background-color: transparent;
    padding: 7px 13px;
    font-size: 0.84rem;
    font-weight: 700;
    border-radius: 999px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.2s ease, background-color 0.2s ease;
}
.language-switcher button.active {
    background-color: #000;
    color: #fff;
    box-shadow: none;
}

.settings-toggle {
    min-width: 48px;
    min-height: 48px;
    padding: 0;
    border-radius: 999px;
    border: 1px solid #000;
    background: #fff;
    color: #000;
    display: inline-grid;
    place-items: center;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.settings-toggle span { display: none; }
.settings-toggle:hover { background: #000; color: #fff; transform: rotate(24deg); }
.settings-toggle svg, .settings-close svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.gear-button svg { transition: transform 0.3s ease; }
.gear-button:hover svg, .gear-button.is-attention svg { transform: rotate(120deg); }
.gear-button.is-attention { animation: gearNudge 0.9s ease-in-out infinite; }
body.show-initial-view > .settings-toggle { position: fixed; top: 1.5rem; right: 7rem; z-index: 100; box-shadow: 4px 4px 0 #000; }
.chat-header .settings-toggle { box-shadow: none; }
@keyframes gearNudge { 50% { transform: translateY(-2px); } }

.settings-panel {
    position: fixed;
    inset: 0;
    z-index: 1002;
    width: 100%;
    height: 100%;
    overflow: auto;
    padding: min(6vw, 56px);
    background: rgba(255, 255, 255, 0.74);
    border: 0;
    border-radius: 0;
    box-shadow: none;
    opacity: 0;
    pointer-events: none;
    transform: none;
    transition: opacity 0.2s ease;
    backdrop-filter: blur(4px);
    display: grid;
    place-items: center;
}
.settings-panel.visible { opacity: 1; pointer-events: auto; transform: none; }
.settings-panel-content { width: min(720px, 100%); padding: 28px; background: #fff; border: 1px solid #000; box-shadow: 12px 12px 0 #000; }
.settings-panel-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 18px; }
.eyebrow { margin: 0 0 4px; color: #000; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; }
.settings-panel h2 { margin: 0; font-family: var(--font-display); font-size: clamp(2rem, 5vw, 4rem); letter-spacing: -0.08em; }
.settings-close { width: 44px; height: 44px; border-radius: 999px; border: 1px solid #000; background: #fff; color: #000; cursor: pointer; display: grid; place-items: center; }
.settings-close:hover { background: #000; color: #fff; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.setting-field, .setting-switch { display: grid; gap: 8px; padding: 14px; border: 1px solid #000; border-radius: 0; background: #fff; color: #000; font-size: 0.86rem; font-weight: 700; }
.setting-field select { width: 100%; min-height: 44px; border-radius: 0; border: 1px solid #000; background: #fff; color: #000; padding: 0 12px; font: inherit; cursor: pointer; }
.setting-switch { grid-template-columns: 44px 1fr; align-items: center; cursor: pointer; }
.setting-switch input { width: 44px; height: 24px; accent-color: #000; cursor: pointer; }
.settings-confirm { width: 100%; min-height: 52px; margin-top: 12px; border: 1px solid #000; background: #000; color: #fff; font: inherit; font-weight: 900; cursor: pointer; transition: background-color 0.2s ease, color 0.2s ease; }
.settings-confirm:hover { background: #fff; color: #000; }


button:disabled {
  background-color: #ccc;
  color: #666;
  cursor: not-allowed;
  border-color: #bbb; /* 可选 */
  opacity: 0.8;       /* 可选 */
}

.passphrase-gate { position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center; padding: 24px; background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(6px); }
.passphrase-gate.hidden { display: none; }
.passphrase-card { width: min(420px, 100%); padding: 28px; background: #fff; border: 1px solid #000; box-shadow: 12px 12px 0 #000; display: grid; gap: 14px; }
.passphrase-card p { margin: 0; font-size: 0.72rem; font-weight: 900; letter-spacing: 0.18em; }
.passphrase-card h2 { margin: 0; font-family: var(--font-display); font-size: clamp(2rem, 7vw, 4rem); letter-spacing: -0.08em; line-height: 0.95; }
.passphrase-card input { min-height: 52px; border: 1px solid #000; padding: 0 14px; font: inherit; }
.passphrase-card button { min-height: 50px; border: 1px solid #000; background: #000; color: #fff; font: inherit; font-weight: 900; cursor: pointer; }
.passphrase-card button:hover { background: #fff; color: #000; }
#passphrase-error { color: #b10000; font-weight: 800; }

.initial-view { height: 100vh; flex-direction: column; justify-content: center; align-items: center; padding: 2rem; position: relative; box-sizing: border-box; }
.wordmark { position: absolute; top: 1.5rem; left: 1.5rem; padding: 10px 14px; border: 1px solid #000; background: #fff; box-shadow: 4px 4px 0 #000; font-weight: 900; letter-spacing: -0.04em; color: #000; text-decoration: none; cursor: pointer; }
.initial-content { display: flex; flex-direction: column; justify-content: center; align-items: center; width: 100%; flex-grow: 1; text-align: center;}
.hero-group { text-align: center; max-width: min(980px, 100%); width: 100%; }
.hero-group h1 { font-family: var(--font-display); font-size: clamp(4.2rem, 15vw, 12rem); font-weight: 900; letter-spacing: -0.08em; line-height: 0.86; margin: 0 0 2.4rem 0; color: #000; }
.hero-group h1::after { content: " "; display: block; margin-top: 1rem; font-family: var(--font-sans); font-size: clamp(0.78rem, 1.2vw, 1rem); line-height: 1; letter-spacing: 0.22em; font-weight: 700; }
.initial-form { position: relative; max-width: 760px; margin: 0 auto; }

.initial-form input { width: 100%; height: 66px; padding: 0 72px 0 24px; border: 1px solid #000; border-radius: 0; background-color: #fff; color: #000; font-size: 1.05rem; box-sizing: border-box; transition: box-shadow 0.2s; box-shadow: 8px 8px 0 #000; }
.initial-form input:focus, .input-container input:focus, select:focus, button:focus-visible { outline: 2px solid #000; outline-offset: 3px; }
#initial-input::placeholder { font-weight: 400; }
.initial-form button { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; background: #000; border: 1px solid #000; border-radius: 0; color: #fff; cursor: pointer; display: grid; place-items: center; transition: background-color 0.2s, color 0.2s; }
.initial-form button:hover { background-color: #fff; color: #000; }
.paper-entry-button { margin-top: 24px; min-height: 50px; padding: 0 28px; border: 1px solid #000; background: #fff; color: #000; box-shadow: 6px 6px 0 #000; font: inherit; font-size: 0.95rem; font-weight: 900; letter-spacing: 0.08em; cursor: pointer; transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease; }
.paper-entry-button:hover { background: #000; color: #fff; transform: translate(-2px, -2px); }


.initial-footer { margin-top: 2.5rem; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 0.8rem; font-size: 0.92rem; font-weight: 600; }
.initial-footer a { color: var(--text-secondary); text-decoration: none; transition: color 0.2s; }
.initial-footer a:hover { color: var(--text-primary); }
.initial-footer span { color: var(--border-color); }


.chat-shell { width: 100%; height: 100vh; display: grid; grid-template-columns: minmax(250px, 22vw) 1fr; padding: 18px; gap: 18px; }
.chat-rail { position: relative; overflow: hidden; border: 1px solid #000; border-radius: 0; padding: 22px; background: #fff; box-shadow: 8px 8px 0 #000; display: flex; flex-direction: column; justify-content: space-between; }
.chat-rail::before { content: ""; position: absolute; inset: 14px; border: 1px solid #000; pointer-events: none; }
.rail-brand { position: relative; display: flex; align-items: center; gap: 12px; color: #000; text-decoration: none; }
.rail-brand img { width: 48px; height: 48px; border-radius: 0; object-fit: cover; border: 1px solid #000; }
.rail-brand span { display: block; font-size: 0.76rem; color: #000; letter-spacing: 0.16em; text-transform: uppercase; }
.rail-brand strong { display: block; margin-top: 3px; font-size: 0.95rem; }
.rail-copy { position: relative; margin: auto 0; }
.rail-copy p, .chat-header p, .output-header p, .retry-card p { margin: 0 0 10px; color: #000; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; }
.rail-copy h2 { margin: 0 0 16px; max-width: 8em; font-family: var(--font-display); font-size: clamp(2.4rem, 4vw, 4.6rem); line-height: 0.94; letter-spacing: -0.08em; }
.rail-copy span { display: block; max-width: 28ch; color: #333; line-height: 1.7; font-size: 0.92rem; }
.rail-copy h2, .rail-copy span { transition: opacity 0.28s ease, transform 0.28s ease; }
.rail-copy h2.is-changing, .rail-copy span.is-changing { opacity: 0; transform: translateY(8px); }
.rail-actions { position: relative; display: grid; gap: 10px; }
.rail-actions .settings-toggle {
    min-height: 46px;
    width: auto;
    min-width: 0;
    background: #fff;
    color: #000;
    border: 1px solid #000;
    border-radius: 0;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.86rem;
    font-weight: 800;
    box-shadow: none;
    transform: none;
}
.rail-actions .settings-toggle span { display: inline; }
.rail-actions .settings-toggle:hover { background: #fff; color: #000; transform: none; }
.rail-actions .settings-toggle:hover svg { transform: none; }
.chat-stage { min-width: 0; height: 100%; display: grid; grid-template-rows: auto 1fr auto; border: 1px solid #000; border-radius: 0; background: #fff; box-shadow: 8px 8px 0 #000; overflow: hidden; }
.chat-header { padding: 22px 26px; border-bottom: 1px solid #000; background: #fff; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.chat-header h1 { margin: 0; font-family: var(--font-display); font-size: clamp(1.8rem, 3vw, 3.4rem); line-height: 0.95; letter-spacing: -0.06em; }
.live-pill { border: 1px solid #000; color: #000; border-radius: 0; padding: 8px 12px; font-size: 0.76rem; font-weight: 800; background: #fff; }
.new-chat-button { min-height: 46px; background: #fff; color: #000; border: 1px solid #000; border-radius: 0; padding: 0 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 0.86rem; font-weight: 800; cursor: pointer; transition: background-color 0.2s ease, color 0.2s ease; }
.new-chat-button:hover { background: #000; color: #fff; transform: none; }
.chat-log { min-height: 0; overflow-y: auto; padding: 26px; display: flex; flex-direction: column; gap: 1.25rem; }
.chat-footer { padding: 18px 26px 24px; flex-shrink: 0; background: #fff; border-top: 1px solid #000; }
.input-container { position: relative; }
.input-container input { width: 100%; height: 62px; padding: 0 126px 0 22px; border: 1px solid #000; border-radius: 0; font-size: 1rem; box-sizing: border-box; background-color: #fff; color: #000; box-shadow: 4px 4px 0 #000; }
.input-container input::placeholder { color: #666; }
.submit-button { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; background: #000; border: 1px solid #000; border-radius: 0; color: #fff; cursor: pointer; display: grid; place-items: center; transition: background-color 0.2s, color 0.2s; }
.submit-button:hover { background: #fff; color: #000; transform: translateY(-50%); }
.stop-button { position: absolute; right: 62px; top: 50%; transform: translateY(-50%); height: 44px; padding: 0 12px; background: #fff; border: 1px solid #000; border-radius: 0; color: #000; cursor: pointer; font-size: 0.78rem; font-weight: 900; }
.stop-button:hover { background: #000; color: #fff; }
.stop-button[hidden] { display: none; }



.message-group { max-width: min(82%, 760px); width: fit-content; }
.message-group.user { align-self: flex-end; }
.message-group.agent { align-self: flex-start; }
.message-group.has-output, .message-group.has-retry, .message-group.has-player, .message-group.has-error { max-width: 100%; width: 100%; }
.message-bubble { padding: 14px 18px; border: 1px solid #000; border-radius: 0; font-size: 0.98rem; line-height: 1.7; box-shadow: 4px 4px 0 #000; }
.user .message-bubble { background: #000; color: #fff; }
.status-bubble { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-radius: 0; background: #fff; color: #000; border: 1px solid #000; box-shadow: 4px 4px 0 #000; }
.error-bubble { background-color: #fff; color: #000; border-color: #000; }
.error-details { border: 1px solid #000; background: #fff; box-shadow: 4px 4px 0 #000; }
.error-details summary { min-height: 48px; display: flex; align-items: center; gap: 10px; padding: 12px 16px; cursor: pointer; font-weight: 800; list-style: none; }
.error-details summary::-webkit-details-marker { display: none; }
.error-details summary::after { content: "+"; margin-left: auto; font-size: 1.2rem; line-height: 1; }
.error-details[open] summary { border-bottom: 1px solid #000; }
.error-details[open] summary::after { content: "−"; }
.error-detail-text { margin: 0; padding: 14px 16px; max-height: 220px; overflow: auto; background: #fff; color: #000; font-family: var(--font-sans); font-size: 0.8rem; line-height: 1.65; white-space: pre-wrap; word-break: break-word; }
.icon-error { width: 20px; height: 20px; fill: currentColor; flex-shrink: 0; }
.thinking-dots { display: flex; gap: 4px; }
.thinking-dots span { width: 7px; height: 7px; background-color: currentColor; border-radius: 50%; animation: bounce 1.4s infinite both; }
.thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.thinking-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1.0); } }


.output-card, .retry-card { border: 1px solid #000; border-radius: 0; background: #fff; overflow: hidden; box-shadow: 8px 8px 0 #000; }
.output-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: 18px 20px; border-bottom: 1px solid #000; }
.output-header h3, .retry-card h3 { margin: 0; font-family: var(--font-display); font-size: 1.35rem; letter-spacing: -0.04em; }
.output-status { color: #000; border: 1px solid #000; border-radius: 0; padding: 7px 10px; font-size: 0.72rem; font-weight: 800; white-space: nowrap; }
.output-card.is-streaming .output-status::after { content: ""; display: inline-block; width: 0.45em; height: 0.45em; margin-left: 0.5em; border-radius: 999px; background: #000; animation: pulseDot 1s infinite; }
.raw-output { margin: 0; padding: 20px; max-height: 34vh; overflow: auto; background: #fff; color: #000; font-family: var(--font-sans); font-size: 0.86rem; line-height: 1.75; white-space: pre-wrap; word-break: break-word; }
.raw-output code span { display: inline; animation: tokenFadeIn 0.2s forwards; opacity: 0; }
.retry-card { padding: 20px; display: flex; align-items: center; justify-content: space-between; gap: 18px; background: #fff; }
.retry-card span { display: block; margin-top: 8px; color: #333; line-height: 1.6; }
.retry-generation { min-height: 46px; padding: 0 18px; border: 1px solid #000; border-radius: 0; background: #000; color: #fff; font-weight: 900; cursor: pointer; white-space: nowrap; }
.retry-generation:hover { background: #fff; color: #000; }
@keyframes pulseDot { 50% { transform: scale(1.7); opacity: 0.45; } }
@keyframes tokenFadeIn { to { opacity: 1; } }
.player-container { background: #fff; border: 1px solid #000; border-radius: 0; padding: 10px; box-shadow: 8px 8px 0 #000; }
.iframe-wrapper { --preview-width: 100%; --preview-height: auto; --source-width: 1920px; --source-height: 1080px; --preview-scale: 1; width: min(100%, var(--preview-width)); height: var(--preview-height); margin: 0 auto; border-radius: 0; overflow: hidden; display: block; background: #111; border: 1px solid #000; }
.animation-iframe { width: var(--source-width); height: var(--source-height); border: none; display: block; transform: scale(var(--preview-scale)); transform-origin: top left; }
.player-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 6px; padding: 8px 2px 2px; }
.action-button { min-height: 32px; display: inline-flex; align-items: center; justify-content: center; padding: 6px 10px; border: 1px solid #000; border-radius: 0; font-size: 0.78rem; font-weight: 700; cursor: pointer; background: #fff; color: #000; transition: background-color 0.2s, color 0.2s; }
.action-button:hover { background: #000; color: #fff; }
.action-button.open-new-window { background: #000; color: #fff; border-color: #000; }
.action-button.open-new-window:hover { background: #fff; color: #000; border-color: #000; }

/* === 动画占位符 === */
.animated-placeholder { position: absolute; top: 0; left: 25px; height: 60px; width: calc(100% - 85px); display: flex; align-items: center; overflow: hidden; pointer-events: none; }
.animated-placeholder.hidden { display: none; }
.animated-placeholder span { position: absolute; font-size: 1.1rem; font-weight: 300; color: var(--text-secondary); animation: scroll-up 4s ease-in-out forwards; }
@keyframes scroll-up {
    0% { opacity: 0; transform: translateY(60%); }
    15% { opacity: 1; transform: translateY(0%); }
    85% { opacity: 1; transform: translateY(0%); }
    100% { opacity: 0; transform: translateY(-60%); }
}

/* === 模态框样式 === */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}
.modal-overlay.visible {
    display: flex;
    opacity: 1;
}
.modal-content {
    background: #fff;
    padding: 2rem 2.5rem;
    border-radius: var(--radius-md);
    max-width: 420px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    text-align: center;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.2s ease-in-out;
}
.modal-overlay.visible .modal-content {
    transform: scale(1);
}
.modal-content p {
    margin: 0 0 1.5rem 0;
    line-height: 1.6;
    color: var(--text-primary);
    font-size: 1rem;
}
.modal-button {
    width: 100%;
    padding: 12px;
    background: var(--bubble-user-bg);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}
.modal-button:hover {
    background-color: #0070E0;
}
.modal-close-button {
    position: absolute;
    top: 8px;
    right: 12px;
    background: transparent;
    border: none;
    font-size: 2rem;
    font-weight: 300;
    color: var(--border-color);
    cursor: pointer;
    line-height: 1;
    padding: 5px;
}
.modal-close-button:hover {
    color: var(--text-secondary);
}

.share-form { display: grid; gap: 14px; text-align: left; max-width: 520px; }
.share-form p { margin-bottom: 0; font-weight: 900; text-align: center; }
.share-form label { display: grid; gap: 8px; min-width: 0; font-size: 0.9rem; font-weight: 800; }
.share-form input, .share-form select, .share-form textarea { min-height: 44px; max-width: 100%; box-sizing: border-box; border: 1px solid #000; padding: 0 12px; background: #fff; color: #000; font: inherit; }
.share-form textarea { min-height: 112px; padding: 12px; resize: vertical; line-height: 1.6; }
.paper-upload-form { width: min(520px, calc(100vw - 32px)); overflow: hidden; border: 1px solid #000; border-radius: 0; box-shadow: 8px 8px 0 #000; }
.paper-upload-form input[type="file"] { width: 100%; min-width: 0; color: transparent; padding: 6px; cursor: pointer; }
.paper-upload-form input[type="file"]::file-selector-button { min-height: 32px; margin-right: 12px; border: 1px solid #000; background: #000; color: #fff; padding: 0 14px; font: inherit; font-weight: 900; cursor: pointer; transition: background-color 0.2s, color 0.2s; }
.paper-upload-form input[type="file"]:hover::file-selector-button { background: #fff; color: #000; }
.paper-upload-form input[type="file"]::-webkit-file-upload-button { min-height: 32px; margin-right: 12px; border: 1px solid #000; background: #000; color: #fff; padding: 0 14px; font: inherit; font-weight: 900; cursor: pointer; transition: background-color 0.2s, color 0.2s; }
.paper-upload-form input[type="file"]:hover::-webkit-file-upload-button { background: #fff; color: #000; }
.paper-file-name { display: block; max-width: 100%; min-height: 1.4em; overflow-wrap: anywhere; word-break: break-word; white-space: normal; color: #000; font-size: 0.86rem; font-weight: 700; line-height: 1.45; }
.share-result { display: grid; gap: 10px; padding-top: 12px; border-top: 1px solid #000; }
.share-result[hidden] { display: none; }
.share-meta { display: grid; grid-template-columns: 88px 1fr; gap: 10px; align-items: start; font-size: 0.86rem; }
.share-meta span { color: #333; font-weight: 800; }
.share-meta strong { word-break: break-all; }
.share-qr { width: 180px; height: 180px; justify-self: center; border: 1px solid #000; background: #fff; padding: 8px; }

.preview-confirm-content { display: grid; gap: 18px; border: 1px solid #000; border-radius: 0; box-shadow: 8px 8px 0 #000; }
#preview-confirm-modal { z-index: 1003; }
.preview-confirm-content p { margin: 0; font-weight: 900; color: #000; }
.preview-confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.modal-button.secondary { background: #fff; color: #000; border: 1px solid #000; }
.modal-button.secondary:hover { background: #000; color: #fff; }

/* 遮罩层 */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.4); /* 半透明黑色 */
    z-index: 10001;
}

/* 警告框 */
.warning-box {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    color: #000;
    padding: 24px 28px;
    border: 1px solid #000;
    border-radius: 0;
    font-size: 1rem;
    font-weight: 500;
    box-shadow: 8px 8px 0 #000;
    z-index: 10002;
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: min(460px, 90vw);
    animation: fadeIn 0.3s ease-out;
}
.warning-copy { display: grid; gap: 8px; }
.warning-copy strong { font-size: 1.02rem; font-weight: 900; }
.warning-copy span { color: #333; font-size: 0.88rem; line-height: 1.65; }
.warning-spinner { width: 24px; height: 24px; border: 2px solid #000; border-right-color: transparent; border-radius: 50%; flex: 0 0 auto; animation: warningSpin 0.8s linear infinite; }
.warning-box.is-blocking { cursor: wait; }
.warning-box.has-description { align-items: flex-start; }
.warning-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.queue-cancel-button { min-height: 34px; padding: 0 12px; border: 1px solid #000; background: #000; color: #fff; font-weight: 900; cursor: pointer; white-space: nowrap; }
.queue-cancel-button:hover { background: #fff; color: #000; }

/* 关闭按钮 */
.warning-box .close-button {
    background: none;
    border: none;
    font-size: 1.3rem;
    color: inherit;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translate(-50%, -40%); }
    to { opacity: 1; transform: translate(-50%, -50%); }
}
@keyframes warningSpin { to { transform: rotate(360deg); } }

@media (max-width: 720px) {
    body.show-initial-view > .settings-toggle { top: auto; right: 1rem; bottom: 1rem; }
    .language-switcher { top: 1rem; right: 1rem; }
    #logo-initial { top: 1rem; left: 1rem; height: 44px; }
    .initial-view { padding: 1.25rem; }
    .hero-group h1 { font-size: clamp(2.4rem, 14vw, 4rem); }
    .initial-footer { font-size: 0.85rem; }
    .chat-shell { grid-template-columns: 1fr; padding: 10px; gap: 10px; }
    .chat-rail { min-height: auto; padding: 14px; border-radius: 24px; display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; }
    .rail-copy { display: none; }
    .rail-actions { display: flex; }
    .chat-stage { border-radius: 24px; min-height: 0; }
    .chat-header { padding: 1rem; }
    .chat-header h1 { font-size: 1.8rem; }
    .live-pill { display: none; }
    .new-chat-button span, .chat-rail .settings-toggle span { display: none; }
    .chat-log { padding: 1rem; }
    .chat-footer { padding: 0.75rem 1rem 1rem; }
    .message-group { max-width: 92%; }
    .retry-card { align-items: stretch; flex-direction: column; }
    .player-actions { grid-template-columns: 1fr; }
    .settings-panel { padding: 1rem; }
    .settings-panel-content { padding: 18px; box-shadow: 6px 6px 0 #000; }
    .settings-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}
