:root {
    --bg: #f5f6f2;
    --surface: #ffffff;
    --surface-soft: #eef2ec;
    --ink: #1f2421;
    --muted: #66706a;
    --line: #d8ddd6;
    --accent: #237a57;
    --accent-strong: #155f44;
    --warn: #9b5b14;
    --warn-bg: #fff4dc;
    --ok: #1c7c45;
    --shadow: 0 10px 24px rgba(31, 36, 33, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-width: 320px;
    color: var(--ink);
    background: var(--bg);
    font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

a {
    color: var(--accent-strong);
    text-decoration: none;
}

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

h1 {
    margin-bottom: 0;
    font-size: 28px;
    line-height: 1.25;
}

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

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

.app-shell {
    width: min(1320px, calc(100% - 32px));
    margin: 24px auto 40px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

.topbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.eyebrow {
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 0;
}

.chip,
.status {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--muted);
    font-size: 13px;
    white-space: nowrap;
}

.chip.success,
.status-published {
    border-color: rgba(28, 124, 69, 0.22);
    background: rgba(28, 124, 69, 0.08);
    color: var(--ok);
}

.chip.warn,
.status-publish_blocked {
    border-color: rgba(155, 91, 20, 0.24);
    background: var(--warn-bg);
    color: var(--warn);
}

.workbench {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
    gap: 16px;
    margin-bottom: 16px;
}

.panel {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.section-head,
.detail-head,
.action-row,
.schedule-form {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

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

.section-head span,
.muted,
.empty {
    color: var(--muted);
    font-size: 14px;
}

.form-grid,
.editor-grid {
    display: grid;
    gap: 12px;
}

label span {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 13px;
}

input,
textarea,
button {
    width: 100%;
    border-radius: 8px;
    font: inherit;
}

input,
textarea {
    padding: 10px 11px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
}

input:focus,
textarea:focus {
    border-color: var(--accent);
    outline: 3px solid rgba(35, 122, 87, 0.12);
}

textarea {
    resize: vertical;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 9px 14px;
    border: 1px solid transparent;
    cursor: pointer;
    font-weight: 600;
}

.button.primary {
    background: var(--accent);
    color: white;
}

.button.primary:hover {
    background: var(--accent-strong);
}

.button.secondary {
    background: #26352f;
    color: white;
}

.button.ghost {
    border-color: var(--line);
    background: var(--surface);
    color: var(--ink);
}

.draft-list {
    display: grid;
    gap: 8px;
    max-height: 390px;
    overflow: auto;
}

.draft-item {
    display: grid;
    gap: 4px;
    padding: 11px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: inherit;
}

.draft-item strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.draft-item span {
    color: var(--muted);
    font-size: 13px;
}

.draft-item.active {
    border-color: rgba(35, 122, 87, 0.35);
    background: var(--surface-soft);
}

.detail-panel {
    min-height: 300px;
}

.visual-panel {
    margin-bottom: 16px;
    background:
        radial-gradient(circle at top left, rgba(35, 122, 87, 0.08), transparent 40%),
        linear-gradient(180deg, #fefefe 0%, #f6f8f5 100%);
}

.inline-form {
    margin-bottom: 16px;
}

.visual-copy {
    margin-bottom: 12px;
}

.visual-copy p {
    margin-bottom: 8px;
}

.visual-image-grid {
    margin-bottom: 12px;
}

.link-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.detail-head {
    align-items: flex-start;
    margin-bottom: 14px;
}

.notice {
    margin-bottom: 14px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 14px;
}

.notice.warn {
    border: 1px solid rgba(155, 91, 20, 0.24);
    background: var(--warn-bg);
    color: var(--warn);
}

.action-row {
    justify-content: flex-start;
    margin: 14px 0 16px;
    flex-wrap: wrap;
}

.schedule-form {
    justify-content: flex-start;
}

.schedule-form input {
    width: 220px;
}

.asset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.asset-card {
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfa;
}

.asset-card img,
.asset-card video {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 6px;
    background: var(--surface-soft);
}

.asset-card p,
.log-box p {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 13px;
}

.log-box {
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.empty-state {
    padding: 36px 0;
    text-align: center;
}

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

.auth-panel {
    width: min(420px, 100%);
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

@media (max-width: 900px) {
    .app-shell {
        width: min(100% - 20px, 1320px);
        margin-top: 14px;
    }

    .topbar,
    .workbench,
    .detail-head,
    .action-row,
    .schedule-form {
        display: grid;
        grid-template-columns: 1fr;
    }

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

    .schedule-form input {
        width: 100%;
    }
}
