:root {
    --bg: #f5f7fb;
    --panel: #ffffff;
    --text: #1d2635;
    --muted: #667085;
    --line: #d9e0ea;
    --primary: #0f766e;
    --primary-dark: #0b5f59;
    --danger-bg: #fff1f1;
    --danger: #b42318;
    --shadow: 0 20px 45px rgba(15, 35, 55, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
}

button,
input,
textarea {
    font: inherit;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-card {
    width: min(460px, 100%);
    padding: 34px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.brand-mark {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    margin-bottom: 18px;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    font-weight: 800;
}

.login-card h1,
.topbar h1 {
    margin: 0;
    line-height: 1.2;
}

.login-card h1 {
    font-size: 26px;
}

.login-card p,
.topbar p,
.result-head p {
    margin: 10px 0 0;
    color: var(--muted);
    line-height: 1.7;
}

.login-form {
    margin-top: 28px;
}

label,
legend {
    display: block;
    margin-bottom: 9px;
    font-weight: 700;
}

label span {
    color: var(--muted);
    font-weight: 400;
}

input[type="password"],
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    outline: none;
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

input[type="password"] {
    height: 46px;
    padding: 0 14px;
}

textarea {
    resize: vertical;
    padding: 14px;
    line-height: 1.7;
}

input[type="password"]:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

.login-form button,
.primary-button,
.secondary-button,
.copy-button,
.logout-button {
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.16s ease, background 0.16s ease, opacity 0.16s ease;
}

.login-form button,
.primary-button {
    background: var(--primary);
    color: #fff;
    font-weight: 800;
}

.login-form button {
    width: 100%;
    height: 46px;
    margin-top: 18px;
}

.primary-button,
.secondary-button {
    min-height: 44px;
    padding: 0 20px;
}

.secondary-button {
    background: #e9eef5;
    color: var(--text);
    font-weight: 700;
}

.copy-button,
.logout-button {
    background: #edf7f5;
    color: var(--primary-dark);
    font-weight: 700;
}

.copy-button {
    min-height: 36px;
    padding: 0 12px;
}

.logout-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 14px;
    white-space: nowrap;
}

button:hover,
.logout-button:hover {
    transform: translateY(-1px);
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.7;
    transform: none;
}

.error-message,
.notice {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 8px;
    background: var(--danger-bg);
    color: var(--danger);
    line-height: 1.6;
}

.notice.success {
    background: #ecfdf3;
    color: #027a48;
}

.app-shell {
    width: min(1360px, 100%);
    margin: 0 auto;
    padding: 26px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 22px;
}

.topbar h1 {
    font-size: 30px;
}

.eyebrow {
    margin-bottom: 8px;
    color: var(--primary-dark);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0;
}

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

.panel,
.result-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(15, 35, 55, 0.05);
}

.panel {
    padding: 22px;
}

.field + .field,
.field + .checkbox-group {
    margin-top: 18px;
}

.checkbox-group {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
}

.checkbox-group label {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin: 12px 0 0;
    color: #344054;
    font-weight: 500;
    line-height: 1.5;
}

.checkbox-group input {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--primary);
    flex: 0 0 auto;
}

.actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.result-head {
    margin-bottom: 14px;
}

.result-head h2 {
    margin: 0;
    font-size: 22px;
}

.results {
    display: grid;
    gap: 16px;
}

.empty-state {
    min-height: 360px;
    place-items: center;
    border: 1px dashed var(--line);
    border-radius: 8px;
    background: #f9fbfd;
}

.empty-copy {
    max-width: 360px;
    padding: 24px;
    text-align: center;
    color: var(--muted);
    line-height: 1.8;
}

.result-card {
    padding: 18px;
}

.card-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 12px;
}

.card-toolbar h3 {
    margin: 5px 0 0;
    font-size: 19px;
}

.copy-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.card-body {
    color: #263241;
    line-height: 1.85;
}

.card-body p {
    margin: 0 0 14px;
}

.card-body p:last-child {
    margin-bottom: 0;
}

.title-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding-left: 24px;
}

.title-list li {
    padding: 10px 10px 10px 2px;
    border-bottom: 1px solid #edf1f6;
    line-height: 1.65;
    border-radius: 6px;
    cursor: pointer;
}

.title-list li:last-child {
    border-bottom: 0;
}

.title-list li span {
    margin-right: 12px;
}

.title-list li.recommended span {
    font-weight: 800;
}

.copy-state {
    float: right;
    margin-left: 12px;
    color: var(--muted);
    font-size: 13px;
    font-style: normal;
    white-space: nowrap;
}

.title-list li.copied .copy-state {
    color: var(--primary-dark);
    font-weight: 800;
}

.title-list li.active,
.title-list li:hover,
.title-list li:focus {
    background: #f0faf8;
    outline: none;
}

@media (max-width: 960px) {
    .app-shell {
        padding: 18px;
    }

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

}

@media (max-width: 640px) {
    .login-card {
        padding: 24px;
    }

    .login-card h1,
    .topbar h1 {
        font-size: 23px;
    }

    .topbar,
    .card-toolbar {
        display: grid;
    }

    .copy-actions {
        justify-content: flex-start;
    }

    .panel {
        padding: 16px;
    }

    .actions,
    .primary-button,
    .secondary-button {
        width: 100%;
    }
}
