:root {
    --bg: #f4efe8;
    --panel: #fffaf2;
    --panel-strong: #ffffff;
    --line: #dccfbe;
    --text: #1f1b16;
    --muted: #6f6458;
    --brand: #135d66;
    --brand-strong: #0f454b;
    --accent: #d97706;
    --danger: #b42318;
    --success: #13795b;
    --shadow: 0 14px 32px rgba(38, 28, 12, 0.08);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(217, 119, 6, 0.12), transparent 28%),
        radial-gradient(circle at top right, rgba(19, 93, 102, 0.1), transparent 24%),
        var(--bg);
    color: var(--text);
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

.shell {
    max-width: 1320px;
    margin: 0 auto;
    padding: 32px 20px 56px;
}

.shell--detail {
    max-width: 1480px;
}

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

.topbar h1 {
    margin: 6px 0 8px;
    font-size: 34px;
    line-height: 1.1;
}

.eyebrow {
    display: inline-flex;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(19, 93, 102, 0.08);
    color: var(--brand-strong);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.muted {
    color: var(--muted);
}

.grid {
    display: grid;
    gap: 20px;
}

.cards-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.card {
    background: rgba(255, 250, 242, 0.88);
    border: 1px solid rgba(220, 207, 190, 0.8);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
    backdrop-filter: blur(14px);
}

.card h2,
.card h3 {
    margin-top: 0;
}

.task-card__meta,
.section-head,
.hero-card__head,
.detail-layout,
.two-col,
.actions {
    display: flex;
    gap: 14px;
}

.task-card__meta,
.section-head,
.hero-card__head {
    justify-content: space-between;
    align-items: center;
}

.detail-layout {
    align-items: flex-start;
}

.detail-main {
    flex: 1 1 auto;
    min-width: 0;
}

.detail-side {
    width: 360px;
    flex: 0 0 360px;
}

.sticky-card {
    position: sticky;
    top: 20px;
}

.progress {
    width: 100%;
    height: 10px;
    background: rgba(19, 93, 102, 0.08);
    border-radius: 999px;
    overflow: hidden;
}

.progress--large {
    height: 14px;
}

.progress__bar {
    height: 100%;
    background: linear-gradient(90deg, var(--brand), #1f8a70);
    border-radius: inherit;
    transition: width 0.3s ease;
}

.button,
button.button {
    appearance: none;
    border: 1px solid var(--line);
    background: var(--panel-strong);
    color: var(--text);
    border-radius: 999px;
    padding: 12px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.button:hover,
button.button:hover {
    transform: translateY(-1px);
    border-color: var(--brand);
}

.button.primary {
    background: var(--brand);
    color: #fff;
    border-color: var(--brand);
}

.button.secondary {
    background: rgba(19, 93, 102, 0.08);
    border-color: rgba(19, 93, 102, 0.2);
    color: var(--brand-strong);
}

.button.danger {
    background: rgba(180, 35, 24, 0.1);
    border-color: rgba(180, 35, 24, 0.18);
    color: var(--danger);
}

.actions {
    flex-wrap: wrap;
    margin-top: 16px;
}

.actions.stack {
    flex-direction: column;
}

.field {
    margin-bottom: 18px;
}

.field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
}

textarea,
input[type="text"],
select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px 16px;
    font: inherit;
    color: var(--text);
    background: rgba(255, 255, 255, 0.9);
    resize: vertical;
}

textarea:focus,
input[type="text"]:focus,
select:focus {
    outline: 2px solid rgba(19, 93, 102, 0.18);
    border-color: var(--brand);
}

.form-layout {
    grid-template-columns: minmax(280px, 420px) 1fr;
    align-items: start;
}

.form-span-2 {
    grid-column: 1 / -1;
}

.dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 220px;
    border: 2px dashed rgba(19, 93, 102, 0.28);
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(19, 93, 102, 0.04), rgba(255, 255, 255, 0.7));
    text-align: center;
    padding: 24px;
    cursor: pointer;
}

.hidden-input {
    display: none;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.preview-grid img {
    border-radius: 16px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border: 1px solid var(--line);
}

.preview-grid--small {
    grid-template-columns: repeat(auto-fit, minmax(90px, 120px));
}

.flash {
    margin-bottom: 20px;
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(19, 121, 91, 0.1);
    border: 1px solid rgba(19, 121, 91, 0.18);
    color: var(--success);
    font-weight: 600;
}

.error-text {
    color: var(--danger);
    font-size: 14px;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.badge--queued,
.badge--running {
    background: rgba(19, 93, 102, 0.1);
    color: var(--brand-strong);
}

.badge--waiting,
.badge--paused {
    background: rgba(217, 119, 6, 0.12);
    color: var(--accent);
}

.badge--completed {
    background: rgba(19, 121, 91, 0.12);
    color: var(--success);
}

.badge--failed {
    background: rgba(180, 35, 24, 0.12);
    color: var(--danger);
}

.hero-card__progress {
    font-size: 36px;
}

.stepper {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.step {
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(111, 100, 88, 0.1);
    color: var(--muted);
    font-weight: 600;
}

.step.active {
    background: rgba(19, 93, 102, 0.12);
    color: var(--brand-strong);
}

.editor {
    min-height: 280px;
}

.draft-grid,
.review-grid {
    display: grid;
    gap: 14px;
}

.draft-card,
.review-card {
    border: 1px solid rgba(220, 207, 190, 0.9);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.65);
}

.draft-card summary {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    cursor: pointer;
}

.draft-card summary::-webkit-details-marker {
    display: none;
}

.draft-body,
.review-card {
    padding: 0 18px 18px;
}

.score-pill {
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(19, 93, 102, 0.08);
    color: var(--brand-strong);
    font-size: 12px;
    font-weight: 700;
}

.bullet-list {
    padding-left: 18px;
}

.bullet-list.compact li {
    margin-bottom: 4px;
}

.rewrite-form {
    margin-top: 22px;
    padding-top: 22px;
    border-top: 1px dashed var(--line);
}

.log-list {
    display: grid;
    gap: 12px;
    max-height: 70vh;
    overflow: auto;
}

.log-item {
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(220, 207, 190, 0.7);
}

.log-item__head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.empty-state,
.empty-inline {
    text-align: center;
    color: var(--muted);
}

.check-stack {
    display: grid;
    gap: 10px;
    align-content: end;
}

.check {
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.three-col {
    display: grid;
    grid-template-columns: 1fr 1fr minmax(220px, 0.8fr);
    gap: 16px;
}

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

.inline-note {
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(19, 93, 102, 0.06);
    border: 1px dashed rgba(19, 93, 102, 0.2);
}

.inline-note p {
    margin-bottom: 0;
}

.sidebar-meta p {
    margin: 0 0 12px;
}

@media (max-width: 1080px) {
    .detail-layout,
    .form-layout {
        grid-template-columns: 1fr;
        display: grid;
    }

    .detail-side {
        width: auto;
    }

    .sticky-card {
        position: static;
    }
}

@media (max-width: 720px) {
    .shell {
        padding: 20px 14px 36px;
    }

    .topbar,
    .hero-card__head,
    .section-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .two-col,
    .three-col,
    .five-grid {
        grid-template-columns: 1fr;
    }
}
