:root {
    --black: #050505;
    --violet: #7d39eb;
    --violet-light: #9b5de5;
    --violet-glow: rgba(125, 57, 235, 0.35);
    --lime: #c6ff33;
    --lime-soft: #d4ff5e;
    --lime-dim: #a3d42a;
    --lime-glow: rgba(198, 255, 51, 0.28);
    --white: #ffffff;
    --surface: rgba(18, 18, 20, 0.88);
    --surface-solid: #121214;
    --surface-light: #18181c;
    --surface-elevated: #1f1f24;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.14);
    --danger: #ff5f5f;
    --muted: #9ca3af;
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 22px;
    --shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.35);
    --transition: 0.22s ease;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Inter", Arial, Helvetica, sans-serif;
    background: var(--black);
    color: var(--white);
    line-height: 1.5;
    background-image:
        radial-gradient(circle at 12% 18%, rgba(125, 57, 235, 0.22) 0%, transparent 34%),
        radial-gradient(circle at 88% 12%, rgba(198, 255, 51, 0.12) 0%, transparent 28%),
        radial-gradient(circle at 50% 100%, rgba(125, 57, 235, 0.08) 0%, transparent 40%);
    background-attachment: fixed;
}

h1, h2 {
    margin-top: 0;
    letter-spacing: -0.02em;
}

a {
    transition: color var(--transition), background var(--transition), border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    border-bottom: 1px solid var(--border);
    background: rgba(5, 5, 5, 0.72);
    backdrop-filter: blur(18px) saturate(140%);
}

.header-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0.85rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.logo-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--white);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.98rem;
}

.logo-wrapper:hover {
    color: var(--lime);
}

.logo {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--violet) 0%, var(--lime) 100%);
    display: grid;
    place-items: center;
    color: var(--black);
    font-weight: 800;
    font-size: 0.82rem;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 8px 24px var(--violet-glow);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-shrink: 0;
}

.header-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    flex-shrink: 0;
    padding: 0.58rem 1.15rem;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--lime) 0%, var(--lime-soft) 100%);
    color: #0a0d05;
    font-weight: 800;
    font-size: 0.86rem;
    text-decoration: none;
    box-shadow: 0 0 0 1px rgba(198, 255, 51, 0.35), 0 10px 28px var(--lime-glow);
}

.header-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 0 1px rgba(198, 255, 51, 0.5), 0 14px 32px rgba(198, 255, 51, 0.38);
}

.cm-lang-select {
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.55rem 2.1rem 0.55rem 0.85rem;
    border-radius: 999px;
    border: 1px solid var(--border-strong);
    background-color: var(--surface-light);
    color: var(--white);
    cursor: pointer;
    appearance: none;
    min-width: 7.25rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23c6ff33' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
}

.cm-lang-select:hover {
    border-color: rgba(198, 255, 51, 0.45);
    background-color: var(--surface-elevated);
}

.cm-lang-select:focus {
    outline: 2px solid rgba(198, 255, 51, 0.55);
    outline-offset: 2px;
}

.layout {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 1.25rem 2.5rem;
}

.hero {
    padding: 3.5rem 0 2.25rem;
    text-align: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--lime);
    border: 1px solid rgba(198, 255, 51, 0.22);
    background: rgba(198, 255, 51, 0.07);
    border-radius: 999px;
    padding: 0.38rem 0.95rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.hero h1 {
    font-size: clamp(2.1rem, 5.5vw, 3.75rem);
    line-height: 1.08;
    margin-bottom: 0.85rem;
    max-width: 920px;
    margin-left: auto;
    margin-right: auto;
}

.hero .highlight {
    background: linear-gradient(90deg, #b794ff 0%, var(--lime) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--muted);
    max-width: 640px;
    margin: 0 auto;
    font-size: 1.05rem;
    line-height: 1.65;
}

.workspace {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.15rem;
}

.panel {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(10px);
}

.panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--border);
}

.panel-header h2 {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin: 0;
    font-size: 1.08rem;
    font-weight: 700;
}

.icon-box {
    display: inline-grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 10px;
    background: rgba(125, 57, 235, 0.16);
    border: 1px solid rgba(125, 57, 235, 0.28);
    font-size: 0.95rem;
}

.panel-meta {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    align-items: flex-end;
}

.char-count {
    display: inline-flex;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 600;
}

.limits-info {
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.2;
    text-align: right;
}

.limits-info strong {
    color: var(--white);
    font-weight: 700;
}

.limits-info .warn {
    color: var(--lime);
}

.limits-info .danger {
    color: var(--danger);
}

.small {
    margin: 0.65rem 0 0.45rem;
}

.small label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: #d1d5db;
    letter-spacing: 0.01em;
}

textarea,
select,
button {
    width: 100%;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-size: 0.96rem;
    font-family: inherit;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

textarea,
select {
    background: var(--surface-light);
    color: var(--white);
    padding: 0.85rem 0.95rem;
    margin-bottom: 0.2rem;
    border-color: rgba(255, 255, 255, 0.07);
}

textarea {
    min-height: 280px;
    resize: vertical;
    line-height: 1.55;
}

textarea:focus,
select:focus {
    outline: none;
    border-color: rgba(198, 255, 51, 0.45);
    box-shadow: 0 0 0 3px rgba(198, 255, 51, 0.12);
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23a1a1aa' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    padding-right: 2.2rem;
}

#multiplyBtn {
    background: linear-gradient(135deg, var(--violet) 0%, #8b4cf0 55%, var(--violet-light) 100%);
    color: var(--white);
    padding: 0.92rem 1.25rem;
    border: none;
    cursor: pointer;
    font-weight: 800;
    letter-spacing: 0.01em;
    box-shadow: 0 12px 28px var(--violet-glow);
}

#multiplyBtn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 16px 34px rgba(125, 57, 235, 0.42);
}

button:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

.error-input {
    border-color: var(--danger) !important;
    box-shadow: 0 0 0 3px rgba(255, 95, 95, 0.15) !important;
}

.status-message {
    min-height: 1.2rem;
    margin: 0.75rem 0 0;
    font-size: 0.9rem;
    font-weight: 500;
}

.status-message.error {
    color: var(--danger);
}

.result-container {
    display: grid;
    gap: 0.85rem;
}

.result-model-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem 0.65rem;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    --model-accent: var(--lime);
    --model-glow: rgba(198, 255, 51, 0.12);
}

.result-model-bar .model-dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: var(--model-accent);
    box-shadow: 0 0 10px var(--model-glow);
    flex-shrink: 0;
}

.result-model-bar .model-provider {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--model-accent);
}

.result-model-bar .model-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: #f3f4f6;
}

.result-model-bar .model-caption {
    font-size: 0.76rem;
    color: var(--muted);
    margin-left: auto;
}

.result-card {
    --model-accent: var(--lime);
    --model-glow: rgba(198, 255, 51, 0.1);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
    border: 1px solid var(--border);
    border-left: 3px solid var(--model-accent);
    border-radius: var(--radius-md);
    padding: 1rem;
    animation: fadeIn 0.35s ease;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.result-card-head {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 0.45rem;
}

.result-card strong {
    display: inline-block;
    color: var(--model-accent);
    font-size: 0.82rem;
}

.result-text {
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0 0 0.75rem;
    color: #f3f4f6;
    font-size: 0.94rem;
    line-height: 1.6;
}

.result-card .copy-btn:hover {
    border-color: var(--model-accent);
    color: var(--model-accent);
    background: var(--model-glow);
}

.theme-default,
.theme-default.result-model-bar { --model-accent: #c6ff33; --model-glow: rgba(198, 255, 51, 0.12); }
.theme-deepseek,
.theme-deepseek.result-model-bar { --model-accent: #4d9fff; --model-glow: rgba(77, 159, 255, 0.14); }
.theme-glm,
.theme-glm.result-model-bar { --model-accent: #8b7cf6; --model-glow: rgba(139, 124, 246, 0.14); }
.theme-openai,
.theme-openai.result-model-bar { --model-accent: #10a37f; --model-glow: rgba(16, 163, 127, 0.14); }
.theme-nvidia,
.theme-nvidia.result-model-bar { --model-accent: #76b900; --model-glow: rgba(118, 185, 0, 0.14); }
.theme-google,
.theme-google.result-model-bar { --model-accent: #4285f4; --model-glow: rgba(66, 133, 244, 0.14); }
.theme-qwen,
.theme-qwen.result-model-bar { --model-accent: #a855f7; --model-glow: rgba(168, 85, 247, 0.14); }
.theme-minimax,
.theme-minimax.result-model-bar { --model-accent: #f472b6; --model-glow: rgba(244, 114, 182, 0.14); }
.theme-baidu,
.theme-baidu.result-model-bar { --model-accent: #3385ff; --model-glow: rgba(51, 133, 255, 0.14); }
.theme-poolside,
.theme-poolside.result-model-bar { --model-accent: #2dd4bf; --model-glow: rgba(45, 212, 191, 0.14); }
.theme-liquid,
.theme-liquid.result-model-bar { --model-accent: #22d3ee; --model-glow: rgba(34, 211, 238, 0.14); }
.theme-arcee,
.theme-arcee.result-model-bar { --model-accent: #f59e0b; --model-glow: rgba(245, 158, 11, 0.14); }
.theme-openrouter,
.theme-openrouter.result-model-bar { --model-accent: #fb923c; --model-glow: rgba(251, 146, 60, 0.14); }

.copy-btn {
    width: auto;
    background: transparent;
    border: 1px solid var(--border-strong);
    color: var(--white);
    padding: 0.45rem 0.9rem;
    font-size: 0.84rem;
    font-weight: 600;
}

.copy-btn:hover {
    border-color: rgba(198, 255, 51, 0.45);
    color: var(--lime);
    background: rgba(198, 255, 51, 0.06);
}

.empty-state {
    color: var(--muted);
    text-align: center;
    padding: 2.5rem 1rem;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.02);
}

.mode-label-wrap {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.mode-label-wrap label {
    margin: 0;
}

.mode-remind {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.35rem;
    height: 1.35rem;
    padding: 0 0.28rem;
    border-radius: 6px;
    background: rgba(255, 95, 95, 0.1);
    border: 1px solid rgba(255, 95, 95, 0.45);
    color: var(--danger);
    font-weight: 800;
    font-size: 0.9rem;
    line-height: 1;
    cursor: help;
    flex-shrink: 0;
    user-select: none;
}

.generate-actions {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    margin-top: 0.35rem;
}

.generate-actions-row {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.generate-tip {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.4;
    color: rgba(198, 255, 51, 0.85);
    font-weight: 500;
}

.generate-patience {
    margin: 0;
    font-size: 0.78rem;
    line-height: 1.45;
    color: var(--muted);
}

.donate {
    text-align: left;
    background: linear-gradient(135deg, rgba(18, 18, 20, 0.95) 0%, rgba(31, 31, 36, 0.95) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.35rem;
    margin-top: 1.35rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    position: relative;
}

.donate::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 85% 20%, rgba(198, 255, 51, 0.1) 0%, transparent 45%);
    pointer-events: none;
}

.donate-copy {
    position: relative;
    z-index: 1;
}

.donate-title {
    margin: 0;
    font-size: 1.08rem;
    font-weight: 700;
    color: #f3f4f6;
}

.coffee-link {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: #0a0d05;
    background: linear-gradient(135deg, var(--lime) 0%, var(--lime-soft) 100%);
    border-radius: 999px;
    padding: 0.78rem 1.35rem;
    font-weight: 800;
    font-size: 0.9rem;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 0 0 1px rgba(198, 255, 51, 0.35), 0 10px 26px var(--lime-glow);
}

.coffee-link:hover {
    transform: translateY(-1px);
}

.coffee-link.is-disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: default;
    transform: none;
}

.coffee-icon {
    display: inline-flex;
    width: 18px;
    height: 18px;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    border: 2px solid #0a0d05;
    border-radius: 4px;
}

.seo-content {
    margin-top: 1.35rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.35rem;
    box-shadow: var(--shadow-soft);
}

.seo-content h2 {
    margin: 0 0 0.55rem;
    font-size: 1.12rem;
}

.seo-content p {
    margin: 0 0 1rem;
    color: var(--muted);
    line-height: 1.65;
}

.seo-content p:last-child {
    margin-bottom: 0;
}

.site-footer {
    border-top: 1px solid var(--border);
    color: var(--muted);
    text-align: center;
    padding: 1.35rem 1.25rem 1.75rem;
    background: rgba(5, 5, 5, 0.5);
}

.footer-legal {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.65rem 1.15rem;
    margin-bottom: 0.85rem;
}

.footer-legal a {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
}

.footer-legal a:hover {
    color: var(--lime);
}

.footer-note {
    margin: 0.5rem 0 0;
    font-size: 0.76rem;
    opacity: 0.8;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (min-width: 520px) {
    .generate-actions-row {
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
        gap: 0.75rem 1rem;
    }

    .generate-actions-row #multiplyBtn {
        width: auto;
        flex: 0 0 auto;
        min-width: 210px;
    }

    .generate-tip {
        flex: 1 1 200px;
        min-width: 0;
    }
}

@media (min-width: 768px) {
    .workspace {
        grid-template-columns: 1.05fr 0.95fr;
        align-items: start;
    }

    .result-panel {
        position: sticky;
        top: 88px;
    }
}

@media (max-width: 640px) {
    .header-inner {
        flex-wrap: wrap;
        justify-content: center;
        padding: 0.75rem 1rem;
    }

    .logo-wrapper {
        width: 100%;
        justify-content: center;
    }

    .header-actions {
        width: 100%;
        justify-content: center;
    }

    .header-cta {
        flex: 1 1 auto;
        max-width: 100%;
    }

    .cm-lang-select {
        flex: 0 1 9.5rem;
        min-width: 0;
    }

    .donate {
        flex-direction: column;
        align-items: stretch;
    }

    .coffee-link {
        justify-content: center;
    }

    .panel-header {
        flex-direction: column;
        align-items: stretch;
    }

    .panel-meta {
        align-items: flex-start;
    }

    .limits-info {
        text-align: left;
    }

    .result-model-bar .model-caption {
        margin-left: 0;
        width: 100%;
    }
}
