/* cms.css —— 后台管理界面样式（简洁、儿童友好、大字号大按钮） */
:root {
    --brand: #e8482b;
    --brand-dark: #c33a20;
    --bg: #f6f4ef;
    --card: #ffffff;
    --ink: #2b2b2b;
    --muted: #7a7568;
    --line: #e3ded4;
    --ok: #3aa657;
    --err: #d1443a;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
    background: var(--bg);
    color: var(--ink);
    font-size: 16px;
    line-height: 1.6;
}
.cms-wrap { min-height: 100vh; display: flex; flex-direction: column; }
.cms-top {
    background: var(--brand);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 22px;
    flex-wrap: wrap;
    gap: 10px;
}
.cms-brand { font-size: 20px; font-weight: 700; }
.cms-nav { display: flex; gap: 6px; flex-wrap: wrap; }
.cms-nav a {
    color: #fff;
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 8px;
    background: rgba(255,255,255,.12);
    font-size: 15px;
}
.cms-nav a:hover { background: rgba(255,255,255,.28); }
.cms-nav a.cms-logout { background: rgba(0,0,0,.18); }
.cms-main { flex: 1; width: 100%; max-width: 860px; margin: 0 auto; padding: 24px 18px; }
.cms-foot { text-align: center; color: var(--muted); padding: 18px; font-size: 13px; }

.cms-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 6px 18px rgba(0,0,0,.05);
    margin-bottom: 22px;
}
.cms-login { max-width: 420px; margin: 6vh auto 0; }
.cms-card h1 { margin: 0 0 16px; font-size: 24px; }

.cms-form { display: flex; flex-direction: column; gap: 16px; }
.cms-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; }
.cms-form input[type=text],
.cms-form input[type=password],
.cms-form input[type=url],
.cms-form textarea,
.cms-form select {
    font-size: 16px;
    padding: 11px 13px;
    border: 2px solid var(--line);
    border-radius: 10px;
    font-family: inherit;
}
.cms-form input:focus, .cms-form textarea:focus, .cms-form select:focus {
    outline: none;
    border-color: var(--brand);
}
.cms-btn {
    align-self: flex-start;
    background: var(--brand);
    color: #fff;
    border: none;
    font-size: 17px;
    font-weight: 700;
    padding: 12px 26px;
    border-radius: 10px;
    cursor: pointer;
}
.cms-btn:hover { background: var(--brand-dark); }
.cms-btn.secondary { background: #eee; color: var(--ink); }

.cms-tip { background: #fff7e6; border: 1px solid #ffe1a8; padding: 12px 14px; border-radius: 10px; color: #8a5a00; }
.cms-error { background: #fdecea; border: 1px solid #f5c2bd; padding: 12px 14px; border-radius: 10px; color: var(--err); font-weight: 600; }
.cms-flash { background: #e9f7ee; border: 1px solid #b7e3c6; padding: 12px 14px; border-radius: 10px; color: var(--ok); font-weight: 600; margin-bottom: 18px; }
.cms-reset-hint { background: #eef3fb; border: 1px solid #c4d6f0; padding: 14px 16px; border-radius: 10px; color: #2c4a78; margin-top: 12px; }
code { background: #f0ede6; padding: 2px 7px; border-radius: 6px; font-family: "SFMono-Regular", Consolas, monospace; }

/* ---- 配置页 ---- */
.cms-head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.cms-head-row h1 { margin: 0; }
.cms-fieldset {
    border: 2px solid var(--line);
    border-radius: 14px;
    padding: 18px 18px 20px;
    margin: 0;
}
.cms-fieldset legend {
    font-weight: 700;
    font-size: 17px;
    color: var(--brand-dark);
    padding: 0 8px;
}
.cms-modules {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
}
.cms-check {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #faf8f3;
    border: 2px solid var(--line);
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    font-weight: 600;
    flex-direction: row;
}
.cms-check input { width: 20px; height: 20px; accent-color: var(--brand); }
.cms-check:hover { border-color: var(--brand); }
.cms-random { margin-top: 14px; font-weight: 500; }
.cms-hint { margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.cms-hint a { color: var(--brand); }
.cms-subblock { margin-top: 14px; padding: 14px; background: #faf8f3; border: 1px dashed var(--line); border-radius: 12px; }
.cms-subblock-title { font-weight: 700; margin-bottom: 10px; font-size: 15px; }
.cms-module-sort { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.cms-module-row { display: flex; align-items: center; gap: 10px; background: #faf8f3; border: 2px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.cms-drag-handle { cursor: grab; color: var(--muted); font-size: 18px; user-select: none; line-height: 1; padding: 0 2px; }
.cms-drag-handle:active { cursor: grabbing; }
.cms-module-row.is-dragging { opacity: .5; border-style: dashed; border-color: var(--brand); }
.cms-module-row.is-drop-target { box-shadow: 0 2px 0 var(--brand); }
.cms-module-check { flex: 1; border: none; background: transparent; padding: 0; }
.cms-module-check:hover { border: none; }
.cms-module-arrows { display: flex; gap: 4px; }
.cms-module-arrows .cms-mini { width: 34px; font-size: 15px; padding: 6px 0; }

.cms-themes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}
.cms-theme-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    border: 2px solid var(--line);
    border-radius: 12px;
    padding: 14px;
    cursor: pointer;
    background: #faf8f3;
    position: relative;
}
.cms-theme-card:hover { border-color: var(--brand); }
.cms-theme-card.is-active { border-color: var(--brand); background: #fff2ee; box-shadow: 0 0 0 3px rgba(232,72,43,.15); }
.cms-theme-card input { position: absolute; top: 12px; right: 12px; width: 18px; height: 18px; accent-color: var(--brand); }
.cms-theme-emoji { font-size: 30px; }
.cms-theme-name { font-weight: 700; font-size: 16px; }
.cms-theme-desc { font-size: 13px; color: var(--muted); }

/* ---- 内容管理页 ---- */
.cms-card h2 { margin: 0 0 14px; font-size: 20px; }
.cms-inline-form { flex-direction: row; flex-wrap: wrap; align-items: center; }
.cms-inline-form input[type=text], .cms-inline-form input[type=url] { flex: 1; min-width: 160px; }
.cms-inline-check { font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.cms-empty { color: var(--muted); font-style: italic; }
.cms-muted { color: var(--muted); font-size: 13px; }

.cms-manage-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.cms-manage-list li {
    background: #faf8f3; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
    display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
}
.cms-manage-list li.is-done span { color: var(--muted); text-decoration: line-through; }
.cms-row-actions { display: flex; gap: 6px; }
.cms-row-actions form { display: inline; }

.cms-mini, .cms-mini-del {
    border: none; border-radius: 8px; padding: 6px 12px; cursor: pointer; font-size: 13px; font-weight: 600;
}
.cms-mini { background: #e7e2d8; color: var(--ink); }
.cms-mini-del { background: #fdecea; color: var(--err); }
.cms-mini-del:hover { background: #f8d7d3; }

.cms-thumb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px,1fr)); gap: 12px; margin-top: 12px; }
.cms-thumb { background: #faf8f3; border: 1px solid var(--line); border-radius: 10px; padding: 8px; text-align: center; }
.cms-thumb img { width: 100%; height: 110px; object-fit: cover; border-radius: 6px; }
.cms-thumb-cap { font-size: 12px; color: var(--muted); margin: 6px 0; min-height: 1em; }
