:root {
    --bg: #f4efe6;
    --card: #fffdf8;
    --text: #1f2937;
    --muted: #6b7280;
    --line: #ddd2c1;
    --primary: #1e4d72;
    --primary-strong: #12364f;
    --secondary: #c26d3c;
    --danger: #b94141;
    --success: #2f7f5f;
    --warning: #a97700;
}

.client-page {
    min-height: 100vh;
    margin: 0;
    background: #f3f6fb;
    color: #1f2f46;
}

.client-page .page-surface,
.client-page .topbar {
    display: none;
}

.client-shell {
    width: min(100%, 1240px);
    min-height: 100vh;
    margin: 0 auto;
    padding: 56px 24px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.client-shell.result-mode {
    align-items: flex-start;
}

.client-card {
    width: 100%;
    background: #ffffff;
    border: 1px solid #e7edf6;
    border-radius: 26px;
    box-shadow: 0 18px 48px rgba(37, 63, 102, 0.08);
    padding: 40px 44px 38px;
}

.client-order-card {
    max-width: 720px;
}

.client-result-card {
    max-width: 1080px;
}

.client-card-head {
    text-align: center;
    margin-bottom: 34px;
}

.client-card-head h1 {
    margin: 0 0 10px;
    font-size: 58px;
    line-height: 1.04;
    color: #2c3440;
    letter-spacing: -0.04em;
    font-weight: 500;
}

.client-card-head p {
    margin: 0;
    font-size: 18px;
    color: #7c8da5;
}

.result-head h1 {
    color: #2371cf;
    font-size: 34px;
    font-weight: 700;
}

.client-form {
    display: grid;
    gap: 22px;
}

.client-form label {
    display: grid;
    gap: 10px;
}

.client-form span {
    font-size: 16px;
    font-weight: 700;
    color: #24364e;
}

.client-form input,
.client-form textarea {
    width: 100%;
    border: 1px solid #d5deea;
    border-radius: 14px;
    background: #fff;
    color: #24364e;
    font-size: 18px;
    padding: 16px 18px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.client-form textarea {
    min-height: 140px;
    resize: vertical;
}

.client-form input:focus,
.client-form textarea:focus {
    border-color: #4c86d8;
    box-shadow: 0 0 0 4px rgba(76, 134, 216, 0.14);
}

.client-submit-btn {
    width: 100%;
    justify-content: center;
    min-height: 58px;
    border-radius: 14px;
    font-size: 18px;
    font-weight: 700;
    margin-top: 4px;
}

.client-result-list {
    display: grid;
    border-top: 1px solid #e5ebf3;
    border-bottom: 1px solid #e5ebf3;
}

.client-result-list > div {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 18px;
    align-items: start;
    padding: 14px 8px;
    border-top: 1px solid #e9edf4;
}

.client-result-list > div:first-child {
    border-top: 0;
}

.client-result-list span {
    font-size: 15px;
    font-weight: 700;
    color: #283a53;
}

.client-result-list strong {
    font-size: 14px;
    line-height: 1.55;
    color: #334455;
    font-weight: 600;
}

.client-result-list strong.multiline {
    white-space: pre-wrap;
    word-break: break-word;
}

.single-line-label {
    white-space: nowrap;
}

.pending-account-text {
    color: #ff8a00 !important;
    font-style: italic;
    font-weight: 500 !important;
}

.cancelled-account-text {
    color: #d94b4b !important;
    font-style: italic;
    font-weight: 500 !important;
}

.account-info-text {
    display: block;
    width: 100%;
    overflow-wrap: anywhere;
    word-break: normal;
}

.client-result-note {
    margin: 22px 0 18px;
    padding: 16px 18px;
    border-left: 5px solid #2472d0;
    border-radius: 14px;
    background: #f4f8ff;
    color: #40536d;
    font-size: 15px;
    line-height: 1.6;
}

@media (max-width: 900px) {
    .client-shell {
        padding: 20px 14px 28px;
        align-items: flex-start;
    }

    .client-card {
        padding: 26px 20px 24px;
        border-radius: 22px;
    }

    .client-card-head h1 {
        font-size: 40px;
    }

    .result-head h1 {
        font-size: 34px;
    }

    .client-result-list > div {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 16px 6px;
    }
}

.client-shell.result-mode {
    width: min(100%, 1120px);
    padding: 28px 18px;
}

.client-shell.result-mode .client-card {
    padding: 26px 32px 24px;
    border-radius: 22px;
}

.client-shell.result-mode .client-card-head {
    margin-bottom: 22px;
}

.client-shell.result-mode {
    min-height: auto;
    width: min(100%, 900px);
    padding: 28px 18px 60px;
}

.client-shell.result-mode .client-result-card {
    max-width: 860px;
}

.client-shell.result-mode .client-card {
    padding: 26px 24px 28px;
    border-radius: 18px;
}

.client-shell.result-mode .result-head h1 {
    font-size: 28px;
}

.client-shell.result-mode .client-result-list > div {
    grid-template-columns: 130px 1fr;
    gap: 40px;
    padding: 14px 2px;
}

.client-shell.result-mode .client-result-list span {
    font-size: 16px;
    font-weight: 700;
}

.client-shell.result-mode .client-result-list strong {
    font-size: 16px;
    line-height: 1.55;
}

.client-shell.result-mode .client-result-note {
    margin: 22px 0 18px;
    padding: 14px 16px;
    font-size: 16px;
    line-height: 1.65;
}

.client-shell.result-mode .client-submit-btn {
    min-height: 56px;
    font-size: 16px;
}

.client-order-card .client-card-head h1 {
    color: #2371cf;
    font-size: 34px;
    font-weight: 700;
}

.client-note-link {
    border: none;
    padding: 0;
    background: transparent;
    color: #2371cf;
    font: inherit;
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
}

.client-note-link:hover {
    color: #195fb0;
}

.client-image-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(18, 28, 38, 0.38);
    backdrop-filter: blur(4px);
}

.client-image-modal-overlay[hidden] {
    display: none !important;
}

.client-image-modal {
    width: min(980px, 94vw);
    max-height: 92vh;
    border-radius: 22px;
    background: #fffdf8;
    box-shadow: 0 24px 60px rgba(22, 30, 40, 0.24);
    overflow: hidden;
}

.client-image-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 22px;
    border-bottom: 1px solid #eee4d7;
}

.client-image-modal-head h3 {
    margin: 0;
    font-size: 22px;
    color: #2371cf;
}

.client-image-modal-body {
    max-height: calc(92vh - 74px);
    overflow: auto;
    padding: 18px;
    background: #f4f8ff;
}

.client-image-modal-img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(37, 63, 102, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--text);
    font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background:
        radial-gradient(circle at top right, rgba(194, 109, 60, 0.14), transparent 28%),
        linear-gradient(180deg, #f2eadf 0%, #f7f4ee 100%);
}

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

.page-surface {
    min-height: 100vh;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 18px 28px;
    background: rgba(15, 32, 39, 0.92);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(10px);
}

.brand {
    font-size: 20px;
    font-weight: 700;
}

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

.nav a {
    padding: 8px 12px;
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.8);
}

.nav a.active,
.nav a:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

.container {
    width: min(96vw, 1880px);
    max-width: none;
    margin: 0 auto;
    padding: 28px 18px;
}

.container.narrow {
    width: min(92vw, 720px);
    max-width: none;
}

.hero {
    display: flex;
    justify-content: space-between;
    align-items: end;
    margin-bottom: 20px;
    padding: 28px;
    border: 1px solid rgba(30, 77, 114, 0.12);
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(30, 77, 114, 0.08), rgba(255, 255, 255, 0.9));
}

.hero.compact {
    padding: 20px 24px;
}

.hero.compact > div {
    width: 100%;
    text-align: center;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--secondary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 12px;
}

h1, h2 {
    margin-top: 0;
}

.subtext {
    color: var(--muted);
    line-height: 1.6;
}

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

.grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 22px;
    box-shadow: 0 12px 30px rgba(40, 28, 10, 0.05);
    margin-bottom: 20px;
}

.grid.two > .card > h2 {
    text-align: center;
}

.inner-card {
    margin-bottom: 0;
}

.form,
.toolbar,
.manual-form,
.template-grid {
    display: grid;
    gap: 14px;
}

.toolbar {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    align-items: end;
}

.toolbar.vertical {
    grid-template-columns: 1fr;
}

.order-filter-form {
    display: grid;
    gap: 18px;
}

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

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

.key-generate-form {
    grid-template-columns: 1.4fr 0.8fr 1fr 1fr auto;
    align-items: end;
}

.key-filter-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr auto;
    gap: 14px;
}

.stock-summary-table th,
.stock-summary-table td,
.stock-detail-table th,
.stock-detail-table td {
    text-align: center !important;
    vertical-align: middle;
}

.stock-summary-type {
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left !important;
}

.stock-summary-actions {
    justify-content: center;
}

.stock-selected-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 18px;
    color: var(--muted);
}

.stock-detail-filter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1.2fr auto;
    gap: 14px;
}

.stock-detail-filter-grid-wide {
    grid-template-columns: 1fr 1fr 1.2fr auto;
}

.stock-manage-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    align-items: end;
    margin-bottom: 18px;
}

.stock-manage-filter-form,
.stock-manage-export-form {
    margin: 0;
}

.stock-manage-filter-form {
    flex: 1 1 980px;
}

.stock-manage-export-form {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    flex-wrap: nowrap;
}

.stock-manage-table th:nth-child(3),
.stock-manage-table td:nth-child(3),
.stock-manage-table th:nth-child(4),
.stock-manage-table td:nth-child(4),
.stock-manage-table th:nth-child(5),
.stock-manage-table td:nth-child(5),
.stock-manage-table th:nth-child(6),
.stock-manage-table td:nth-child(6),
.stock-manage-table th:nth-child(7),
.stock-manage-table td:nth-child(7) {
    text-align: center !important;
}

.stock-summary-filter-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr auto;
    gap: 14px;
    margin-bottom: 18px;
}

.stock-manage-table th,
.stock-manage-table td {
    text-align: center !important;
    vertical-align: middle;
}

.stock-manage-table {
    table-layout: fixed;
    width: 100%;
}

.stock-manage-col-id {
    width: 7%;
}

.stock-manage-col-account {
    width: 47%;
}

.stock-manage-col-account-wide {
    width: 40%;
}

.stock-manage-col-status {
    width: 9%;
}

.stock-manage-col-order {
    width: 13%;
}

.stock-manage-col-time {
    width: 12%;
}

.stock-manage-col-action {
    width: 14%;
}

.stock-inline-form {
    display: grid;
    gap: 10px;
    width: 100%;
}

.stock-inline-form textarea {
    width: 100%;
    margin: 0 auto;
}

.stock-account-cell .stock-inline-form {
    justify-items: center;
}

.stock-manage-actions {
    justify-content: center;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.mail-template-grid {
    gap: 16px;
}

.mail-template-card {
    padding: 14px 16px;
}

.mail-template-card textarea {
    min-height: 70px;
}

.mail-template-actions {
    display: grid;
    grid-template-columns: minmax(180px, 240px) auto;
    gap: 12px;
    align-items: end;
}

.mail-template-actions .btn {
    align-self: end;
    white-space: nowrap;
}

.mail-template-row {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 18px;
    align-items: center;
    margin-bottom: 12px;
}

.mail-template-row-top {
    align-items: start;
}

.mail-template-card .mail-template-row:last-of-type {
    margin-bottom: 0;
}

.mail-template-label {
    color: var(--muted);
    font-size: 14px;
    white-space: nowrap;
    padding-left: 6px;
}

.mail-template-inline-actions {
    display: grid;
    grid-template-columns: minmax(140px, 200px) auto;
    gap: 18px;
    align-items: center;
}

.type-form {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: end;
}

.type-form.one-line {
    grid-template-columns: 1.5fr 1.1fr 0.8fr 0.8fr 1.5fr auto;
    gap: 12px;
}

.type-form-span-2 {
    grid-column: span 2;
}

.type-form.one-line label {
    margin: 0;
}

.type-form.one-line .btn {
    align-self: end;
    min-width: 120px;
    white-space: nowrap;
}

.order-filter-time-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.compact-filter-btn {
    min-width: 0;
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.batch-form {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.stock-export-form {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.checkbox-inline {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
}

.checkbox-inline input {
    width: auto;
    margin: 0;
}

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

label {
    display: grid;
    gap: 8px;
    font-size: 14px;
    color: var(--muted);
}

input,
select,
textarea,
button {
    font: inherit;
}

input,
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text);
}

textarea {
    resize: vertical;
}

.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 14px;
    border: none;
    cursor: pointer;
    background: var(--primary);
    color: #fff;
}

.btn.primary {
    background: var(--primary);
}

.btn.secondary {
    background: var(--secondary);
}

.btn.ghost {
    background: #efe7db;
    color: var(--text);
}

.btn.small {
    padding: 8px 12px;
    font-size: 13px;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    border-bottom: 1px solid #eee4d7;
    padding: 12px 10px;
    text-align: left;
    vertical-align: top;
}

.table th {
    color: var(--muted);
    font-weight: 600;
}

.dashboard-table th,
.dashboard-table td {
    vertical-align: middle;
}

.dashboard-product-head {
    text-align: center !important;
}

.dashboard-product-cell {
    max-width: 520px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left !important;
}

.dashboard-center {
    text-align: center !important;
}

.order-table th,
.order-table td {
    text-align: center;
    vertical-align: middle;
    font-size: 14px;
    padding: 10px 8px;
}

.order-table th {
    white-space: nowrap;
}

.order-table .multiline {
    white-space: pre-wrap;
    word-break: break-word;
}

.order-table .operator-cell,
.order-table .status-cell,
.order-table .time-cell {
    white-space: nowrap;
}

.order-table .single-line-cell {
    white-space: nowrap;
}

.order-table .narrow-col {
    width: 110px;
}

.order-table .type-col {
    width: 180px;
}

.order-table .type-cell {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.order-table .time-sort-col {
    white-space: nowrap;
}

.order-table .operator-col,
.order-table .status-col,
.order-table .action-col,
.order-table .operator-cell,
.order-table .status-cell {
    white-space: nowrap;
}

.inline-actions,
.action-stack {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    flex-wrap: wrap;
}

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

.order-action-stack {
    min-width: 0;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 8px;
}

.order-action-stack form {
    margin: 0;
}

.deliver-menu {
    position: relative;
}

.deliver-panel {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    min-width: 170px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--card);
    box-shadow: 0 14px 32px rgba(22, 30, 40, 0.12);
    z-index: 5;
}

.detail-preview {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-wrap: nowrap;
    max-width: 180px;
    margin: 0 auto;
    font-size: 13px;
}

.detail-preview-text {
    max-width: 82px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.detail-preview .btn.small {
    padding: 6px 9px;
    font-size: 12px;
    white-space: nowrap;
}

.sort-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
}

.sort-indicator {
    color: var(--muted);
    font-size: 14px;
    line-height: 1;
}

.account-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(18, 28, 38, 0.22);
    backdrop-filter: blur(3px);
}

.account-modal-overlay[hidden] {
    display: none !important;
}

.account-modal {
    width: min(560px, 92vw);
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--card);
    box-shadow: 0 20px 50px rgba(22, 30, 40, 0.18);
}

.account-modal-head,
.account-modal-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 22px;
}

.account-modal-head {
    border-bottom: 1px solid #eee4d7;
}

.account-modal-head h3 {
    margin: 0;
    font-size: 22px;
}

.account-modal-close {
    border: none;
    background: transparent;
    color: var(--muted);
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
}

.account-modal-body {
    padding: 20px 22px;
}

.account-modal-body textarea {
    min-height: 240px;
    border-radius: 16px;
    background: #f8f5ef;
    white-space: pre-wrap;
}

.account-modal-actions {
    justify-content: flex-end;
    border-top: 1px solid #eee4d7;
}

.order-table .action-col {
    white-space: nowrap;
}

.type-table th,
.type-table td {
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
}

.type-table .type-name-cell {
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.type-action-head,
.type-action-cell {
    text-align: center !important;
}

.type-action-cell.inline-actions {
    justify-content: center;
    align-items: center;
}

.table-actions.center {
    justify-content: center;
    align-items: center;
}

.key-table th,
.key-table td {
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
}

.key-table .key-type-cell {
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.key-table .key-action-cell {
    justify-content: center;
}

.pagination {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.page-size-form {
    display: inline-flex;
    align-items: center;
    margin-right: auto;
}

.page-size-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    white-space: nowrap;
}

.page-size-label select {
    width: auto;
    min-width: 84px;
    padding: 8px 12px;
    border-radius: 12px;
}

.page-link {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-width: 42px;
    padding: 8px 12px;
    border-radius: 12px;
    background: #efe7db;
    color: var(--text);
}

.page-ellipsis {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-width: 28px;
    color: var(--muted);
}

.page-link.active {
    background: var(--primary);
    color: #fff;
}

.page-link.disabled {
    pointer-events: none;
    opacity: 0.45;
}

.page-summary {
    margin-left: 10px;
    color: var(--muted);
    font-size: 14px;
}

.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(18, 28, 38, 0.18);
    backdrop-filter: blur(3px);
}

.loading-overlay[hidden] {
    display: none !important;
}

.loading-panel {
    width: min(460px, 92vw);
    padding: 24px 24px 20px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 22px;
    background: rgba(255, 253, 248, 0.98);
    box-shadow: 0 20px 50px rgba(22, 30, 40, 0.18);
}

.loading-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
}

.loading-subtitle {
    margin-top: 8px;
    color: var(--muted);
    line-height: 1.6;
}

.loading-count {
    margin-top: 10px;
    color: var(--primary);
    font-weight: 700;
}

.progress-track {
    position: relative;
    overflow: hidden;
    height: 12px;
    margin-top: 18px;
    border-radius: 999px;
    background: rgba(30, 77, 114, 0.12);
}

.progress-bar {
    position: absolute;
    top: 0;
    left: -35%;
    width: 35%;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #2a6a98 0%, #4e93c7 100%);
    animation: loading-slide 1.2s ease-in-out infinite;
}

.progress-bar.determinate {
    left: 0;
    width: 0;
    animation: none;
}

@keyframes loading-slide {
    0% {
        left: -35%;
    }
    100% {
        left: 100%;
    }
}

.detail-list {
    display: grid;
    gap: 12px;
}

.detail-list div {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 12px;
    padding-bottom: 8px;
    border-bottom: 1px dashed #eadfcf;
}

.detail-list span {
    color: var(--muted);
}

.multiline {
    white-space: pre-wrap;
    word-break: break-word;
}

.alerts {
    margin-bottom: 18px;
}

.floating-notice-wrap {
    position: fixed;
    top: 88px;
    right: 24px;
    z-index: 30;
    display: grid;
    gap: 12px;
    max-width: 360px;
}

.floating-notice {
    border-radius: 18px;
    padding: 16px 18px;
    box-shadow: 0 18px 40px rgba(16, 24, 40, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    background: rgba(255, 253, 248, 0.94);
}

.floating-notice.success {
    border-left: 5px solid var(--success);
}

.floating-notice.danger {
    border-left: 5px solid var(--danger);
}

.floating-title {
    margin-bottom: 6px;
    font-weight: 700;
}

.alert {
    padding: 14px 16px;
    border-radius: 16px;
    margin-bottom: 12px;
    animation: alertFadeOut 4.5s ease forwards;
    transform-origin: top center;
}

.alert.success {
    background: rgba(47, 127, 95, 0.12);
    color: #216246;
}

.alert.danger {
    background: rgba(185, 65, 65, 0.12);
    color: #963030;
}

@keyframes alertFadeOut {
    0%, 70% {
        opacity: 1;
        max-height: 120px;
        margin-bottom: 12px;
        padding-top: 14px;
        padding-bottom: 14px;
    }
    100% {
        opacity: 0;
        max-height: 0;
        margin-bottom: 0;
        padding-top: 0;
        padding-bottom: 0;
        overflow: hidden;
    }
}

.datetime-picker {
    display: grid;
    gap: 8px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.82);
}

.datetime-label {
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
}

.datetime-parts {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) repeat(3, 56px);
    gap: 8px;
}

.datetime-parts input,
.datetime-parts select {
    min-width: 0;
    padding: 10px 10px;
}

.deliver-menu,
.manual-deliver-box {
    width: auto;
    margin: 0;
}

.deliver-menu summary,
.manual-deliver-box summary {
    list-style: none;
}

.deliver-menu summary::-webkit-details-marker,
.manual-deliver-box summary::-webkit-details-marker {
    display: none;
}

.deliver-panel {
    position: absolute;
    margin-top: 10px;
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 14px 32px rgba(20, 20, 20, 0.12);
    min-width: 220px;
    z-index: 5;
}

.deliver-menu {
    position: relative;
}

.badge {
    display: inline-flex;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.badge.success {
    background: rgba(47, 127, 95, 0.14);
    color: #216246;
}

.badge.warning {
    background: rgba(169, 119, 0, 0.14);
    color: #8b6200;
}

.badge.danger {
    background: rgba(185, 65, 65, 0.14);
    color: #963030;
}

.badge.muted {
    background: rgba(107, 114, 128, 0.12);
    color: #55606e;
}

.template-create-grid {
    display: grid;
    grid-template-columns: 1.35fr 1fr 0.9fr 0.9fr 0.9fr auto;
    gap: 14px;
    align-items: end;
}

.template-content-field {
    grid-column: 1 / span 5;
}

.template-save-btn {
    min-width: 140px;
    white-space: nowrap;
}

.template-create-grid textarea {
    min-height: 120px;
}

.compact-template-create-grid textarea {
    min-height: 88px;
}

.template-table th,
.template-table td {
    text-align: center;
    vertical-align: middle;
}

.template-content-preview {
    max-width: 360px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.template-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
    gap: 10px;
}

.split-template-actions {
    justify-content: space-between;
    min-width: 150px;
}

.template-actions form {
    margin: 0;
}

.template-usage {
    line-height: 1.8;
}

.mail-config-form {
    display: grid;
    gap: 12px;
}

.mail-config-row {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 14px;
    align-items: center;
}

.compact-mail-config {
    gap: 10px;
}

.compact-mail-config .mail-config-row {
    grid-template-columns: 140px 1fr;
    gap: 12px;
}

.mail-config-label {
    color: var(--muted);
    font-size: 14px;
    white-space: nowrap;
}

.pager {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 18px;
}

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

.pager-size label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.pager-size select {
    width: auto;
    min-width: 90px;
}

.pager-links {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.pager-ellipsis {
    color: var(--muted);
    padding: 0 2px;
}

.pager-summary {
    color: var(--muted);
    white-space: nowrap;
}

.alert.is-hiding {
    opacity: 0;
    max-height: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
    overflow: hidden;
    transition: all 0.45s ease;
}

.empty-state {
    color: var(--muted);
    padding: 18px 0;
}

.compact-template-card {
    padding: 12px 14px;
}

.compact-template-card textarea {
    min-height: 62px;
}

.compact-template-actions {
    grid-template-columns: minmax(180px, 220px) auto;
    align-items: end;
}

.compact-template-actions .status-inline-field {
    display: grid;
    gap: 6px;
}

.login-page {
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(circle at 20% 15%, rgba(31, 216, 215, 0.22), transparent 18%),
        radial-gradient(circle at 80% 18%, rgba(30, 184, 255, 0.18), transparent 16%),
        radial-gradient(circle at 40% 78%, rgba(44, 193, 178, 0.12), transparent 18%),
        linear-gradient(135deg, #04111f 0%, #06243a 45%, #03101d 100%);
    overflow: hidden;
}

.login-shell {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 24px 24px;
}

.login-card {
    position: relative;
    width: min(92vw, 480px);
    border-radius: 24px;
    background: rgba(245, 248, 252, 0.92);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.24);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
    z-index: 2;
}

.login-card-inner {
    padding: 40px 44px 36px;
}

.login-card h1 {
    margin: 0;
    text-align: center;
    font-size: 22px;
    color: #1a3552;
}

.login-subtitle {
    margin: 8px 0 28px;
    text-align: center;
    color: #7d8b99;
    font-size: 15px;
}

.login-form {
    display: grid;
    gap: 22px;
}

.login-form label {
    display: grid;
    gap: 10px;
    color: #24415d;
    font-weight: 700;
}

.login-form label span {
    font-size: 15px;
}

.login-form input {
    height: 58px;
    border-radius: 14px;
    border: 1px solid rgba(69, 112, 150, 0.18);
    background: rgba(255, 255, 255, 0.94);
    padding: 0 18px;
    font-size: 16px;
    color: #16324a;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.login-form input:focus {
    outline: none;
    border-color: rgba(42, 132, 202, 0.55);
    box-shadow: 0 0 0 4px rgba(42, 132, 202, 0.12);
}

.login-submit {
    height: 58px;
    border-radius: 14px;
    font-size: 22px;
    letter-spacing: 8px;
}

.login-footer {
    padding: 0 24px 22px;
    text-align: center;
    color: rgba(220, 240, 255, 0.72);
    font-size: 14px;
}

.login-tech,
.login-tech::before,
.login-tech::after {
    position: absolute;
    content: "";
    display: block;
}

.login-tech {
    width: 42vw;
    height: 42vh;
    min-width: 340px;
    min-height: 280px;
    opacity: 0.35;
    z-index: 1;
}

.login-tech-left {
    left: 8%;
    top: 18%;
    background:
        linear-gradient(90deg, rgba(35, 207, 202, 0.88), rgba(35, 207, 202, 0.88)) 0 12% / 38% 3px no-repeat,
        linear-gradient(90deg, rgba(35, 207, 202, 0.88), rgba(35, 207, 202, 0.88)) 0 28% / 56% 3px no-repeat,
        linear-gradient(90deg, rgba(35, 207, 202, 0.88), rgba(35, 207, 202, 0.88)) 0 44% / 72% 3px no-repeat,
        linear-gradient(90deg, rgba(35, 207, 202, 0.88), rgba(35, 207, 202, 0.88)) 0 60% / 64% 3px no-repeat,
        linear-gradient(90deg, rgba(35, 207, 202, 0.88), rgba(35, 207, 202, 0.88)) 0 76% / 48% 3px no-repeat;
}

.login-tech-left::before {
    inset: 0;
    background:
        linear-gradient(180deg, transparent 0 10%, rgba(35, 207, 202, 0.88) 10% 12%, transparent 12% 26%, rgba(35, 207, 202, 0.88) 26% 28%, transparent 28% 42%, rgba(35, 207, 202, 0.88) 42% 44%, transparent 44% 58%, rgba(35, 207, 202, 0.88) 58% 60%, transparent 60% 74%, rgba(35, 207, 202, 0.88) 74% 76%, transparent 76%);
    clip-path: polygon(18% 0, 22% 0, 22% 20%, 36% 20%, 36% 36%, 52% 36%, 52% 52%, 68% 52%, 68% 68%, 82% 68%, 82% 100%, 78% 100%, 78% 72%, 64% 72%, 64% 56%, 48% 56%, 48% 40%, 32% 40%, 32% 24%, 18% 24%);
}

.login-tech-left::after {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #25dbd2;
    left: 75%;
    top: 74%;
    box-shadow:
        -180px -212px 0 0 #25dbd2,
        -130px -148px 0 0 #25dbd2,
        -74px -86px 0 0 #25dbd2,
        -18px -22px 0 0 #25dbd2,
        42px -270px 0 0 #25dbd2;
}

.login-tech-right {
    right: 9%;
    bottom: 16%;
    width: 34vw;
    height: 30vh;
    min-width: 280px;
    min-height: 220px;
    opacity: 0.28;
    background:
        radial-gradient(circle at 18% 26%, rgba(36, 219, 217, 0.95) 0 7px, transparent 8px),
        radial-gradient(circle at 62% 40%, rgba(36, 219, 217, 0.95) 0 6px, transparent 7px),
        radial-gradient(circle at 78% 18%, rgba(36, 219, 217, 0.95) 0 8px, transparent 9px),
        linear-gradient(90deg, rgba(36, 219, 217, 0.78), rgba(36, 219, 217, 0.78)) 0 24% / 38% 2px no-repeat,
        linear-gradient(90deg, rgba(36, 219, 217, 0.78), rgba(36, 219, 217, 0.78)) 22% 40% / 52% 2px no-repeat,
        linear-gradient(90deg, rgba(36, 219, 217, 0.78), rgba(36, 219, 217, 0.78)) 40% 18% / 44% 2px no-repeat,
        linear-gradient(90deg, rgba(36, 219, 217, 0.78), rgba(36, 219, 217, 0.78)) 16% 68% / 66% 2px no-repeat;
}

.login-binary {
    position: absolute;
    font-size: clamp(42px, 5vw, 84px);
    letter-spacing: 10px;
    color: rgba(37, 219, 210, 0.22);
    font-weight: 700;
    user-select: none;
    z-index: 1;
}

.login-binary-top {
    top: 7%;
    left: 9%;
}

.login-binary-bottom {
    right: 8%;
    bottom: 10%;
}

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

    .topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .detail-list div {
        grid-template-columns: 1fr;
    }

    .floating-notice-wrap {
        left: 16px;
        right: 16px;
        top: 78px;
        max-width: none;
    }

    .section-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .order-filter-grid,
    .order-filter-time-grid,
    .type-filter-grid,
    .type-form,
    .key-filter-grid,
    .key-generate-form,
    .stock-detail-filter-grid,
    .stock-summary-filter-grid,
    .template-create-grid {
        grid-template-columns: 1fr;
    }

    .stock-manage-toolbar {
        grid-template-columns: 1fr;
    }

    .mail-config-row {
        grid-template-columns: 1fr;
    }

    .mail-template-actions {
        grid-template-columns: 1fr;
    }

    .mail-template-row,
    .mail-template-inline-actions {
        grid-template-columns: 1fr;
    }

    .type-form-span-2 {
        grid-column: auto;
    }

    .template-content-field {
        grid-column: auto;
    }

    .datetime-parts {
        grid-template-columns: 1fr 1fr;
    }

    .compact-filter-btn {
        width: 100%;
    }

    .login-card-inner {
        padding: 32px 24px 28px;
    }

    .login-tech {
        opacity: 0.2;
    }

    .login-binary {
        font-size: 34px;
        letter-spacing: 4px;
    }
}
