:root {
    color-scheme: light;
    --bg: #eef4f1;
    --panel: #ffffff;
    --panel-soft: #f8fbfa;
    --panel-muted: #edf6f2;
    --text: #10231d;
    --muted: #5d7169;
    --line: #d4e2dc;
    --line-strong: #bdd4ca;
    --accent: #0b7d59;
    --accent-dark: #075f43;
    --danger: #b42318;
    --success: #167647;
    --warning: #8a5a00;
    --shadow: 0 18px 54px rgba(22, 48, 39, 0.1);
    --shadow-soft: 0 8px 24px rgba(22, 48, 39, 0.06);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100dvh;
    background:
        linear-gradient(180deg, #e7f3ee 0%, #f6faf8 320px, var(--bg) 100%);
    color: var(--text);
    font-family: Arial, "Microsoft YaHei", sans-serif;
}

button,
textarea,
input,
select {
    font: inherit;
}

.app-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 44px 0 52px;
}

.intro {
    max-width: 780px;
    margin-bottom: 26px;
    padding-top: 6px;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 14px;
    font-size: clamp(34px, 5vw, 58px);
    line-height: 1.08;
    letter-spacing: 0;
}

h2 {
    margin-bottom: 0;
    font-size: 24px;
}

h3 {
    margin-bottom: 10px;
    font-size: 16px;
}

.intro-text {
    color: var(--muted);
    font-size: 18px;
    line-height: 1.7;
}

.model-badge {
    display: inline-flex;
    margin: 2px 0 0;
    border: 1px solid rgba(11, 125, 89, 0.22);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.74);
    color: var(--accent-dark);
    box-shadow: var(--shadow-soft);
    padding: 8px 13px;
    font-size: 14px;
    font-weight: 700;
}

.workspace {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 22px;
    align-items: start;
}

.input-panel,
.result-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.input-panel {
    padding: 24px;
}

.input-panel label,
.fields-grid label {
    display: grid;
    gap: 8px;
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
}

textarea,
input,
select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-soft);
    color: var(--text);
    outline: none;
}

textarea {
    min-height: 290px;
    padding: 15px;
    resize: vertical;
    line-height: 1.6;
}

input {
    height: 44px;
    padding: 0 12px;
}

select {
    height: 44px;
    padding: 0 12px;
}

.model-select {
    display: grid;
    gap: 8px;
    margin-top: 14px;
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
}

.fields-grid input {
    cursor: pointer;
}

.fields-grid input[data-copy-disabled="true"] {
    cursor: help;
}

.fields-grid input:hover {
    border-color: var(--accent);
    background: #f2faf6;
}

.fields-grid input[data-copy-disabled="true"]:hover {
    border-color: var(--line);
    background: var(--panel-soft);
}

.fields-grid input.copied {
    border-color: var(--success);
    background: #e9f8ef;
    box-shadow: 0 0 0 3px rgba(22, 118, 71, 0.14);
}

.confidence-field {
    grid-column: 1 / -1;
}

.field-help {
    border-left: 3px solid rgba(15, 122, 90, 0.28);
    color: var(--muted);
    padding-left: 10px;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.7;
}

textarea:focus,
input:focus,
select:focus {
    border-color: var(--accent);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(11, 125, 89, 0.14);
}

.form-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin-top: 14px;
}

.paste-button {
    margin-left: auto;
    white-space: nowrap;
}

#charCount,
.hint {
    color: var(--muted);
    font-size: 13px;
}

.hint {
    margin: 14px 0 0;
}

button {
    min-height: 44px;
    border: 0;
    border-radius: 8px;
    padding: 0 18px;
    background: var(--accent);
    color: #ffffff;
    cursor: pointer;
    font-weight: 700;
    box-shadow: 0 10px 22px rgba(11, 125, 89, 0.18);
}

button:hover {
    background: var(--accent-dark);
}

button:active {
    transform: translateY(1px);
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.secondary-button {
    border: 1px solid var(--line);
    background: #ffffff;
    color: var(--text);
    box-shadow: none;
}

.secondary-button:hover {
    background: var(--panel-muted);
    border-color: var(--line-strong);
}

.result-panel {
    padding: 24px;
}

.result-heading {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.status {
    margin-bottom: 16px;
    border: 1px solid rgba(11, 125, 89, 0.12);
    border-radius: 8px;
    background: var(--panel-muted);
    color: var(--muted);
    padding: 12px 14px;
    line-height: 1.5;
}

.status-error {
    background: #fff1f0;
    color: var(--danger);
}

.status-success {
    background: #e9f8ef;
    color: var(--success);
}

.status-loading {
    background: #fff8e1;
    color: var(--warning);
}

.fields-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.warnings {
    margin-top: 18px;
    border: 1px solid #f1d48a;
    border-radius: 8px;
    background: #fff9e8;
    padding: 14px 16px;
    color: var(--warning);
}

.warnings ul {
    margin: 0;
    padding-left: 18px;
}

.copy-toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 20;
    max-width: min(320px, calc(100% - 48px));
    border-radius: 10px;
    background: #10211b;
    color: #ffffff;
    padding: 12px 14px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity 160ms ease, transform 160ms ease;
}

.copy-toast.show {
    opacity: 1;
    transform: translateY(0);
}

.copy-toast-success {
    background: var(--success);
}

.copy-toast-error {
    background: var(--danger);
}

.site-footer {
    width: min(1180px, calc(100% - 32px));
    margin: -26px auto 36px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
    text-align: center;
}

.site-footer a {
    color: var(--accent-dark);
    font-weight: 700;
    text-decoration: none;
}

.site-footer a:hover {
    text-decoration: underline;
}

@media (max-width: 860px) {
    .app-shell {
        width: min(100% - 24px, 720px);
        padding: 28px 0;
    }

    .workspace,
    .fields-grid {
        grid-template-columns: 1fr;
    }

    .result-heading,
    .form-actions {
        align-items: stretch;
        flex-direction: column;
    }

    button {
        width: 100%;
    }

    .paste-button {
        margin-left: 0;
    }

    .copy-toast {
        right: 12px;
        bottom: 12px;
        max-width: calc(100% - 24px);
    }

    .site-footer {
        width: min(100% - 24px, 720px);
        margin: -8px auto 28px;
    }
}
