@font-face { font-family: "MojiSans"; src: local("Segoe UI"), local("Microsoft YaHei"); }
:root { font-family: MojiSans, "PingFang SC", "Microsoft YaHei UI", sans-serif; color: #252b27; background: #e7ebe7; --ink: #252b27; --muted: #68736c; --line: #d6ded8; --paper: #fbfaf6; --panel: #fdfdfb; --green: #2f5b4e; --green-dark: #254c40; --green-soft: #e4eee8; --rust: #b85f48; }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; overflow-x: hidden; background: #e7ebe7; }
button, input, select { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.app-shell { display: flex; flex-direction: column; width: min(1560px, calc(100% - 48px)); margin: 0 auto; min-height: 100vh; }
.topbar { height: 76px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand-mark { display: block; width: 34px; height: 34px; border-radius: 9px; background: transparent; filter: drop-shadow(0 2px 4px rgba(31, 43, 36, .18)); }
.brand strong, .brand small { display: block; line-height: 1.1; }.brand strong { font-size: 15px; }.brand small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.text-button { padding: 8px 0; border: 0; color: var(--muted); background: none; font-size: 13px; }.text-button:hover { color: var(--green); }
.login-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(360px, 420px); gap: clamp(44px, 9vw, 130px); align-items: center; min-height: calc(100vh - 76px); padding: 28px 5vw 100px; }
.login-intro { max-width: 520px; }.eyebrow, .surface-label, .panel-kicker { margin: 0 0 12px; color: var(--rust); font-size: 11px; font-weight: 700; letter-spacing: .16em; }
.login-intro h1 { margin: 0; color: var(--ink); font-family: Georgia, "Songti SC", serif; font-size: clamp(38px, 5vw, 64px); font-weight: 500; line-height: 1.12; letter-spacing: 0; }.login-intro h1 em { color: var(--green); font-style: normal; }
.intro-copy { max-width: 390px; margin: 24px 0 26px; color: var(--muted); font-size: 15px; line-height: 1.8; }.intro-note { display: inline-flex; gap: 9px; align-items: center; color: var(--muted); font-size: 12px; }.note-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--rust); }
.auth-panel, .surface { border: 1px solid var(--line); background: var(--panel); box-shadow: 0 18px 42px rgba(34, 48, 39, .09); }.auth-panel { padding: 34px; border-radius: 12px; }.panel-kicker { color: var(--green); }.auth-panel h2, .surface h2 { margin: 0; font-family: Georgia, "Songti SC", serif; font-weight: 500; letter-spacing: 0; }.auth-panel h2 { font-size: 25px; }.panel-copy, .surface-copy { margin: 10px 0 24px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.field-label { display: block; margin: 16px 0 7px; color: var(--muted); font-size: 12px; font-weight: 600; }.text-input { width: 100%; min-height: 44px; padding: 0 13px; border: 1px solid #cbd6ce; border-radius: 7px; background: #fff; color: var(--ink); font-size: 14px; transition: border-color .18s, box-shadow .18s; }.text-input::placeholder { color: #9aa59e; }.text-input:focus { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }.code-input { letter-spacing: .22em; }
.primary-button, .secondary-button { min-height: 44px; border-radius: 7px; font-weight: 600; transition: transform .16s, background .16s, border-color .16s; }.primary-button { display: flex; align-items: center; justify-content: space-between; width: 100%; margin-top: 16px; padding: 0 14px; border: 1px solid var(--green); background: var(--green); color: #fff; }.primary-button:hover { background: var(--green-dark); }.primary-button:active, .secondary-button:active { transform: translateY(1px); }.secondary-button { padding: 0 18px; border: 1px solid #c7d4ca; background: #fff; color: var(--green); }.secondary-button:hover { border-color: var(--green); background: var(--green-soft); }
.message { min-height: 20px; margin: 14px 0 0; color: var(--rust); font-size: 12px; line-height: 1.5; }.dashboard { padding: 32px 0 80px; }.dashboard-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 26px; }.dashboard-heading h1 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: 32px; font-weight: 500; }.muted { margin: 8px 0 0; color: var(--muted); font-size: 13px; }.status-chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid #c8dbcd; border-radius: 999px; background: var(--green-soft); color: var(--green); font-size: 12px; }.status-chip span { width: 6px; height: 6px; border-radius: 50%; background: #4f8b67; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 360px); gap: 18px; }.surface { padding: 24px; border-radius: 10px; }.surface-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; }.surface h2 { font-size: 23px; }.summary-text { margin: 0; color: var(--muted); font-size: 12px; }.search-form { margin: 20px 0 16px; }.search-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }.filter-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }.filter-grid label { display: grid; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 600; }.filter-grid select { min-height: 40px; padding: 0 32px 0 11px; border: 1px solid #cbd6ce; border-radius: 8px; background-color: #fff; color: var(--ink); font-size: 12px; appearance: none; background-image: linear-gradient(45deg, transparent 50%, #738278 50%), linear-gradient(135deg, #738278 50%, transparent 50%); background-position: calc(100% - 15px) 17px, calc(100% - 10px) 17px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; transition: border-color .18s, box-shadow .18s; }.filter-grid select:hover { border-color: #a9b9ad; }.filter-grid select:focus { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }.users { display: grid; gap: 8px; max-height: 420px; overflow: auto; padding-right: 3px; }.user { padding: 13px 14px; border: 1px solid #e1e7e1; border-radius: 7px; background: #fff; }.user strong, .user small { display: block; }.user strong { color: var(--ink); font-size: 13px; }.user small { margin-top: 6px; color: var(--muted); font-size: 11px; line-height: 1.6; }.generator-surface { align-self: start; padding: 22px; }.generator-form { margin-top: 18px; }.security-note { display: flex; gap: 8px; align-items: center; margin: 24px 0 0; padding-top: 16px; border-top: 1px solid #e4e9e4; color: var(--muted); font-size: 11px; }.security-note span { color: var(--green); font-size: 17px; }.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.admin-dialog-overlay { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; background: rgba(27, 38, 31, .38); backdrop-filter: blur(4px); }.admin-dialog-card { width: min(460px, 100%); padding: 24px; border: 1px solid #d6e0d8; border-radius: 14px; background: var(--panel); box-shadow: 0 24px 64px rgba(21, 34, 26, .22); }.admin-dialog-card h3 { margin: 0 0 10px; color: var(--ink); font-family: Georgia, "Songti SC", serif; font-size: 22px; font-weight: 500; }.admin-dialog-card p { margin: 0 0 14px; color: var(--muted); font-size: 13px; line-height: 1.65; }.admin-dialog-field { display: grid; gap: 7px; margin: 16px 0 0; color: var(--muted); font-size: 12px; font-weight: 600; }.admin-dialog-error { min-height: 18px; margin: 10px 0 0 !important; color: var(--rust) !important; font-size: 12px !important; }.admin-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }.admin-dialog-actions .secondary-button, .admin-dialog-actions .primary-button { width: auto; min-width: 92px; margin: 0; }
[hidden] { display: none !important; }
@media (max-width: 1250px) { .dashboard-grid { grid-template-columns: 1fr; }.users-surface { order: -1; }.generator-surface { order: 0; } }
@media (max-width: 820px) { .app-shell { width: min(100% - 28px, 620px); }.login-layout { grid-template-columns: 1fr; gap: 30px; min-height: auto; padding: 46px 0 70px; }.login-intro h1 { font-size: clamp(38px, 11vw, 54px); }.dashboard-grid { grid-template-columns: 1fr; }.generator-surface { order: -1; } }
@media (max-width: 520px) { .app-shell { width: calc(100% - 24px); }.topbar { height: 66px; }.auth-panel, .surface { padding: 20px; }.dashboard { padding-top: 24px; }.dashboard-heading { align-items: start; gap: 14px; flex-direction: column; }.dashboard-heading h1 { font-size: 28px; }.search-row { grid-template-columns: 1fr; }.secondary-button { width: 100%; }.login-layout { padding-top: 30px; } }

.table-wrap { overflow: auto; max-height: min(70vh, 680px); border: 1px solid #e1e7e1; border-radius: 8px; background: #fff; }
.users-table { width: 100%; min-width: 1180px; border-collapse: collapse; font-size: 12px; }
.users-table th { position: sticky; top: 0; z-index: 1; padding: 11px 13px; border-bottom: 1px solid #dce5de; background: #f4f7f4; color: var(--muted); font-size: 11px; font-weight: 600; text-align: left; white-space: nowrap; }
.users-table td { padding: 13px; border-bottom: 1px solid #edf1ed; color: var(--muted); white-space: nowrap; }
.users-table tr:last-child td { border-bottom: 0; }
.users-table td:first-child { color: var(--ink); font-weight: 600; }
.status-badge { display: inline-flex; align-items: center; min-height: 23px; padding: 0 8px; border-radius: 999px; background: #edf3ef; color: var(--green); font-size: 11px; }
.status-badge.pending { background: #f4f1e8; color: #9a7434; }.device-breakdown { color: #6d7b72; font-size: 11px; }.program-summary { display: grid; gap: 4px; margin-top: 18px; padding: 14px; border: 1px solid #dce8df; border-radius: 10px; background: linear-gradient(135deg, #f2f7f3, #fbfcf9); }.program-summary span { color: var(--muted); font-size: 11px; font-weight: 600; }.program-summary strong { color: var(--green); font-size: 26px; font-weight: 650; }.program-summary small { color: var(--muted); font-size: 11px; line-height: 1.5; }.admin-reminder { display: grid; gap: 6px; margin-top: 12px; padding: 13px 14px; border: 1px solid #e6c99b; border-radius: 10px; background: #fff9ec; color: #7a5523; }.admin-reminder strong { font-size: 12px; }.admin-reminder p { margin: 0; font-size: 11px; line-height: 1.6; }.admin-reminder code { padding: 1px 4px; border-radius: 4px; background: rgba(122, 85, 35, .1); font-size: 10px; }
.table-empty { margin: 0; padding: 32px 16px; color: var(--muted); text-align: center; font-size: 12px; }
.pagination { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; color: var(--muted); font-size: 12px; }
.pagination > div { display: flex; gap: 6px; }
.page-button { padding: 6px 10px; border: 1px solid #cbd8ce; border-radius: 6px; background: #fff; color: var(--green); font-size: 12px; }
.page-button:hover:not(:disabled) { background: var(--green-soft); }
  .page-button:disabled { cursor: not-allowed; opacity: .45; }
  .primary-button:disabled { cursor: not-allowed; opacity: .65; }
.site-footer { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 14px; padding: 18px 12px 24px; color: var(--muted); font-size: 12px; line-height: 1.6; text-align: center; }
.site-footer a { color: inherit; text-decoration: none; }
.site-footer a:hover { color: var(--green); text-decoration: underline; text-underline-offset: 3px; }

/* Admin user directory: compact 8-column table with a readable action column. */
.app-shell {
    width: min(1560px, calc(100% - 48px));
}

.dashboard-grid {
    grid-template-columns: minmax(0, 1fr) 290px;
}

.table-wrap {
    overflow: auto;
    scrollbar-gutter: stable;
}

.users-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
}

.users-table th,
.users-table td {
    padding-right: 9px;
    padding-left: 9px;
}

.users-table th {
    white-space: normal;
    line-height: 1.35;
}

.users-table td {
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.45;
}

.users-table th:nth-child(1),
.users-table td:nth-child(1) { width: 19%; }
.users-table th:nth-child(2),
.users-table td:nth-child(2) { width: 9%; }
.users-table th:nth-child(3),
.users-table td:nth-child(3) { width: 8%; }
.users-table th:nth-child(4),
.users-table td:nth-child(4) { width: 11%; }
.users-table th:nth-child(5),
.users-table td:nth-child(5) { width: 9%; }
.users-table th:nth-child(6),
.users-table td:nth-child(6) { width: 22%; }
.users-table th:nth-child(7),
.users-table td:nth-child(7) { width: 9%; }
.users-table th:nth-child(8),
.users-table td:nth-child(8) { width: 13%; }

.users-table td:first-child {
    color: var(--ink);
    font-weight: 600;
}

.users-table td:nth-child(2) {
    color: var(--rust);
    font-weight: 700;
}

.users-table td:nth-child(7),
.users-table td:nth-child(8) {
    white-space: nowrap;
}

.users-table td:nth-child(8) .page-button {
    white-space: nowrap;
}

@media (max-width: 1320px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .users-surface {
        order: -1;
    }

    .generator-surface {
        order: 0;
    }
}

/* Mobile admin layout: convert the user table into readable cards. */
@media (max-width: 820px) {
    .app-shell {
        width: calc(100% - 24px);
    }

    .topbar {
        height: 64px;
    }

    .brand-mark {
        width: 32px;
        height: 32px;
        border-radius: 8px;
        font-size: 18px;
    }

    .brand strong {
        font-size: 14px;
    }

    .brand small {
        font-size: 10px;
    }

    .text-button {
        min-height: 40px;
        padding: 8px 2px 8px 12px;
    }

    .login-layout {
        display: block;
        min-height: auto;
        padding: 24px 0 54px;
    }

    .login-intro {
        display: none;
    }

    .auth-panel {
        padding: 22px 18px;
        border-radius: 14px;
    }

    .auth-panel h2 {
        font-size: 23px;
    }

    .panel-copy {
        margin-bottom: 20px;
        line-height: 1.65;
    }

    .dashboard {
        padding: 22px 0 54px;
    }

    .dashboard-heading {
        align-items: stretch;
        gap: 12px;
        margin-bottom: 18px;
    }

    .dashboard-heading h1 {
        font-size: 27px;
    }

    .status-chip {
        align-self: flex-start;
        padding: 6px 9px;
    }

    .dashboard-grid {
        gap: 14px;
    }

    .surface {
        padding: 16px;
        border-radius: 12px;
    }

    .users-surface {
        order: -1;
    }

    .generator-surface {
        order: 0;
    }

    .surface-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 7px;
    }

    .surface h2 {
        font-size: 21px;
    }

    .summary-text {
        line-height: 1.5;
    }

    .search-form {
        margin: 16px 0 14px;
    }

    .search-row,
    .filter-grid {
        grid-template-columns: 1fr;
        gap: 9px;
    }

    .filter-grid {
        margin-top: 9px;
    }

    .text-input,
    .primary-button,
    .secondary-button {
        min-height: 46px;
        font-size: 16px;
    }

    .secondary-button {
        width: 100%;
    }

    .table-wrap {
        max-height: none;
        overflow: visible;
        border: 0;
        background: transparent;
    }

    .users-table {
        display: block;
        width: 100%;
        min-width: 0;
        table-layout: auto;
        font-size: 12px;
    }

    .users-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .users-table tbody {
        display: grid;
        gap: 11px;
    }

    .users-table tr {
        display: block;
        overflow: hidden;
        padding: 14px;
        border: 1px solid #dde6df;
        border-radius: 11px;
        background: #fff;
        box-shadow: 0 6px 18px rgba(34, 48, 39, .055);
    }

    .users-table td,
    .users-table td:first-child,
    .users-table td:nth-child(2),
    .users-table td:nth-child(3),
    .users-table td:nth-child(4),
    .users-table td:nth-child(5),
    .users-table td:nth-child(6),
    .users-table td:nth-child(7),
    .users-table td:nth-child(8) {
        display: grid;
        width: auto;
        grid-template-columns: 88px minmax(0, 1fr);
        gap: 12px;
        align-items: center;
        padding: 6px 0;
        border: 0;
        white-space: normal;
        text-align: right;
        overflow-wrap: anywhere;
    }
    .users-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 11px;
        font-weight: 500;
        line-height: 1.45;
        text-align: left;
    }

    .users-table td:first-child {
        display: block;
        padding: 0 0 10px;
        margin-bottom: 2px;
        border-bottom: 1px solid #e7ece8;
        color: var(--ink);
        font-size: 14px;
        line-height: 1.45;
        text-align: left;
    }

    .users-table td:first-child::before {
        display: block;
        margin-bottom: 4px;
    }

    .users-table td:nth-child(2) {
        color: var(--rust);
    }

    .users-table td .status-badge {
        justify-self: end;
    }

    .users-table td:nth-child(8) {
        grid-template-columns: 1fr;
        gap: 6px;
        padding-top: 9px;
        border-top: 1px solid #eef2ee;
        text-align: left;
    }

    .users-table td:nth-child(8)::before {
        text-align: left;
    }

    .users-table td:nth-child(8) .page-button {
        width: 100%;
        min-height: 38px;
    }

    .table-empty {
        padding: 28px 14px;
        border: 1px dashed #d6ded8;
        border-radius: 10px;
        background: rgba(255, 255, 255, .62);
    }

    .pagination {
        position: sticky;
        z-index: 4;
        bottom: 8px;
        align-items: stretch;
        flex-direction: column;
        gap: 9px;
        margin-top: 14px;
        padding: 9px;
        border: 1px solid rgba(207, 218, 210, .92);
        border-radius: 11px;
        background: rgba(253, 253, 251, .96);
        box-shadow: 0 10px 26px rgba(34, 48, 39, .12);
        backdrop-filter: blur(10px);
        text-align: center;
    }

    .pagination > div {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .page-button {
        min-height: 40px;
        font-size: 13px;
    }

    .security-note {
        align-items: flex-start;
        line-height: 1.55;
    }

    .site-footer {
        padding-bottom: 18px;
    }
}

@media (max-width: 380px) {
    .users-table td,
    .users-table td:first-child,
    .users-table td:nth-child(2),
    .users-table td:nth-child(3),
    .users-table td:nth-child(4),
    .users-table td:nth-child(5),
    .users-table td:nth-child(6),
    .users-table td:nth-child(7),
    .users-table td:nth-child(8) {
        grid-template-columns: 78px minmax(0, 1fr);
        gap: 9px;
    }

    .surface {
        padding: 14px;
    }
}

/* ---------- 后台控制台：侧栏导航 + 栏目面板 ---------- */
.console {
    display: grid;
    grid-template-columns: 236px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
    padding: 22px 0 64px;
}

.console-sidebar {
    position: sticky;
    top: 12px;
    display: grid;
    gap: 14px;
    padding: 18px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel);
    box-shadow: 0 12px 30px rgba(34, 48, 39, .06);
}

.console-sidebar-head h1 {
    margin: 0;
    font-family: Georgia, "Songti SC", serif;
    font-size: 21px;
    font-weight: 500;
}

.console-sidebar-head .muted {
    margin: 6px 0 0;
    font-size: 12px;
    overflow-wrap: anywhere;
}

.console-nav {
    display: grid;
    gap: 4px;
}

.console-nav-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    min-height: 40px;
    padding: 0 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    font-size: 13px;
    text-align: left;
    transition: background .16s, color .16s;
}

.console-nav-item:hover {
    background: rgba(47, 91, 78, .07);
    color: var(--green);
}

.console-nav-item.is-active {
    background: var(--green-soft);
    color: var(--green);
    font-weight: 600;
}

.console-nav-meta {
    min-width: 20px;
    padding: 1px 6px;
    border-radius: 999px;
    background: #fff;
    color: var(--green);
    font-size: 11px;
    text-align: center;
}

.console-nav-meta[hidden] {
    display: none;
}

.console-sidebar-note {
    margin: 0;
    color: #97a29b;
    font-size: 11px;
    overflow-wrap: anywhere;
}

.console-main {
    min-width: 0;
}

.console-panel {
    display: grid;
    gap: 16px;
}

.console-panel[hidden] {
    display: none;
}

.console-panel-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.console-panel-head h2 {
    margin: 0;
    font-family: Georgia, "Songti SC", serif;
    font-size: 24px;
    font-weight: 500;
}

.console-panel-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.console-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    gap: 16px;
    align-items: start;
}

.primary-button.inline {
    width: auto;
    margin-top: 0;
    gap: 10px;
    padding: 0 14px;
}

.secondary-button.compact {
    min-height: 38px;
    padding: 0 12px;
    white-space: nowrap;
}

/* ---------- 消息与公告：工具栏 + 表格 ---------- */
.message-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.message-toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.message-toolbar-right .text-input {
    width: 220px;
    min-height: 38px;
}

.messages-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.messages-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 11px 12px;
    border-bottom: 1px solid #dce5de;
    background: #f4f7f4;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    text-align: left;
    white-space: nowrap;
}

.messages-table td {
    padding: 12px;
    border-bottom: 1px solid #edf1ed;
    color: var(--muted);
    vertical-align: top;
}

.messages-table tr:last-child td {
    border-bottom: 0;
}

.message-row.is-editing {
    background: var(--green-soft);
}

/* 列宽：状态与操作不换行，消息列占剩余空间 */
.messages-table th:first-child,
.messages-table td:first-child {
    width: 76px;
    white-space: nowrap;
}

.messages-table .status-badge {
    white-space: nowrap;
}

.messages-table th:nth-child(2),
.messages-table td:nth-child(2) {
    min-width: 200px;
}

.messages-table th:nth-child(3),
.messages-table td:nth-child(3) {
    width: 104px;
}

.messages-table th:nth-child(4),
.messages-table td:nth-child(4) {
    width: 176px;
}

.messages-table th:nth-child(5),
.messages-table td:nth-child(5) {
    width: 138px;
}

.messages-table th:nth-child(6),
.messages-table td:nth-child(6) {
    width: 146px;
}

.messages-table th:nth-child(7),
.messages-table td:nth-child(7) {
    width: 172px;
}

.message-row-actions .page-button {
    padding: 5px 9px;
    font-size: 11px;
}

.message-title-cell {
    display: grid;
    gap: 3px;
}

.message-title-cell strong {
    color: var(--ink);
    font-size: 13px;
    line-height: 1.4;
}

.message-title-cell small {
    color: #8b968f;
    font-size: 11px;
    overflow-wrap: anywhere;
}

.message-time-cell {
    display: grid;
    gap: 3px;
    white-space: nowrap;
}

.message-time-cell small {
    color: #8b968f;
}

.message-stats-cell {
    white-space: nowrap;
}

.message-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.message-row-actions .page-button[data-action="delete"] {
    border-color: #e6cfc7;
    color: var(--rust);
}

.meta-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.meta-chip {
    padding: 3px 8px;
    border-radius: 999px;
    background: #f2f6f2;
    color: var(--muted);
    font-size: 11px;
    white-space: nowrap;
}

/* ---------- 消息编辑抽屉 ---------- */
/* ---------- 消息编辑：整页编辑视图（原来是右侧抽屉） ---------- */
.message-editor {
    display: grid;
    gap: 16px;
}

.message-editor[hidden] {
    display: none;
}

.message-editor-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    padding: 8px 13px;
    border: 1px solid #cbd6ce;
    border-radius: 999px;
    background: #fff;
    color: var(--muted);
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .18s, color .18s, background .18s;
}

.back-button:hover {
    border-color: var(--green);
    background: #f4f9f5;
    color: var(--green);
}

.message-editor-title {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.message-editor-title h2 {
    margin: 0;
    font-size: 19px;
}

.message-inline {
    margin: 0 0 0 auto;
    padding: 7px 11px;
    border-radius: 8px;
    font-size: 12px;
    text-align: right;
}

.message-inline:empty {
    display: none;
}

.message-editor-form {
    display: grid;
    gap: 16px;
    align-content: start;
}

.message-editor-columns {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(330px, 1fr);
    gap: 16px;
    align-items: start;
}

.message-editor-column {
    display: grid;
    gap: 14px;
    align-content: start;
    min-width: 0;
}

.message-editor-foot {
    position: sticky;
    bottom: 12px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid #e1e7e1;
    border-radius: 10px;
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 -6px 18px rgba(34, 48, 39, .07);
    backdrop-filter: blur(6px);
}

.message-editor-foot-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.message-editor-foot button:disabled {
    cursor: not-allowed;
    opacity: .5;
}

/* ---------- Markdown 编辑器 ---------- */
.md-editor {
    display: grid;
    border: 1px solid #cbd6ce;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
}

.md-preview {
    min-height: 300px;
    max-height: 640px;
    padding: 14px 16px;
    overflow: auto;
    color: var(--ink);
    font-size: 13px;
}

.md-preview h3 {
    margin: 0 0 10px;
    font-size: 17px;
}

.md-preview h4 {
    margin: 16px 0 6px;
    font-size: 15px;
}

.md-preview p {
    margin: 0 0 10px;
    line-height: 1.85;
}

.md-preview ul,
.md-preview ol {
    margin: 0 0 12px;
    padding-left: 20px;
    line-height: 1.85;
}

.md-preview li + li {
    margin-top: 4px;
}

.md-preview blockquote {
    margin: 12px 0;
    padding: 6px 0 6px 12px;
    border-left: 3px solid var(--green);
    color: var(--muted);
}

.md-preview code {
    padding: 1px 5px;
    border-radius: 4px;
    background: #f0f4f1;
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: .92em;
}

.md-preview a {
    color: var(--green);
}

.md-preview hr {
    margin: 16px 0;
    border: 0;
    border-top: 1px solid #dde5de;
}

.md-preview-empty {
    color: var(--muted);
}

.md-counter {
    color: #9aa79f;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}

/* ---------- 消息表单细节 ---------- */
.message-form {
    display: grid;
    align-content: start;
}

.message-fields {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 14px;
    border: 1px solid #e6ece7;
    border-radius: 10px;
    background: #fbfcfa;
}

.message-fields legend {
    padding: 0 6px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
}

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

.field {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
}

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

.field-inline {
    display: flex;
    align-items: center;
    gap: 8px;
}

.field-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 500;
}

.field-check input {
    accent-color: var(--green);
}

.field-hint {
    margin: 0;
    color: #8b968f;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.6;
}

.drawer-notice {
    padding: 10px 12px;
    border: 1px solid #e6c99b;
    border-radius: 8px;
    background: #fff9ec;
    color: #7a5523;
}

.drawer-notice[hidden] {
    display: none;
}

.field .text-input {
    min-height: 40px;
    font-size: 13px;
    font-weight: 400;
}

.field .text-input[readonly] {
    background: #f2f5f2;
    color: var(--muted);
}

.field textarea.text-input {
    min-height: 136px;
    padding: 10px 12px;
    line-height: 1.65;
    resize: vertical;
}

.field select.text-input {
    padding-right: 30px;
    background-image: linear-gradient(45deg, transparent 50%, #738278 50%), linear-gradient(135deg, #738278 50%, transparent 50%);
    background-position: calc(100% - 15px) 17px, calc(100% - 10px) 17px;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    appearance: none;
}

.platform-row, .switch-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.platform-chip, .switch-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid #cbd6ce;
    border-radius: 999px;
    background: #fff;
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color .18s, background .18s, color .18s;
}

.platform-chip:hover, .switch-chip:hover {
    border-color: #a9b9ad;
}

.platform-chip:has(input:checked), .switch-chip:has(input:checked) {
    border-color: var(--green);
    background: var(--green-soft);
    color: var(--green);
    font-weight: 600;
}

.platform-chip input, .switch-chip input {
    margin: 0;
    accent-color: var(--green);
}

.message-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.filter-chip {
    padding: 6px 11px;
    border: 1px solid #cbd6ce;
    border-radius: 999px;
    background: #fff;
    color: var(--muted);
    font-size: 12px;
    transition: border-color .18s, background .18s, color .18s;
}

.filter-chip:hover {
    border-color: var(--green);
}

.filter-chip.is-active {
    border-color: var(--green);
    background: var(--green-soft);
    color: var(--green);
    font-weight: 600;
}

.message-preview {
    display: grid;
    gap: 8px;
    padding: 14px;
    border: 1px dashed #c8d6cc;
    border-radius: 10px;
    background: linear-gradient(135deg, #f6faf7, #fdfdfb);
}

.message-preview[hidden] {
    display: none;
}

.message-preview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.message-preview-head strong {
    color: var(--green);
    font-size: 12px;
    letter-spacing: .04em;
}

.message-preview-title {
    margin: 0;
    color: var(--ink);
    font-family: Georgia, "Songti SC", serif;
    font-size: 17px;
    line-height: 1.45;
}

.message-preview-body {
    margin: 0;
    color: #46524a;
    font-size: 12px;
    line-height: 1.8;
    white-space: pre-wrap;
}

.message-preview-cta {
    justify-self: start;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--green);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
}

.message.is-ok {
    color: var(--green);
}

@media (max-width: 1180px) {
    .console-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1080px) {
    .console {
        grid-template-columns: 1fr;
        padding-top: 16px;
    }

    .console-sidebar {
        position: static;
        gap: 10px;
        padding: 14px;
    }

    .console-sidebar-head h1 {
        font-size: 19px;
    }

    .console-nav {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        padding-bottom: 2px;
    }

    .console-nav-item {
        width: auto;
        flex: 0 0 auto;
        padding: 0 14px;
        border: 1px solid #cbd6ce;
        border-radius: 999px;
        background: #fff;
    }

    .console-nav-item.is-active {
        border-color: var(--green);
    }

    .console-sidebar-note {
        display: none;
    }
}

@media (max-width: 820px) {
    .console-panel-head h2 {
        font-size: 21px;
    }

    .console-panel-actions {
        width: 100%;
        justify-content: space-between;
    }

    .message-toolbar-right {
        width: 100%;
    }

    .message-toolbar-right .text-input {
        width: 100%;
    }

    .message-editor-head {
        flex-wrap: wrap;
    }

    .message-inline {
        margin-left: 0;
        text-align: left;
    }

    .message-editor-foot {
        position: static;
    }

    /* 消息表格转为卡片 */
    .messages-table thead {
        display: none;
    }

    .messages-table,
    .messages-table tbody,
    .messages-table tr,
    .messages-table td {
        display: block;
        width: 100%;
    }

    .messages-table tr {
        margin-bottom: 10px;
        padding: 12px 14px;
        border: 1px solid #e1e7e1;
        border-radius: 10px;
        background: #fff;
    }

    .messages-table td {
        display: grid;
        grid-template-columns: 72px minmax(0, 1fr);
        gap: 12px;
        align-items: start;
        padding: 5px 0;
        border: 0;
        white-space: normal;
        text-align: right;
    }

    .messages-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 11px;
        font-weight: 500;
        text-align: left;
    }

    .messages-table td:first-child {
        padding-bottom: 8px;
        border-bottom: 1px solid #e7ece8;
        text-align: left;
    }

    .message-title-cell,
    .message-time-cell {
        justify-items: end;
        text-align: right;
    }

    .message-title-cell strong,
    .message-title-cell small {
        text-align: right;
    }

    .message-row-actions {
        justify-content: flex-end;
    }

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

/* 消息编辑视图：中等宽度（分栏放不下时）改为单列，底栏不再吸底 */
@media (max-width: 1240px) {
    .message-editor-columns {
        grid-template-columns: minmax(0, 1fr);
    }

    .message-editor-foot {
        position: static;
    }
}
/* ---------- 从发版说明生成 ---------- */
.field-label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.release-import-card {
    width: min(720px, calc(100vw - 32px));
    max-height: min(88vh, 920px);
    overflow: auto;
}

.release-import-hint {
    margin: 0 0 14px;
    color: #8b968f;
    font-size: 12px;
    line-height: 1.75;
}

.release-import-hint code {
    padding: 1px 4px;
    border-radius: 4px;
    background: #f0f4f1;
    font-size: 11px;
}

.release-import-preview {
    display: grid;
    gap: 7px;
    margin-top: 14px;
    padding: 12px 14px;
    border: 1px solid #dce8df;
    border-radius: 10px;
    background: #f7fbf8;
}

.release-import-preview[hidden] {
    display: none;
}

.release-import-row {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 10px;
    align-items: baseline;
    font-size: 12px;
}

.release-import-row span {
    color: var(--muted);
    font-weight: 600;
}

.release-import-row strong {
    color: var(--ink);
    font-weight: 500;
    overflow-wrap: anywhere;
}
/* ---------- 正文字段：所见即所得的 Markdown 显示区 ---------- */
.md-surface {
    border: 1px solid #cbd6ce;
    border-radius: 10px;
    background: #fff;
}

.md-preview[contenteditable] {
    min-height: 300px;
    max-height: none;
    overflow: visible;
    padding: 16px 18px;
    outline: none;
    cursor: text;
}

.md-preview[contenteditable]:empty::before {
    content: attr(data-placeholder);
    color: #9aa79f;
    font-size: 12px;
    line-height: 1.9;
}

/* 编辑状态下不跳转，避免误点外链离开后台 */
.md-preview[contenteditable] a {
    pointer-events: none;
}
.md-preview h1 {
    margin: 0 0 12px;
    font-size: 20px;
    line-height: 1.4;
}

.md-preview h2 {
    margin: 18px 0 8px;
    font-size: 18px;
    line-height: 1.45;
}

.md-preview h5,
.md-preview h6 {
    margin: 14px 0 5px;
    font-size: 14px;
}

.md-preview strong {
    font-weight: 700;
}

.md-preview img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.md-preview table {
    width: 100%;
    margin: 0 0 12px;
    border-collapse: collapse;
}

.md-preview th,
.md-preview td {
    padding: 6px 9px;
    border: 1px solid #dde5de;
    text-align: left;
}

.md-preview th {
    background: #f4f8f5;
    font-weight: 600;
}
.list-feedback {
    min-height: 18px;
    margin: 0 0 10px;
}

.list-feedback:empty {
    display: none;
}