/* 
 * Admin CSS - Version: 20260616-v5
 * Fixed: Modal responsive issues, removed max-height: 90vh
 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 14px; /* 默认中等，设置页 JS 会覆盖为 12/14/17/20px */
    scrollbar-gutter: stable;
}

/* 主题 CSS 变量（默认值；设置页 setPrimaryColor 会动态覆盖） */
:root {
    --primary-color: #ff6b6b;
    --primary-gradient-end: #eb5757;
    --primary-on-color: #fff;
    --primary-header-gradient: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-gradient-end) 100%);
}

/* 全站跟随 html 根字号（rem 基准） */
#loginPage,
.login-page,
.login-box,
#mainPage,
.main-page {
    font-size: 1rem;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #f5f7fa;
    color: #333;
    font-size: 1rem;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

/* 网站备案号 */
.site-icp-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    padding: 6px 12px;
    text-align: center;
    font-size: 12px;
    line-height: 1.5;
    color: #999;
    background: #f5f7fa;
    border-top: 1px solid #e8eaed;
    pointer-events: none;
}

.site-icp-footer a {
    color: #999;
    text-decoration: none;
    pointer-events: auto;
}

.site-icp-footer a:hover {
    color: #666;
}

/* ========== 登录页 ========== */
.login-page {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ff9a56 0%, #ff6b6b 100%);
    overflow: hidden;
}

body.login-visible {
    overflow: hidden;
    position: fixed;
    left: 0;
    right: 0;
    width: 100%;
}

.login-box {
    width: 360px;
    background: #fff;
    border-radius: 12px;
    padding: 36px 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.login-box h1 {
    font-size: 1.57rem;
    text-align: center;
    margin-bottom: 8px;
    color: #333;
}

.subtitle {
    text-align: center;
    color: #999;
    margin-bottom: 24px;
    font-size: 0.93rem;
}

.login-actions-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 4px 0 18px;
    flex-wrap: nowrap;
}

.login-remember {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 0.93rem;
    color: #666;
    cursor: pointer;
    user-select: none;
    flex: 0 0 auto;
    white-space: nowrap;
    max-width: none;
}

.login-remember span {
    display: inline;
    white-space: nowrap;
    writing-mode: horizontal-tb;
    line-height: 1.4;
}

.login-remember input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    flex: 0 0 auto;
    accent-color: #ff6b6b;
    cursor: pointer;
}

.login-forgot-link {
    border: none;
    background: transparent;
    padding: 4px 0;
    color: #999;
    font-size: 0.86rem;
    cursor: pointer;
    text-decoration: none;
    flex: 0 0 auto;
    white-space: nowrap;
    transition: color 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.login-forgot-link:hover,
.login-forgot-link:active {
    color: #ff6b6b;
}

.login-box .login-submit-btn {
    width: 100%;
    display: block;
    padding: 12px 20px;
    font-size: 1.07rem;
    border-radius: 8px;
    box-shadow: 0 4px 14px rgba(255, 107, 107, 0.25);
}

.login-icp-footer {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
    text-align: center;
    font-size: 12px;
    line-height: 1.5;
    pointer-events: auto;
}

.login-icp-footer a {
    color: rgba(255, 255, 255, 0.82);
    text-decoration: none;
}

.login-icp-footer a:hover,
.login-icp-footer a:active {
    color: #fff;
}

.sms-code-row .sms-code-input-wrap {
    display: flex;
    gap: 8px;
    align-items: center;
}

.sms-code-row .sms-code-input-wrap input {
    flex: 1;
    min-width: 0;
}

.sms-code-row .sms-code-input-wrap button {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 8px 12px;
}

.staff-list-box {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.staff-card {
    background: #fff;
    border: 1px solid #e8eaed;
    border-radius: 12px;
    padding: 12px 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.staff-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.staff-card-main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1 1 auto;
}

.staff-card-avatar {
    position: relative;
    flex: 0 0 auto;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(135deg, #ff9a56 0%, #ff6b6b 100%);
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.22);
}

.staff-card-avatar .chat-avatar-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.staff-card-avatar .chat-avatar-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1;
    background: transparent;
}

.staff-card-info {
    min-width: 0;
    flex: 1 1 auto;
}

.staff-card-name {
    font-size: 1.07rem;
    font-weight: 600;
    color: #333;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.staff-card-user {
    font-size: 0.86rem;
    color: #999;
    font-weight: normal;
}

.staff-card-meta {
    margin-top: 4px;
    font-size: 0.86rem;
    color: #666;
    line-height: 1.4;
}

.staff-status-on {
    color: #52c41a;
}

.staff-status-off {
    color: #ff4d4f;
}

.staff-status-locked {
    color: #fa8c16;
    font-weight: 600;
    white-space: nowrap;
}

.staff-status-hidden {
    color: #ff4d4f;
    font-weight: 600;
    white-space: nowrap;
}

.staff-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    flex: 0 0 auto;
}

.staff-action-modal-box {
    width: min(420px, calc(100vw - 32px)) !important;
    max-width: 420px !important;
}

#staffActionModal .modal-body {
    text-align: center;
    padding: 20px 22px 8px;
}

.staff-action-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #ff9a56 0%, #ff6b6b 100%);
    box-shadow: 0 6px 16px rgba(255, 107, 107, 0.28);
}

.staff-action-icon.is-warn {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.28);
}

.staff-action-icon.is-danger {
    background: linear-gradient(135deg, #fb7185 0%, #ef4444 100%);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.28);
}

.staff-action-message {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.55;
    word-break: break-word;
}

.staff-action-password {
    display: block;
    margin: 14px auto 0;
    padding: 10px 14px;
    max-width: 100%;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #0f172a;
    background: #f1f5f9;
    border: 1px dashed #94a3b8;
    border-radius: 10px;
    word-break: break-all;
    user-select: all;
}

body.dark-theme .staff-action-password {
    color: #f8fafc;
    background: #1e293b;
    border-color: #64748b;
}

.staff-action-sub {
    margin: 10px 0 0;
    font-size: 0.9rem;
    color: #6b7280;
    line-height: 1.5;
    word-break: break-word;
}

#staffActionModal .modal-footer {
    display: flex;
    gap: 10px;
    justify-content: stretch;
    padding: 12px 16px 16px;
}

#staffActionModal .modal-footer .btn-default,
#staffActionModal .modal-footer .btn-primary,
#staffActionModal .modal-footer .btn-danger {
    flex: 1;
    min-height: 42px;
    border-radius: 10px;
    font-weight: 600;
}

body.dark-theme .staff-action-message {
    color: #f1f5f9;
}

body.dark-theme .staff-action-sub {
    color: #94a3b8;
}

.staff-action-btn {
    padding: 6px 12px;
    font-size: 0.86rem;
}

.staff-tag-super {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    background: #fff1f0;
    color: #ff6b6b;
    font-size: 0.86rem;
}

.staff-card-perms {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #eee;
    font-size: 0.86rem;
    color: #666;
    line-height: 1.5;
}

.staff-permission-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

/* ========== 员工权限弹窗（scoped，避免被 .form-item 全局样式干扰） ========== */
#staffEditModal .staff-perm-group {
    border: 1px solid #e8ebef;
    border-radius: 12px;
    background: #fff;
}

#staffEditModal .staff-perm-group.is-on {
    border-color: #ffb8b8;
    background: #fffafa;
}

#staffEditModal .staff-perm-top {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px 8px;
}

#staffEditModal .staff-perm-top input[type="checkbox"] {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px;
    padding: 0 !important;
    margin: 0;
    flex-shrink: 0;
    accent-color: #ff6b6b;
}

#staffEditModal .staff-perm-name {
    flex: 1;
    font-weight: 600;
    font-size: 0.95rem;
    color: #333;
    margin: 0 !important;
    cursor: pointer;
}

#staffEditModal .staff-perm-badge {
    font-size: 0.72rem;
    padding: 2px 8px;
    border-radius: 999px;
    background: #f0f0f0;
    color: #999;
    white-space: nowrap;
}

#staffEditModal .staff-perm-group.is-on .staff-perm-badge {
    background: #ffe3e3;
    color: #e03131;
}

#staffEditModal .staff-perm-btns-wrap {
    padding: 10px 14px 12px;
    border-top: 1px solid #f2f2f2;
    background: linear-gradient(180deg, #fafbfc 0%, #fff 100%);
}

#staffEditModal .staff-perm-btns-label {
    display: block;
    font-size: 0.78rem;
    color: #999;
    line-height: 1.3;
    margin-bottom: 8px;
}

#staffEditModal .staff-perm-btns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
    gap: 8px;
}

#staffEditModal .staff-perm-btn {
    position: relative;
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100% !important;
    min-width: 0;
    padding: 9px 4px !important;
    margin: 0;
    border: 1px solid #e4e8ec;
    border-radius: 8px;
    background: #fff;
    font-size: 0.86rem;
    color: #555;
    line-height: 1.2;
    cursor: pointer;
    font-family: inherit;
    box-sizing: border-box;
    white-space: nowrap;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}

#staffEditModal .staff-perm-btn input {
    position: absolute;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: 0;
    opacity: 0;
    pointer-events: none;
}

#staffEditModal .staff-perm-btn.is-on {
    border-color: #ff8a8a;
    background: #fff5f5;
    color: #e03131;
    font-weight: 600;
    box-shadow: inset 0 0 0 1px rgba(255, 107, 107, 0.15);
}

#staffEditModal .staff-perm-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

#staffEditModal .staff-perm-no-btn {
    font-size: 0.86rem;
    color: #aaa;
    line-height: 1.4;
    padding: 4px 0;
}

#staffEditModal .modal-box.staff-modal-box {
    max-width: 580px;
    width: calc(100vw - 24px);
    max-height: 92vh;
}

#staffEditModal .modal-body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.staff-perm-tip {
    margin: 4px 0 10px;
    font-size: 0.86rem;
    color: #999;
    line-height: 1.5;
}

.staff-perm-form-item > label {
    font-weight: 600;
    color: #333;
}

.staff-perm-form-item .staff-permission-grid {
    margin-top: 0;
}

.staff-modal-box {
    max-width: 580px;
    width: calc(100vw - 24px);
}

.staff-add-btn {
    flex-shrink: 0;
}

.tip {
    text-align: center;
    color: #bbb;
    font-size: 0.86rem;
    margin-top: 16px;
}

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

.form-item label {
    display: block;
    margin-bottom: 6px;
    color: #666;
    font-size: 0.93rem;
}

.form-item input, .form-item textarea, .form-item select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e0e4e8;
    border-radius: 6px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}

.form-item input:focus, .form-item textarea:focus, .form-item select:focus {
    border-color: #ff6b6b;
}

.btn-primary {
    display: inline-block;
    padding: 10px 20px;
    background: linear-gradient(135deg, #ff9a56 0%, #ff6b6b 100%);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: opacity 0.2s;
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-default {
    display: inline-block;
    padding: 10px 20px;
    background: #f0f2f5;
    color: #555;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    margin-right: 10px;
}

.btn-danger {
    padding: 6px 12px;
    background: #fff0f0;
    color: #f56c6c;
    border: 1px solid #fecaca;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.93rem;
    margin-right: 6px;
    white-space: nowrap;
}

.btn-success {
    padding: 6px 12px;
    background: #f0fff4;
    color: #38a169;
    border: 1px solid #c6f6d5;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.93rem;
    margin-right: 6px;
    white-space: nowrap;
}

/* ========== 主布局 ========== */
.main-page {
    display: flex;
    min-height: 100vh;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

.sidebar {
    width: max-content;
    min-width: 180px;
    max-width: 280px;
    background: #fff;
    border-right: 1px solid #e8eaed;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    z-index: 100;
}

.sidebar.collapsed {
    transform: translateX(-100%);
}

.logo {
    padding: 20px;
    font-size: 1.29rem;
    font-weight: bold;
    color: #ff6b6b;
    border-bottom: 1px solid #f0f2f5;
}

.menu {
    flex: 1;
    padding: 10px 0;
}

.menu-item {
    padding: 12px 20px;
    cursor: pointer;
    color: #666;
    transition: all 0.2s;
    font-size: 1rem;
}

.menu-item:hover {
    background: #fff5f5;
    color: #ff6b6b;
}

.menu-item.active {
    background: linear-gradient(90deg, #fff5f5 0%, transparent 100%);
    color: #ff6b6b;
    font-weight: bold;
    border-left: 3px solid #ff6b6b;
    padding-left: 17px;
}

.menu-item.menu-perm-hidden,
.menu-item[hidden] {
    display: none !important;
}

.user-info {
    padding: 14px 16px;
    border-top: 1px solid #f0f2f5;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    font-size: 0.93rem;
    color: #666;
    min-width: 0;
}

.user-info-profile {
    flex: 1;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 6px;
    margin: -4px -6px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    color: inherit;
    font: inherit;
    transition: background 0.2s ease;
}

.user-info-profile:hover {
    background: rgba(255, 107, 107, 0.08);
}

.user-info-avatar {
    position: relative;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(135deg, #ff9a56, #ff6b6b);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.86rem;
    font-weight: 600;
}

.user-info-avatar img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

.user-info-avatar span {
    line-height: 1;
}

.user-info #usernameShow {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
    color: #475569;
    line-height: 1.4;
}

.btn-logout {
    flex-shrink: 0;
    padding: 6px 12px;
    background: #f0f2f5;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.86rem;
    white-space: nowrap;
    line-height: 1.3;
}

.btn-login {
    flex-shrink: 0;
    padding: 6px 16px;
    background: linear-gradient(135deg, #ff6b6b, #ff8e53);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.86rem;
    white-space: nowrap;
}

/* 移动端侧边栏遮罩 */
.sidebar-mask {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
}

.sidebar-mask.active {
    display: block;
    z-index: 1050;
}

.content {
    flex: 1;
    margin-left: 280px;
    padding: 20px 20px 56px;
    transition: margin-left 0.3s ease;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
}

.page {
    max-width: 100%;
    min-width: 0;
}

.content.expanded {
    margin-left: 0;
}

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

.page-header h2 {
    font-size: 1.4286rem;
    color: #333;
    white-space: nowrap;
}

.menu-toggle {
    display: none;
    background: linear-gradient(135deg, #ff9a56 0%, #ff6b6b 100%);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 1.2857rem;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.2);
}

.card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    max-width: 100%;
    min-width: 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
    table-layout: auto;
}

table th, table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #f0f2f5;
    font-size: 1rem;
    white-space: nowrap;
}

table th {
    background: #fafafa;
    color: #666;
    font-weight: 500;
}

table tr:hover td {
    background: #fafbfc;
}

/* 序号列最小宽度 */
table th:first-child,
table td:first-child {
    min-width: 60px;
    width: auto;
}

/* 复选框列宽度 */
table th:nth-child(2),
table td:nth-child(2) {
    min-width: 40px;
    width: auto;
}

.dish-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border: 1px solid #eee;
    border-radius: 6px;
    background: #fafafa;
    cursor: zoom-in;
    display: inline-block;
    vertical-align: middle;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.dish-thumb:hover {
    transform: scale(1.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

#dishPagination {
    margin-top: 16px;
    clear: both;
}

.status-on {
    color: #38a169;
    font-weight: bold;
}

.status-off {
    color: #f56c6c;
    font-weight: bold;
}

.status-paid {
    color: #389e0d;
    font-weight: bold;
}

.status-unpaid {
    color: #cf1322;
    font-weight: bold;
}

/* 桌号网格 */
.table-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.table-card {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    text-align: center;
}

.table-card-title {
    font-size: 1.71rem;
    font-weight: bold;
    color: #ff6b6b;
    margin-bottom: 10px;
}

.table-card-body {
    margin-bottom: 14px;
    color: #999;
    font-size: 0.93rem;
}

.table-card-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

/* 弹窗 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    overscroll-behavior: none;
}

/* 弹层打开时锁定底层页面（防安卓/PC 滚动穿透） */
body.admin-modal-scroll-locked {
    overflow: hidden !important;
    position: fixed;
    width: 100%;
    left: 0;
    right: 0;
    overscroll-behavior: none;
}

.modal-box {
    width: 480px;
    max-width: 100%;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overscroll-behavior: contain;
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid #f0f2f5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1429rem;
    font-weight: bold;
}

.modal-close {
    font-size: 1.7143rem;
    cursor: pointer;
    color: #999;
    line-height: 1;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.modal-footer {
    display: flex;
    align-items: stretch;
    gap: 10px;
    padding: 14px 16px;
    border-top: 1px solid #f0f2f5;
}

/* 弹窗底部按钮统一：等宽、等高，方便安卓点击 */
.modal-footer > button {
    flex: 1;
    min-width: 0;
    min-height: 44px;
    padding: 10px 12px;
    font-size: 0.93rem;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.2s, background 0.2s;
    box-sizing: border-box;
    line-height: 1.3;
}

.modal-footer .btn-default,
.modal-footer .btn-cancel {
    background: #f5f7fa;
    color: #555;
    border: 1px solid #e0e4e8;
}

.modal-footer .btn-primary,
.modal-footer .btn-confirm {
    background: linear-gradient(135deg, #ff9a56 0%, #ff6b6b 100%);
    color: #fff;
    border: none;
}

.modal-footer .btn-danger {
    background: linear-gradient(135deg, #ff6b6b 0%, #f56c6c 100%);
    color: #fff;
    border: none;
}

.modal-footer .btn-success {
    background: #52c41a;
    color: #fff;
    border: none;
}

.modal-footer .btn-default:hover,
.modal-footer .btn-cancel:hover,
.modal-footer .btn-primary:hover,
.modal-footer .btn-confirm:hover,
.modal-footer .btn-danger:hover,
.modal-footer .btn-success:hover {
    opacity: 0.92;
}

.qr-body {
    text-align: center;
}

.qr-body img {
    width: 260px;
    height: 260px;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 10px;
    background: #fff;
}

.qr-content {
    margin: 14px 0 6px;
    font-size: 0.9286rem;
    color: #666;
    word-break: break-all;
}

.qr-tip {
    font-size: 0.9286rem;
    color: #ff6b6b;
    margin-top: 6px;
}

/* toast — PC 管理端（浅色卡片 + 左侧色条，区别于小程序橙红胶囊 / 旧黑底圆点） */
.toast {
    position: fixed;
    top: 24px;
    right: 28px;
    left: auto;
    transform: translateY(-6px);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 220px;
    max-width: min(92vw, 380px);
    padding: 14px 18px 14px 16px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    line-height: 1.45;
    color: #1e293b;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-left: 4px solid var(--primary-color);
    box-shadow: 0 4px 6px rgba(15, 23, 42, 0.04),
    0 12px 28px rgba(15, 23, 42, 0.12);
    /* 须高于退款弹窗（5000）等，否则提示被挡住像「没反应」 */
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease, transform 0.28s ease;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* 默认不显示左侧圆点图标 */
.toast__icon,
.toast--default .toast__icon {
    display: none;
}

.toast__text {
    flex: 1;
    word-break: break-word;
    color: inherit;
}

/* 进行中：底部细进度条，替代黑底圆点 */
.toast--busy {
    border-left-color: var(--primary-color);
    padding-bottom: 18px;
}

.toast--busy::after {
    content: '';
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 7px;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(
            90deg,
            transparent 0%,
            var(--primary-color) 40%,
            var(--primary-gradient-end) 60%,
            transparent 100%
    );
    background-size: 200% 100%;
    animation: admin-toast-busy 1.1s linear infinite;
}

@keyframes admin-toast-busy {
    0% {
        background-position: 100% 0;
    }
    100% {
        background-position: -100% 0;
    }
}

.toast--peer-submit {
    border-left-color: #f59e0b;
    color: #92400e;
    background: #fffbeb;
}

.toast--peer-paid {
    border-left-color: #22c55e;
    color: #166534;
    background: #f0fdf4;
}

.toast--unpaid {
    border-left-color: #f59e0b;
    color: #9a3412;
    background: #fff7ed;
}

.toast--warn {
    border-left-color: #ef4444;
    color: #991b1b;
    background: #fef2f2;
}

/* 黑夜模式下 toast 仍用浅色卡片，保证可读、且不改其它组件 */
body.dark-theme .toast {
    color: #e2e8f0;
    background: #1e293b;
    border-color: rgba(148, 163, 184, 0.25);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2),
    0 12px 28px rgba(0, 0, 0, 0.35);
}

body.dark-theme .toast--peer-submit {
    color: #fde68a;
    background: #422006;
}

body.dark-theme .toast--peer-paid {
    color: #bbf7d0;
    background: #14532d;
}

body.dark-theme .toast--unpaid {
    color: #fdba74;
    background: #7c2d12;
}

body.dark-theme .toast--warn {
    color: #fecaca;
    background: #7f1d1d;
}

/* 素材库样式 */
.filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    align-items: center;
    max-width: 100%;
}

.filter-bar-main {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    flex: 1 1 280px;
    min-width: 0;
    align-items: center;
}

/* 素材库批量操作条 */
.material-batch-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin: -8px 0 14px;
    padding: 10px 12px;
    background: #f7f9fc;
    border: 1px solid #e3e8ef;
    border-radius: 10px;
    box-sizing: border-box;
}

.material-batch-count {
    flex-shrink: 0;
    color: #337ab7;
    font-size: 0.8571rem;
    font-weight: 600;
    white-space: nowrap;
}

.material-batch-btns {
    display: flex;
    flex: 1;
    min-width: 0;
    gap: 8px;
    justify-content: flex-end;
    flex-wrap: nowrap;
}

.material-batch-btn {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 8px 16px;
    font-size: 0.8571rem;
    white-space: nowrap;
    text-align: center;
}

.material-batch-btn[hidden],
.material-batch-btn.perm-hidden {
    display: none !important;
}

/* 菜品管理工具栏 */
.dish-toolbar {
    margin-bottom: 12px;
    padding: 12px 16px !important;
}

.dish-filter-bar {
    margin-bottom: 0;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 10px;
}

.dish-filter-bar select,
.dish-filter-bar .custom-select-wrapper {
    flex: 0 0 auto;
    width: auto;
    min-width: 8rem;
}

.dish-filter-bar .custom-select-trigger {
    padding: 8px 2.2rem 8px 10px;
    font-size: 0.9286rem;
}

.dish-filter-bar .dish-search-input {
    flex: 0 1 180px;
    width: 180px;
    max-width: 220px;
    min-width: 120px;
    padding: 8px 10px;
    font-size: 0.9286rem;
}

.dish-filter-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-left: auto;
}

.dish-filter-actions .batch-btn {
    flex: 0 0 auto;
    min-width: 0;
    padding: 8px 14px;
    font-size: 0.8571rem;
    text-align: center;
    margin-right: 0;
    white-space: nowrap;
}

.dish-filter-actions .batch-btn[hidden],
.dish-filter-actions .batch-btn.perm-hidden {
    display: none !important;
}

.btn-compact {
    flex-shrink: 0;
    padding: 8px 12px !important;
    font-size: 0.9286rem !important;
    margin-right: 0 !important;
    white-space: nowrap;
}

.dish-add-btn {
    flex-shrink: 0;
    white-space: nowrap;
}

/* 日期范围一行展示 */
.date-range-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1 1 auto;
    min-width: 0;
}

.date-range-inline input[type="date"] {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
}

.date-sep {
    flex-shrink: 0;
    color: #888;
    font-size: 0.9286rem;
    white-space: nowrap;
}

/* 分类管理列表 */
.category-card {
    padding: 0 16px 16px !important;
}

.category-drag-tip {
    margin: 12px 0 4px;
    padding: 8px 12px;
    background: #fff8f3;
    border: 1px solid #ffe4d4;
    border-radius: 8px;
    color: #b86b4b;
    font-size: 0.8571rem;
}

.category-desktop {
    width: 100%;
}

.category-list {
    width: 100%;
}

.category-list-head,
.category-item {
    display: flex;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    padding: 12px 0;
}

.category-list-head > span,
.category-item > span {
    min-width: 0;
    padding: 0 12px;
    box-sizing: border-box;
}

.category-list-head > span:nth-child(1),
.category-item .ci-drag {
    flex: 0 0 48px;
    width: 48px;
    padding-left: 0;
    text-align: center;
}

.category-list-head > span:nth-child(2),
.category-item .ci-sort {
    flex: 0 0 72px;
    width: 72px;
    text-align: center;
}

.category-list-head > span:nth-child(3),
.category-item .ci-name,
.category-list-head > span:nth-child(4),
.category-item .ci-time,
.category-list-head > span:nth-child(5),
.category-item .ci-action {
    flex: 1 1 0;
    text-align: center;
}

.category-list-head {
    color: #666;
    font-size: 0.9286rem;
    font-weight: 500;
    border-bottom: 1px solid #f0f2f5;
    background: #fafafa;
    margin: 0;
    padding: 12px 0;
    border-radius: 8px 8px 0 0;
}

.category-item {
    border-bottom: 1px solid #f0f2f5;
    font-size: 1rem;
    transition: background 0.15s, box-shadow 0.15s;
}

.category-item:last-child {
    border-bottom: none;
}

.category-item.dragging {
    opacity: 0.45;
}

.category-item.drag-over {
    background: #fff7f0;
    box-shadow: inset 0 0 0 1px #ffd4b8;
}

.category-item .ci-drag {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #bbb;
    cursor: grab;
    user-select: none;
    font-size: 1.1429rem;
    line-height: 1;
}

.category-item .ci-drag:active {
    cursor: grabbing;
}

.category-item .ci-name {
    font-weight: 500;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
}

.category-item .ci-sort {
    color: #ff6b6b;
    font-weight: 600;
}

.category-item .ci-time {
    font-size: 0.9286rem;
    color: #888;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.category-item .ci-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.category-item .ci-action .btn-success,
.category-item .ci-action .btn-danger {
    padding: 5px 12px;
    font-size: 0.8571rem;
    margin: 0;
    white-space: nowrap;
}

.category-card-mobile {
    position: relative;
}

.category-card-mobile .table-card-drag {
    position: absolute;
    top: 12px;
    right: 12px;
    color: #bbb;
    font-size: 1.1429rem;
    cursor: grab;
    user-select: none;
}

.category-card-mobile.dragging {
    opacity: 0.45;
}

.category-card-mobile.drag-over {
    box-shadow: 0 0 0 2px #ffb88c;
}

.category-grid-mobile {
    display: none;
}

.category-empty {
    text-align: center;
    padding: 40px 16px;
    color: #bbb;
}

@media (max-width: 768px) {
    .category-desktop {
        display: none;
    }

    .category-card {
        padding: 12px !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    .category-grid-mobile {
        display: grid;
    }

    .category-grid-mobile .table-card-title {
        font-size: 1.25rem;
        line-height: 1.35;
        word-break: break-all;
    }

    .category-grid-mobile .table-card-body {
        line-height: 1.5;
    }
}

/* 菜品管理 — 手机卡片列表 */
.dish-grid-mobile {
    display: none;
}

.dish-mobile-bar {
    display: none;
}

.dish-mobile-select-all {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9286rem;
    color: #666;
    cursor: pointer;
    user-select: none;
}

.dish-mobile-select-all input {
    width: 18px;
    height: 18px;
    accent-color: #ff6b6b;
}

.dish-mobile-selected-hint {
    margin-left: auto;
    font-size: 0.8571rem;
    color: #ff6b6b;
    font-weight: 500;
}

.dish-mobile-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #eef0f3;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.dish-mobile-card.selected {
    border-color: #ff6b6b;
    box-shadow: 0 2px 12px rgba(255, 107, 107, 0.15);
}

.dish-mobile-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px 0;
}

.dish-mobile-check {
    display: flex;
    align-items: center;
}

.dish-mobile-check input {
    width: 18px;
    height: 18px;
    accent-color: #ff6b6b;
}

.dish-mobile-seq {
    font-size: 0.7857rem;
    color: #999;
}

.dish-mobile-status {
    margin-left: auto;
    font-size: 0.7857rem;
    padding: 2px 8px;
    border-radius: 999px;
}

.dish-mobile-body {
    display: flex;
    gap: 12px;
    padding: 10px 12px;
}

.dish-mobile-img {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    border-radius: 10px;
    overflow: hidden;
    background: #f5f6f8;
    cursor: pointer;
}

.dish-mobile-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.dish-mobile-info {
    flex: 1;
    min-width: 0;
}

.dish-mobile-name {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    line-height: 1.35;
    word-break: break-word;
}

.dish-mobile-cat {
    margin-top: 4px;
    font-size: 0.7857rem;
    color: #888;
}

.dish-mobile-price-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

.dish-mobile-price {
    font-size: 1.0714rem;
    font-weight: 700;
    color: #ff6b6b;
}

.dish-price-edit-btn {
    padding: 2px 8px;
    font-size: 0.7857rem;
    color: #1890ff;
    background: rgba(24, 144, 255, 0.08);
    border: 1px solid rgba(24, 144, 255, 0.25);
    border-radius: 6px;
    cursor: pointer;
}

.dish-mobile-meta {
    margin-top: 6px;
    font-size: 0.7857rem;
    color: #999;
}

.dish-mobile-desc {
    margin-top: 8px;
    font-size: 0.8571rem;
    color: #888;
    line-height: 1.45;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dish-mobile-actions {
    display: flex;
    gap: 8px;
    padding: 0 12px 12px;
}

.dish-mobile-actions button {
    flex: 1 1 0;
    min-width: 0;
    padding: 8px 4px;
    font-size: 0.8571rem;
}

.dish-mobile-empty {
    text-align: center;
    padding: 40px 16px;
    color: #bbb;
    font-size: 0.9286rem;
}

@media (max-width: 768px) {
    #page-dish .dish-desktop {
        display: none;
    }

    #page-dish .dish-mobile-bar {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 0 0 10px;
    }

    #page-dish .dish-grid-mobile {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    #page-dish .card {
        padding: 12px !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    #page-dish #dishPagination {
        margin-top: 12px;
    }
}

/* 素材库筛选一行 */
#page-material .filter-bar,
#materialSelectorModal .filter-bar {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin-bottom: 12px;
    box-sizing: border-box;
}

#page-material .filter-bar-main,
.material-selector-grid ~ .filter-bar .filter-bar-main,
#materialSelectorModal .filter-bar-main {
    flex-wrap: nowrap;
    flex-direction: row;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

#page-material .filter-bar-main .filter-search-input,
#materialSelectorModal .filter-bar-main .filter-search-input {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
    max-width: 100%;
}

#page-material .filter-bar-main select,
#page-material .filter-bar-main .custom-select-wrapper,
#materialSelectorModal .filter-bar-main select,
#materialSelectorModal .filter-bar-main .custom-select-wrapper {
    flex: 0 1 auto;
    width: auto;
    min-width: 0;
    max-width: 38%;
}

#page-material .filter-bar-main .custom-select-trigger,
#materialSelectorModal .filter-bar-main .custom-select-trigger {
    min-width: 0;
    max-width: 100%;
    width: 100%;
}

.filter-search-input {
    flex: 1 1 180px;
    min-width: 0;
    max-width: 100%;
    padding: 10px 12px;
    border: 1px solid #e0e4e8;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: all 0.2s;
}

.filter-search-input:hover {
    border-color: #ff9a56;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.1);
}

.filter-search-input:focus {
    border-color: #ff6b6b;
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}

.filter-bar-main select,
.filter-bar-main .custom-select-wrapper {
    flex: 1 1 120px;
    min-width: 0;
    max-width: 100%;
}

.filter-bar select {
    padding: 10px 32px 10px 12px;
    border: 1px solid #e0e4e8;
    border-radius: 8px;
    font-size: 1rem;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat right 10px center;
    background-size: 14px;
    appearance: none;
    cursor: pointer;
    transition: all 0.2s;
    color: #333;
    min-width: 120px;
}

.filter-bar select:hover {
    border-color: #ff9a56;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.1);
}

.filter-bar select:focus {
    border-color: #ff6b6b;
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}

.filter-bar input[type="text"] {
    transition: all 0.2s;
}

.filter-bar input[type="text"]:hover {
    border-color: #ff9a56;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.1);
}

.filter-bar input[type="text"]:focus {
    border-color: #ff6b6b;
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}

#backToTopBtn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(255, 107, 107, 0.5);
}

.material-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.material-selector-grid {
    max-height: 60vh;
    overflow-y: auto;
}

.material-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #eee;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    position: relative;
    transition: transform 0.15s, box-shadow 0.15s;
    display: flex;
    flex-direction: column;
}

.material-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.material-card-img-wrap {
    position: relative;
    width: 100%;
    padding-top: 100%;
    background: #f5f5f5;
    overflow: hidden;
}

.material-card-img-wrap img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
}

.material-card-hover {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 0.7857rem;
    padding: 6px 8px;
    opacity: 0;
    transition: opacity 0.15s;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    line-height: 1.4;
}

.material-card-img-wrap:hover .material-card-hover {
    opacity: 1;
}

.material-card-hover .t1 {
    font-weight: bold;
    font-size: 0.8571rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.material-card-hover .t2 {
    opacity: 0.85;
    margin-top: 2px;
}

.material-card-body {
    padding: 8px 10px 10px;
}

.material-card-title {
    font-size: 0.9286rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.material-card-info {
    font-size: 0.7857rem;
    color: #999;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.material-card-actions {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
}

.material-card-actions button {
    flex: 1 1 0;
    min-width: 0;
    padding: 5px 4px;
    font-size: 0.7857rem;
    font-weight: normal;
    margin-right: 0;
    white-space: nowrap;
}

.material-card-actions .btn-edit {
    background: #fff;
    color: #555;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
}

.material-card-actions .btn-edit:hover {
    background: #f5f5f5;
    border-color: #bbb;
}

/* 图片预览弹窗：与批量分类等同系页眉 + 内容区放图 */
#imagePreviewModal {
    display: none;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 9999;
    padding: 16px;
    box-sizing: border-box;
}

#imagePreviewModal .image-preview-modal-box {
    width: min(880px, 94vw);
    max-width: 94vw;
    max-height: 90vh;
    min-width: 0;
    overflow: hidden;
}

#imagePreviewModal .image-preview-modal-header {
    background: var(--primary-header-gradient);
    color: var(--primary-on-color);
    padding: 16px 18px;
    border-bottom: none;
    font-size: 1.1429rem;
    flex-shrink: 0;
}

#imagePreviewModal .image-preview-modal-header .modal-close {
    color: var(--primary-on-color);
    opacity: 0.92;
    font-size: 1.8571rem;
}

#imagePreviewModal .image-preview-modal-header .modal-close:hover {
    color: var(--primary-on-color);
    opacity: 1;
}

#imagePreviewModal .image-preview-body {
    padding: 14px;
    background: #f5f7fa;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: calc(90vh - 58px);
    box-sizing: border-box;
}

#imagePreviewImg {
    max-width: 100%;
    max-height: calc(90vh - 86px);
    width: auto;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

/* 响应式 - 平板和手机 */
@media (max-width: 768px) {
    .sidebar {
        width: max-content;
        max-width: 85vw;
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
        z-index: 1100;
    }

    .content {
        margin-left: 0;
        padding: 12px;
    }

    .menu-toggle {
        display: block;
    }

    .staff-permission-grid {
        gap: 10px;
    }

    .staff-card-head {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .staff-card-avatar {
        width: 44px;
        height: 44px;
    }

    .staff-card-avatar .chat-avatar-fallback {
        font-size: 1.05rem;
    }

    .staff-card-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .staff-add-btn {
        padding: 8px 12px;
        font-size: 0.93rem;
    }

    .sms-code-row .sms-code-input-wrap {
        flex-direction: column;
        align-items: stretch;
    }

    .sms-code-row .sms-code-input-wrap button {
        width: 100%;
    }

    .logo {
        font-size: 1.14rem;
        padding: 16px 20px;
    }

    .page-header {
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
    }

    .page-header h2 {
        font-size: 1.29rem;
        margin-bottom: 0;
        flex: 1;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: normal;
        word-break: break-word;
    }

    .page-header > div:last-child {
        flex-shrink: 0;
    }

    .page-header .btn-primary,
    .page-header .btn-default {
        padding: 8px 12px;
        font-size: 0.93rem;
        white-space: nowrap;
    }

    .filter-bar {
        flex-wrap: wrap;
        gap: 8px;
        width: 100%;
    }

    .filter-bar-main {
        width: 100%;
        flex: 1 1 100%;
        flex-wrap: nowrap;
        flex-direction: row;
        align-items: center;
    }

    .filter-bar-main .filter-search-input {
        flex: 1 1 auto;
        width: auto;
        min-width: 0;
        max-width: none;
    }

    .filter-bar-main select,
    .filter-bar-main .custom-select-wrapper {
        flex: 0 1 auto;
        width: auto;
        min-width: 0;
        max-width: 38%;
        font-size: 0.8571rem;
    }

    #page-material .filter-bar-main .custom-select-trigger,
    #materialSelectorModal .filter-bar-main .custom-select-trigger {
        padding: 8px 24px 8px 8px;
        min-width: 0;
    }

    .filter-bar-main select {
        padding: 8px 24px 8px 8px;
    }

    .material-batch-bar {
        margin: 0 0 12px;
        padding: 10px;
        gap: 8px;
    }

    .material-batch-count {
        font-size: 0.8125rem;
    }

    .material-batch-btns {
        gap: 6px;
        justify-content: stretch;
    }

    .material-batch-btn {
        flex: 1 1 0;
        min-width: 0;
        min-height: 40px;
        padding: 8px 4px;
        font-size: 0.8125rem;
    }

    .dish-add-btn {
        padding: 8px 12px;
        font-size: 0.86rem;
    }

    .dish-toolbar {
        padding: 10px 12px !important;
    }

    .filter-bar > select,
    .filter-bar > input[type="text"],
    .filter-bar > input[type="date"] {
        flex: 1 1 100%;
        min-width: 0;
        max-width: 100%;
        font-size: 1rem;
        padding: 10px 12px;
    }

    .filter-bar > button {
        flex-shrink: 0;
        padding: 10px 16px;
        font-size: 0.93rem;
    }

    /* 菜品筛选：手机两行 — 分类+搜索一行，批量按钮一行（不影响电脑端） */
    .filter-bar.dish-filter-bar {
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
    }

    .filter-bar.dish-filter-bar > select,
    .filter-bar.dish-filter-bar > .custom-select-wrapper {
        flex: 0 0 auto;
        width: auto;
        min-width: 6.5rem;
        max-width: 42%;
    }

    .filter-bar.dish-filter-bar > .custom-select-wrapper .custom-select-trigger {
        font-size: 0.9286rem;
        padding: 10px 2rem 10px 10px;
    }

    .filter-bar.dish-filter-bar > .dish-search-input {
        flex: 1 1 0;
        width: auto;
        min-width: 0;
        max-width: none;
        font-size: 0.9286rem;
        padding: 10px 12px;
    }

    .filter-bar.dish-filter-bar .dish-filter-actions {
        flex: 1 1 100%;
        width: 100%;
        margin-left: 0;
        gap: 8px;
    }

    .filter-bar.dish-filter-bar .dish-filter-actions .batch-btn {
        flex: 1 1 0;
        min-width: 0;
        padding: 10px 6px;
        font-size: 0.8571rem;
    }

    /* 表格容器优化 */
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 8px;
        border: 1px solid #f0f2f5;
    }

    table {
        min-width: 768px;
        width: 100%;
    }

    table th, table td {
        padding: 10px 8px;
        font-size: 0.93rem;
        white-space: nowrap;
    }

    table th {
        font-size: 0.86rem;
    }

    /* 按钮样式优化 */
    .btn-primary {
        padding: 10px 16px;
        font-size: 1rem;
    }

    .btn-default {
        margin-right: 6px;
        padding: 10px 14px;
    }

    /* 手机端弹窗：居中紧凑小框，不全屏 */
    .modal {
        padding: 16px;
        align-items: center;
        justify-content: center;
    }

    .modal-box {
        width: 100%;
        max-width: 420px;
        height: auto;
        max-height: calc(100vh - 32px);
        border-radius: 12px;
    }

    /* 内容较多的弹窗稍宽一点 */
    #materialSelectorModal .modal-box,
    #dishCategoryModal .modal-box,
    #materialEditModal .modal-box {
        max-width: min(92vw, 520px);
    }

    /* 图片预览弹窗窄屏适配 */
    #imagePreviewModal {
        padding: 12px;
    }

    #imagePreviewModal .image-preview-modal-box {
        width: 96vw;
        max-width: 96vw;
    }

    #imagePreviewModal .image-preview-body {
        padding: 10px;
        max-height: calc(90vh - 52px);
    }

    #imagePreviewImg {
        max-height: calc(90vh - 72px);
    }

    .modal-header {
        padding: 14px 16px;
        font-size: 1.07rem;
    }

    .modal-body {
        padding: 16px;
    }

    .modal-footer {
        padding: 12px 16px;
    }

    /* 二维码图片缩小 */
    .qr-body img {
        width: 200px;
        height: 200px;
    }

    /* 桌号网格调整 */
    .table-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px;
    }

    .table-card {
        padding: 14px;
    }

    .table-card-title {
        font-size: 1.43rem;
    }

    /* 素材库网格调整 */
    .material-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .material-card-actions {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 4px;
    }

    .material-card-actions button {
        padding: 8px 4px;
        font-size: 0.8571rem;
        min-height: 34px;
    }

    .material-card-title {
        font-size: 0.8571rem;
    }

    .material-selector-grid {
        max-height: calc(100vh - 180px);
    }

    /* 设置页 */
    .settings-section {
        padding: 16px;
    }

    /* 设置顶栏 Tab：整组居中；压缩 Tab 之间空隙，避免贴边被裁 */
    .settings-tabs {
        display: flex;
        justify-content: center;
        align-items: center;
        flex-wrap: nowrap;
        gap: 0;
        margin: 0 -2px 16px;
        padding: 0 0 12px;
        overflow: visible;
    }

    .settings-tabs .tab-item {
        box-sizing: border-box;
        flex: 0 0 auto;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin: 0;
        padding: 8px 6px;
        font-size: 0.9rem;
        line-height: 1.35;
        text-align: center;
        white-space: nowrap;
        overflow: visible;
        border-radius: 10px;
        /* 只过渡颜色，避免 padding 变化导致气泡缓慢撑开 */
        transition: color 0.15s ease, background 0.15s ease;
    }

    /* 选中与未选中同宽内边距，点击瞬间到位 */
    .settings-tabs .tab-item.active {
        padding-left: 6px;
        padding-right: 6px;
    }

    .admin-profile-avatar-row {
        gap: 14px;
    }

    .admin-profile-avatar-btn {
        width: 72px;
        height: 72px;
        font-size: 1.6rem;
    }

    .admin-profile-avatar-badge {
        width: 22px;
        height: 22px;
        line-height: 22px;
        font-size: 10px;
    }

    .admin-profile-name {
        font-size: 1.1rem;
    }

    .admin-profile-info-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .admin-profile-actions .btn-primary,
    .admin-profile-actions .admin-profile-action-btn {
        width: 100%;
    }

    .user-info {
        padding: 12px 14px;
        gap: 8px;
    }

    .user-info-avatar {
        width: 28px;
        height: 28px;
        font-size: 0.78rem;
    }

    .user-info #usernameShow {
        font-size: 0.9rem;
    }

    .theme-option {
        flex: 1 1 0;
        min-width: 0;
        padding: 14px 10px;
    }

    .theme-options {
        flex-wrap: nowrap;
        gap: 10px;
    }

    .theme-preview {
        width: 72px;
        height: 72px;
    }

    .theme-option span {
        font-size: 0.9286rem;
    }

    .theme-options,
    .font-size-options,
    .theme-color-picker {
        gap: 12px;
    }

    .color-picker-panel {
        padding: 14px;
    }

    .color-picker-sv {
        height: 180px;
    }

    .color-picker-hue {
        height: 40px;
    }

    .color-picker-apply-btn {
        min-width: 64px;
        padding: 0 12px;
    }

    .font-option {
        flex: 1 1 0;
        min-width: 0;
        padding: 14px 6px;
    }

    .font-option span {
        font-size: 0.9286rem;
    }

    .support-cards-container {
        flex-direction: column;
    }

    .support-card {
        width: 100%;
    }

    /* 经营报表 */
    .revenue-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .revenue-stat-card {
        padding: 10px 12px;
    }

    .revenue-stat-value {
        font-size: 1.1429rem;
    }

    .revenue-stat-compare {
        font-size: 0.6429rem;
        padding: 2px 6px;
    }

    .revenue-chart-header,
    .revenue-history-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .revenue-history-filter {
        width: 100%;
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        gap: 8px;
    }

    .date-range-inline input[type="date"] {
        flex: 1 1 0;
        min-width: 0;
        padding: 8px 4px;
        font-size: 0.8571rem;
    }

    .revenue-history-filter .btn-compact {
        flex-shrink: 0;
        width: auto;
        padding: 8px 14px !important;
    }

    .revenue-chart-tabs {
        width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
    }

    .chart-tab {
        flex-shrink: 0;
    }

    .revenue-chart-wrap {
        height: 240px;
    }

    .revenue-history-table table {
        min-width: 520px;
    }

    .order-header {
        padding: 12px 14px;
    }

    .order-hd-top {
        margin-bottom: 8px;
    }

    .order-hd-meta {
        gap: 6px 8px;
    }

    .order-detail {
        padding: 12px 14px;
    }

    .order-item-row {
        padding: 12px;
    }

    .items-section {
        padding: 12px;
    }

    /* 登录页调整 */
    .login-box {
        width: 90%;
        max-width: 360px;
        padding: 24px 20px;
    }

    .login-actions-row {
        margin-bottom: 16px;
        flex-wrap: nowrap;
        gap: 10px;
    }

    .login-forgot-link {
        font-size: 0.86rem;
        margin-left: auto;
    }

    .login-box h1 {
        font-size: 1.43rem;
    }

    /* 操作按钮调整 */
    .table td:last-child {
        white-space: nowrap;
    }

    .table td:last-child button {
        display: inline-block;
        margin-bottom: 4px;
        margin-right: 4px;
        padding: 4px 8px;
        font-size: 0.86rem;
    }

}

/* 超小屏幕优化 */
@media (max-width: 480px) {
    .content {
        padding: 8px;
    }

    .card {
        padding: 10px;
    }

    .page-header {
        gap: 6px;
    }

    .page-header h2 {
        font-size: 1.07rem;
    }

    .settings-tabs {
        gap: 0;
        margin-left: -4px;
        margin-right: -4px;
    }

    .settings-tabs .tab-item,
    .settings-tabs .tab-item.active {
        padding: 8px 4px;
    }

    table th, table td {
        padding: 6px 6px;
        font-size: 0.86rem;
    }

    table th {
        font-size: 0.79rem;
    }

    .form-item input, .form-item textarea, .form-item select {
        padding: 8px 10px;
        font-size: 1rem;
    }

    .btn-default, .btn-danger, .btn-success {
        padding: 5px 8px;
        font-size: 0.79rem;
    }

    /* 弹窗底部按钮保持统一大小，不受上面全局缩小影响 */
    .modal-footer > button {
        padding: 10px 12px;
        font-size: 0.93rem;
        min-height: 44px;
    }

    .filter-bar select,
    .filter-bar input {
        padding: 8px 10px;
        font-size: 0.93rem;
    }

    .filter-bar button {
        padding: 8px 12px;
        font-size: 0.86rem;
    }

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

    .material-card-body {
        padding: 6px 8px 8px;
    }

    .material-card-actions button {
        font-size: 0.7857rem;
        min-height: 32px;
        padding: 6px 2px;
    }

    .revenue-chart-wrap {
        height: 220px;
    }

    .revenue-stat-compare {
        font-size: 0.6429rem;
        display: block;
        margin-top: 6px;
    }

    .theme-option {
        flex: 1 1 0;
        min-width: 0;
        padding: 12px 8px;
    }

    .theme-preview {
        width: 64px;
        height: 64px;
    }

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

    .order-filter-card {
        padding: 12px;
    }

    .order-filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .date-quick-btns {
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 6px;
        width: 100%;
    }

    .date-quick-btn {
        padding: 8px 0;
        font-size: 0.8rem;
        text-align: center;
        min-width: 0;
    }

    .date-picker-wrapper,
    .order-date-wrap {
        width: 100%;
        min-width: 0;
    }

    /* 分页样式 - 移动端单行 flex，禁止按钮撑满 */
    #dishPagination,
    .revenue-history-pagination,
    .member-list-pager,
    .operation-log-pager {
        padding: 0 4px 8px;
        overflow: visible;
    }

    .admin-pager,
    .admin-pager-bar,
    .revenue-page-bar {
        --admin-pager-h: 32px;
        --admin-pager-item-w: 56px;
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: center;
        gap: 4px;
        width: 100%;
        max-width: 100%;
        padding: 8px 6px;
        margin-top: 12px;
        box-sizing: border-box;
        background: linear-gradient(180deg, #fafbfc 0%, #f3f5f7 100%);
        border: 1px solid #e8ebef;
        border-radius: 10px;
        overflow: visible;
        -webkit-overflow-scrolling: touch;
    }

    .admin-pager-bar {
        padding-top: 10px;
        border-top: none;
    }

    .operation-log-pager-inner {
        margin-top: 0;
        padding-top: 10px;
        border-top: none;
    }

    .pager-info-full {
        display: none;
    }

    .pager-info-short {
        display: inline;
    }

    .admin-pager .admin-pager-btn,
    .admin-pager-bar .admin-pager-btn,
    .revenue-page-bar .admin-pager-btn,
    .admin-pager .btn-default,
    .admin-pager-bar .btn-default,
    .revenue-page-bar .btn-default,
    .operation-log-pager-inner .btn-default {
        flex: 0 0 var(--admin-pager-item-w);
        width: var(--admin-pager-item-w);
        min-width: var(--admin-pager-item-w);
        max-width: var(--admin-pager-item-w);
        height: var(--admin-pager-h);
        min-height: var(--admin-pager-h);
        max-height: var(--admin-pager-h);
        padding: 0 4px;
        margin: 0;
        font-size: 0.78rem;
        line-height: 1.2;
        color: #555;
        border: 1px solid #e0e4e8;
        background: #fff;
        border-radius: 8px;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .admin-page-info,
    .revenue-page-num,
    .operation-log-page-info {
        flex: 0 1 auto;
        min-width: 0;
        text-align: center;
        font-size: 0.76rem;
        line-height: 1.2;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        color: #666;
    }

    .admin-page-size {
        flex: 0 0 auto;
        width: auto;
        min-width: 0;
        max-width: none;
        margin: 0;
        height: var(--admin-pager-h);
        gap: 0;
        justify-content: stretch;
    }

    .admin-page-size-label {
        display: none;
    }

    .admin-page-size-box {
        flex: 0 0 var(--admin-pager-item-w);
        width: var(--admin-pager-item-w);
        min-width: var(--admin-pager-item-w);
        max-width: var(--admin-pager-item-w);
        height: var(--admin-pager-h);
        min-height: var(--admin-pager-h);
        max-height: var(--admin-pager-h);
    }

    .admin-page-size-box .custom-select-trigger,
    .admin-page-size-box .admin-page-size-select {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        height: var(--admin-pager-h) !important;
        min-height: var(--admin-pager-h) !important;
        max-height: var(--admin-pager-h) !important;
        padding: 0 14px 0 2px !important;
        font-size: 0.78rem !important;
        line-height: var(--admin-pager-h) !important;
        border-radius: 8px !important;
        background-color: #fff !important;
        border: 1px solid #e0e4e8 !important;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
        background-repeat: no-repeat !important;
        background-position: right 4px center !important;
        background-size: 10px !important;
        text-align: center;
        overflow: hidden;
    }

    .admin-page-size-box .custom-select-trigger-text {
        text-align: center;
        font-size: 0.78rem;
    }

    .admin-page-size-box .custom-select-trigger.is-open,
    .admin-page-size-box .custom-select-trigger:focus-visible {
        border-color: #ff9a56 !important;
        box-shadow: 0 0 0 2px rgba(255, 154, 86, 0.15) !important;
    }

    .date-quick-btn {
        padding: 6px 12px;
        font-size: 0.86rem;
    }

    .order-daily-no {
        font-size: inherit;
    }

    .order-daily-no .order-no-sub {
        display: none;
    }
}

/* ========== 订单卡片样式（字号均用 rem，跟随设置页字体档位） ========== */
#page-order {
    font-size: 1rem;
}

#orderListContainer {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-bottom: 16px;
}

.order-day-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.order-day-header {
    margin: 16px 0 0;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(255, 154, 86, 0.14) 0%, rgba(255, 107, 107, 0.1) 100%);
    border-left: 4px solid #ff6b6b;
    border-radius: 8px;
    font-size: 1.07rem;
    font-weight: 600;
    color: #333;
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: opacity 0.2s, background 0.2s;
}

.order-day-header:hover {
    opacity: 0.95;
}

.order-day-header:active {
    opacity: 0.88;
}

.order-day-header:first-child,
.order-day-group:first-child .order-day-header {
    margin-top: 0;
}

.order-day-header-title {
    flex: 1;
    min-width: 0;
}

.order-day-header-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.order-day-header-count {
    font-size: 0.857rem;
    font-weight: 500;
    color: #888;
}

.order-day-header-arrow {
    font-size: 0.786rem;
    color: #999;
    width: 18px;
    text-align: center;
    transition: transform 0.2s;
}

.order-day-header.is-collapsed {
    opacity: 0.85;
}

.order-day-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 订单日期筛选栏 */
.order-filter-card {
    padding: 14px 16px;
    border: 1px solid #eef0f3;
    border-radius: 12px;
    background: linear-gradient(180deg, #fafbfc 0%, #fff 100%);
}

.order-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.date-quick-btns {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1 1 auto;
    min-width: 0;
}

.date-quick-btn {
    padding: 8px 16px;
    border: 1px solid #e0e4e8;
    background: #fff;
    border-radius: 10px;
    font-size: 0.9rem;
    color: #666;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, background 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}

.date-quick-btn:hover {
    border-color: #ff9a56;
    color: #ff6b6b;
    background: #fff5f5;
}

.date-quick-btn.active {
    background: linear-gradient(135deg, #ff9a56 0%, #ff6b6b 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.25);
    font-weight: 500;
}

.date-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 1px solid #e0e4e8;
    border-radius: 10px;
    padding: 0 12px;
    min-height: 40px;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.date-picker-wrapper:hover {
    border-color: #ff9a56;
}

.date-picker-wrapper:focus-within {
    border-color: #ff6b6b;
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}

.date-icon {
    flex-shrink: 0;
    font-size: 0.95rem;
    line-height: 1;
}

.date-picker-wrapper input,
.date-picker-wrapper input[type="date"],
.date-picker-wrapper input[type="text"],
.date-picker-wrapper .admin-date-input {
    flex: 1;
    min-width: 0;
    width: 100%;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
    padding: 0;
    margin: 0;
    height: 38px;
    line-height: 38px;
    font-size: 0.92rem;
    color: #333;
    cursor: pointer;
    font-family: inherit;
    border-radius: 0;
}

.order-date-wrap {
    flex: 0 0 auto;
    min-width: 148px;
}

.order-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    border: 1px solid #f0f2f5;
}

.order-header {
    padding: 14px 16px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.order-header:hover {
    background-color: #fafbfc;
}

.order-hd-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.order-hd-title {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.order-hd-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

#page-order .order-daily-no {
    font-size: 1.143rem;
    font-weight: 600;
    color: #333;
}

#page-order .order-daily-no .order-no-sub,
#page-order .order-no-sub {
    font-size: 0.786rem;
    color: #999;
    font-weight: normal;
    background: #f5f7fa;
    padding: 2px 8px;
    border-radius: 4px;
    word-break: break-all;
}

#page-order .order-amount {
    font-size: 1.286rem;
    font-weight: 700;
    color: #ff6b6b;
    white-space: nowrap;
}

#page-order .order-amount-refund {
    font-size: 0.786rem;
    font-weight: 600;
    color: #cf1322;
    text-align: right;
    margin-top: 2px;
    white-space: nowrap;
}

.order-hd-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
}

#page-order .order-table-tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    background: linear-gradient(135deg, #ff9a56 0%, #ff6b6b 100%);
    color: #fff;
    font-size: 0.929rem;
    font-weight: 600;
    white-space: nowrap;
}

#page-order .order-aggregate-tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    background: #f0e6ff;
    color: #722ed1;
    border: 1px solid #d3adf7;
    font-size: 0.857rem;
    font-weight: 600;
    white-space: nowrap;
}

#page-order .order-source-tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.857rem;
    font-weight: 600;
    white-space: nowrap;
}

#page-order .order-source-tag.order-source-mp {
    background: #e8f7ef;
    color: #1aad19;
    border: 1px solid #b7e4c7;
}

#page-order .order-source-tag.order-source-h5 {
    background: #eef3ff;
    color: #4b6bfb;
    border: 1px solid #c9d5ff;
}

#page-order .order-status-tag .status-paid,
#page-order .order-status-tag .status-unpaid,
#page-order .order-status-tag .status-done,
#page-order .order-status-tag .status-closed {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.857rem;
    font-weight: 500;
}

.order-status-tag .status-paid {
    background: #f6ffed;
    color: #389e0d;
    border: 1px solid #b7eb8f;
}

.order-status-tag .status-done {
    background: #fafafa;
    color: #595959;
    border: 1px solid #d9d9d9;
}

.order-status-tag .status-unpaid {
    background: #fff1f0;
    color: #cf1322;
    border: 1px solid #ffa39e;
}

.order-status-tag .status-closed {
    background: #f5f5f5;
    color: #999;
    border: 1px solid #e8e8e8;
}

#page-order .order-time {
    font-size: 0.857rem;
    color: #999;
}

.order-customer-count {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.785rem;
    line-height: 1.4;
    white-space: nowrap;
    color: #595959;
    background: #f5f5f5;
    border: 1px solid #e8e8e8;
}

.order-customer-count--new {
    color: #1677ff;
    background: #e6f4ff;
    border: 1px solid #91caff;
    font-weight: 600;
}

#page-order .expand-icon {
    font-size: 0.857rem;
    color: #bbb;
    transition: transform 0.2s;
    width: 1.714rem;
    height: 1.714rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f7fa;
    border-radius: 50%;
    flex-shrink: 0;
}

.order-detail {
    border-top: 1px dashed #e8eaed;
    padding: 16px 20px;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.detail-section {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f5f7fa;
    margin-bottom: 16px;
}

.detail-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

#page-order .detail-label {
    font-size: 0.929rem;
    color: #999;
}

#page-order .detail-value {
    font-size: 0.929rem;
    color: #333;
    font-weight: 500;
}

/* 支付方式着色：微信绿 / 支付宝蓝 */
#page-order .pay-method-wechat {
    color: #07c160;
    font-weight: 700;
}

#page-order .pay-method-alipay {
    color: #1677ff;
    font-weight: 700;
}

#page-order .pay-method-mock {
    color: #8c8c8c;
    font-weight: 600;
}

/* 备注单独占一整行（与安卓窄屏换行效果一致） */
#page-order .detail-row--remark {
    flex: 1 1 100%;
    width: 100%;
}

#page-order .order-remark {
    display: block;
    width: 100%;
    box-sizing: border-box;
    background: #fff7e6;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.5;
    color: #d46b08;
    margin-top: 0;
}

.order-invoice-section {
    margin-top: 12px;
    padding: 12px 14px;
    background: #f6ffed;
    border: 1px solid #b7eb8f;
    border-radius: 10px;
}

/* 商家端 PC：开票行可换行，复制按钮不被挤没 */
@media (max-width: 768px) {
    #page-invoice .order-invoice-row {
        align-items: flex-start;
    }

    #page-invoice .order-invoice-copy-btn {
        margin-left: auto;
    }
}

.order-invoice-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.order-invoice-row {
    flex-wrap: wrap;
    margin-top: 6px;
}

.order-invoice-value {
    flex: 1;
    min-width: 0;
    word-break: break-all;
}

.order-invoice-copy-btn,
.order-invoice-copy-all-btn {
    border: 1px solid #95de64;
    background: #fff;
    color: #389e0d;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
}

.order-invoice-copy-all-btn {
    background: #389e0d;
    color: #fff;
    border-color: #389e0d;
}

.order-invoice-upload {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed #d9f7be;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.order-invoice-upload--done {
    flex-direction: column;
    align-items: flex-start;
}

.order-invoice-upload-btn,
.order-invoice-reupload-btn {
    display: inline-block;
    padding: 6px 14px;
    background: #389e0d;
    color: #fff;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
}

.order-invoice-upload-hint,
.order-invoice-upload-hint-only {
    font-size: 12px;
    color: #666;
    width: 100%;
}

.order-invoice-file-link {
    color: #1890ff;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font: inherit;
    font-weight: 500;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.order-invoice-file-link:hover {
    color: #096dd9;
}

/* 页内预览发票文件：与系统弹窗同系页眉 */
.invoice-file-preview-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10020;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.45);
    box-sizing: border-box;
    overscroll-behavior: none;
}

.invoice-file-preview-modal-box {
    width: min(880px, 94vw) !important;
    max-width: 94vw !important;
    max-height: 90vh;
    min-width: 0 !important;
    overflow: hidden !important;
}

.invoice-file-preview-header {
    background: var(--primary-header-gradient);
    color: var(--primary-on-color);
    padding: 16px 18px;
    border-bottom: none;
    font-size: 1.1429rem;
    flex-shrink: 0;
}

.invoice-file-preview-header .modal-close {
    color: var(--primary-on-color);
    opacity: 0.92;
    font-size: 1.8571rem;
}

.invoice-file-preview-header .modal-close:hover {
    color: var(--primary-on-color);
    opacity: 1;
}

.invoice-file-preview-body {
    padding: 14px;
    background: #f5f7fa;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: calc(90vh - 58px);
    box-sizing: border-box;
}

.invoice-file-preview-img {
    display: none;
    max-width: 100%;
    max-height: calc(90vh - 86px);
    margin: 0 auto;
    object-fit: contain;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.invoice-file-preview-frame {
    display: none;
    width: 100%;
    height: calc(90vh - 86px);
    border: 0;
    background: #fff;
    border-radius: 6px;
}

.order-invoice-issued-time {
    font-size: 12px;
    color: #888;
}

/* 发票管理页 */
#page-invoice .invoice-status-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

#page-invoice .invoice-status-btn {
    border: 1px solid #d9d9d9;
    background: #fff;
    color: #595959;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
}

#page-invoice .invoice-status-btn.active {
    border-color: #52c41a;
    background: #f6ffed;
    color: #389e0d;
    font-weight: 600;
}

#page-invoice .invoice-card {
    margin-bottom: 12px;
}

#page-invoice .invoice-card-head {
    margin-bottom: 10px;
}

#page-invoice .invoice-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

#page-invoice .invoice-order-no {
    font-weight: 600;
    font-size: 1rem;
    color: #333;
}

#page-invoice .invoice-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 6px;
    font-size: 13px;
    color: #666;
}

.invoice-status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.invoice-status-badge--pending {
    background: #fff1f0;
    color: #cf1322;
    border: 1px solid #ffa39e;
}

#page-invoice .invoice-status-btn#invoiceStatusBtn-pending {
    color: #cf1322;
    border-color: #ffa39e;
}

#page-invoice .invoice-status-btn#invoiceStatusBtn-pending.active {
    border-color: #ff4d4f;
    background: #fff1f0;
    color: #cf1322;
    font-weight: 600;
}

.invoice-status-badge--done {
    background: #f6ffed;
    color: #389e0d;
    border: 1px solid #b7eb8f;
}

.items-section {
    background: #fafbfc;
    border-radius: 8px;
    padding: 16px;
}

.items-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e8eaed;
}

#page-order .items-title {
    font-size: 1rem;
    font-weight: bold;
    color: #333;
}

#page-order .items-count {
    font-size: 0.857rem;
    color: #999;
}

.items-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.items-list--grouped {
    gap: 14px;
}

.order-owner-group {
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e8e8e8;
    background: #fafafa;
}

.order-owner-group--payer {
    border-color: #d3adf7;
    background: #fcfbff;
}

.order-owner-group--peer {
    border-color: #ffd591;
    background: #fffcf7;
}

.order-owner-group-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.order-owner-group--payer .order-owner-group-head {
    background: #f9f0ff;
    border-bottom-color: #efdbff;
}

.order-owner-group--peer .order-owner-group-head {
    background: #fff7e6;
    border-bottom-color: #ffe7ba;
}

.order-owner-role {
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
}

.order-owner-group--payer .order-owner-role {
    color: #722ed1;
    background: #fff;
    border: 1px solid #d3adf7;
}

.order-owner-group--peer .order-owner-role {
    color: #d46b08;
    background: #fff;
    border: 1px solid #ffd591;
}

.order-owner-phone {
    font-size: 13px;
    color: #333;
    font-weight: 500;
}

.order-owner-count {
    font-size: 12px;
    color: #999;
}

.order-owner-subtotal {
    margin-left: auto;
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

.order-owner-group-body {
    display: flex;
    flex-direction: column;
}

.order-owner-group-body .order-item-row {
    background: transparent;
    border-radius: 0;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.order-owner-group-body .order-item-row:last-child {
    border-bottom: none;
}

.order-item-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 12px 14px;
    background: #fff;
    border-radius: 8px;
}

.order-item-row .item-main {
    width: 100%;
}

.item-owner-tag {
    display: inline-block;
    margin-right: 6px;
    margin-bottom: 4px;
    padding: 2px 8px;
    font-size: 11px;
    border-radius: 4px;
    vertical-align: middle;
    font-weight: 600;
    white-space: nowrap;
}

.item-owner-tag--payer {
    color: #722ed1;
    background: #f9f0ff;
    border: 1px solid #d3adf7;
}

.item-owner-tag--peer {
    color: #d46b08;
    background: #fff7e6;
    border: 1px solid #ffd591;
}

.item-refund-tag {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 8px;
    font-size: 11px;
    line-height: 1.4;
    border-radius: 4px;
    font-weight: 700;
    vertical-align: middle;
    white-space: nowrap;
}

.item-refund-tag--full {
    color: #cf1322;
    background: #fff1f0;
    border: 1px solid #ffa39e;
}

.item-refund-tag--partial {
    color: #d48806;
    background: #fffbe6;
    border: 1px solid #ffe58f;
}

.order-item-row.is-refunded .item-name {
    color: #8c8c8c;
    text-decoration: line-through;
}

.order-item-row.is-refunded .item-meta {
    opacity: 0.65;
}

.order-item-row .item-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
}

#page-order .item-name {
    display: block;
    font-size: 1rem;
    font-weight: 500;
    color: #333;
    line-height: 1.45;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}

/* 规格/小料：与顾客端一致展示，长文案在安卓/PC 均可换行 */
#page-order .item-spec,
.order-item-row .item-spec {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 0;
    font-size: 0.857rem;
    font-weight: 400;
    color: #8c8c8c;
    line-height: 1.5;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.order-item-row.is-refunded .item-spec {
    color: #bfbfbf;
    text-decoration: none;
}

.refund-item-spec {
    display: block;
    margin: 4px 0 2px;
    font-size: 12px;
    color: #8c8c8c;
    line-height: 1.45;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}

#page-order .item-price {
    font-size: 0.929rem;
    color: #888;
    white-space: nowrap;
    flex-shrink: 0;
}

#page-order .item-quantity {
    font-size: 0.929rem;
    color: #999;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 1.714rem;
    text-align: center;
}

#page-order .item-quantity-high {
    color: #f56c6c;
    font-weight: 700;
    font-size: 1.143rem;
}

#page-order .item-subtotal {
    font-size: 1.071rem;
    font-weight: bold;
    color: #ff6b6b;
    min-width: 4.571rem;
    text-align: right;
    white-space: nowrap;
    flex-shrink: 0;
}

.status-done {
    color: #595959;
    font-weight: bold;
}

.status-pending {
    color: #999;
}

.btn-serve {
    padding: 6px 14px;
    font-size: 0.9286rem;
}

.btn-refund {
    margin-left: 8px;
    padding: 6px 14px;
    font-size: 0.9286rem;
    color: #cf1322;
    background: #fff;
    border: 1px solid #ffa39e;
    border-radius: 6px;
    cursor: pointer;
}

.btn-refund:hover {
    background: #fff1f0;
}

/* 订单手动打印：高度与退款一致，可略宽以容纳图标 */
.btn-order-print {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin: 0;
    padding: 6px 14px;
    font-size: 0.9286rem;
    line-height: 1.2;
    color: #434343;
    background: #fff;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    cursor: pointer;
    box-sizing: border-box;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.btn-order-print-svg {
    display: block;
    flex-shrink: 0;
}

.btn-order-print:hover {
    border-color: #ff6b6b;
    color: #ff6b6b;
    background: #fff5f5;
}

@media (max-width: 768px) {
    .detail-value--actions {
        width: 100%;
        margin-top: 4px;
    }

    .detail-value--actions .btn-serve,
    .detail-value--actions .btn-order-print,
    .detail-value--actions .btn-refund {
        margin-left: 0;
        margin-right: 0;
    }
}

body.dark-theme .btn-order-print {
    background: #1f1f1f;
    border-color: #444;
    color: #e5e7eb;
}

body.dark-theme .btn-order-print:hover {
    border-color: #ff6b6b;
    color: #ff8a8a;
    background: #2a1a1a;
}

.detail-value--actions {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.detail-value--actions .btn-refund,
.detail-value--actions .btn-order-print {
    margin-left: 0;
}

.detail-value--refund {
    color: #cf1322;
}

.status-refunded {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: #cf1322;
    background: #fff1f0;
    border: 1px solid #ffa39e;
}

.status-refund-partial {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: #d46b08;
    background: #fff7e6;
    border: 1px solid #ffd591;
}

.pay-method-balance {
    color: #08979c;
    background: #e6fffb;
    border: 1px solid #87e8de;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 12px;
}

.refund-summary {
    margin-bottom: 12px;
    padding: 10px 12px;
    background: #fafafa;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.6;
    color: #595959;
}

.refund-summary-payer {
    margin-top: 4px;
    color: #cf1322;
    font-weight: 600;
}

.refund-type-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.refund-type-btn {
    flex: 1;
    padding: 8px 0;
    border: 1px solid #d9d9d9;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}

.refund-type-btn.is-active {
    color: #cf1322;
    border-color: #ff7875;
    background: #fff1f0;
    font-weight: 600;
}

.refund-full-tip {
    padding: 12px;
    background: #fffbe6;
    border: 1px solid #ffe58f;
    border-radius: 8px;
    font-size: 13px;
    color: #874d00;
    margin-bottom: 12px;
}

.refund-type-body {
    margin-bottom: 4px;
}

.refund-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.refund-field-label {
    font-size: 13px;
    font-weight: 600;
    color: #262626;
    line-height: 1.4;
}

.refund-optional {
    margin-left: 4px;
    font-size: 12px;
    font-weight: 400;
    color: #8c8c8c;
}

.refund-field-hint {
    font-size: 12px;
    color: #8c8c8c;
    line-height: 1.4;
}

.refund-field-input {
    width: 100%;
    box-sizing: border-box;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    background: #fff;
    font-size: 14px;
    color: #262626;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.refund-field-input::placeholder {
    color: #bfbfbf;
}

.refund-field-input:hover {
    border-color: #ff9c9c;
}

.refund-field-input:focus {
    border-color: #ff7875;
    box-shadow: 0 0 0 2px rgba(255, 120, 117, 0.18);
}

.refund-amount-input-wrap {
    display: flex;
    align-items: center;
    height: 44px;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.refund-amount-input-wrap:hover {
    border-color: #ff9c9c;
}

.refund-amount-input-wrap:focus-within {
    border-color: #ff7875;
    box-shadow: 0 0 0 2px rgba(255, 120, 117, 0.18);
}

.refund-amount-prefix {
    flex-shrink: 0;
    width: 40px;
    height: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff1f0;
    color: #cf1322;
    font-size: 15px;
    font-weight: 700;
    border-right: 1px solid #ffccc7;
}

.refund-amount-input {
    flex: 1;
    height: 100%;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 0 12px;
}

.refund-amount-input:hover,
.refund-amount-input:focus {
    border: none !important;
    box-shadow: none !important;
}

/* 去掉 number 输入框上下箭头，避免廉价默认样式 */
.refund-amount-input::-webkit-outer-spin-button,
.refund-amount-input::-webkit-inner-spin-button,
.refund-math-input::-webkit-outer-spin-button,
.refund-math-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.refund-amount-input,
.refund-math-input {
    -moz-appearance: textfield;
    appearance: textfield;
}

.refund-item-list {
    max-height: 240px;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #f0f0f0;
    border-radius: 10px;
    margin-bottom: 12px;
    background: #fafafa;
}

.refund-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    border-bottom: 1px solid #f0f0f0;
    gap: 12px;
    background: #fff;
    transition: background 0.15s;
}

.refund-item-row:last-child {
    border-bottom: none;
}

.refund-item-row.is-active {
    background: #fff7f6;
}

.refund-item-row.is-refunded {
    background: #fafafa;
    opacity: 0.92;
}

.refund-item-row.is-refunded .refund-item-name {
    color: #8c8c8c;
    text-decoration: line-through;
}

.refund-item-done {
    flex-shrink: 0;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
    color: #cf1322;
    background: #fff1f0;
    border: 1px solid #ffa39e;
    border-radius: 4px;
    white-space: nowrap;
}

.refund-item-meta {
    flex: 1;
    min-width: 0;
}

.refund-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #262626;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.refund-item-sub {
    margin-top: 3px;
    font-size: 12px;
    color: #8c8c8c;
    line-height: 1.3;
}

.refund-item-qty {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    height: 34px;
    padding: 2px;
    border-radius: 999px;
    background: #f5f5f5;
    border: 1px solid #ececec;
    gap: 0;
}

.refund-qty-btn {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: #fff;
    color: #595959;
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    transition: background 0.15s, color 0.15s, transform 0.1s;
}

.refund-qty-btn:hover:not(:disabled) {
    background: #fff1f0;
    color: #cf1322;
}

.refund-qty-btn:active:not(:disabled) {
    transform: scale(0.94);
}

.refund-qty-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    box-shadow: none;
}

.refund-qty-btn--plus:not(:disabled) {
    color: #cf1322;
}

.refund-qty-value {
    min-width: 44px;
    text-align: center;
    font-size: 13px;
    color: #8c8c8c;
    font-variant-numeric: tabular-nums;
    user-select: none;
    padding: 0 4px;
}

.refund-qty-value b {
    color: #262626;
    font-size: 15px;
    font-weight: 700;
}

.refund-qty-value i {
    font-style: normal;
    margin: 0 1px;
    color: #bfbfbf;
}

.refund-item-row.is-active .refund-qty-value b {
    color: #cf1322;
}

.refund-preview {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin: 4px 0 14px;
    padding: 12px 14px;
    border-radius: 8px;
    background: #fff;
    border: 1px dashed #ffccc7;
    font-size: 14px;
    color: #595959;
}

.refund-preview strong {
    color: #cf1322;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.refund-math-box {
    padding: 12px;
    border-radius: 8px;
    background: #fff2f0;
    border: 1px solid #ffccc7;
}

.refund-math-title {
    font-size: 12px;
    color: #a8071a;
    margin-bottom: 6px;
    font-weight: 600;
}

.refund-math-q {
    font-size: 14px;
    margin-bottom: 8px;
}

.refund-math-input {
    width: 100%;
    box-sizing: border-box;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #ffccc7;
    border-radius: 8px;
    background: #fff;
    font-size: 15px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.refund-inline-error {
    margin: 0 16px 12px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #fff2f0;
    border: 1px solid #ffccc7;
    color: #a8071a;
    font-size: 13px;
    line-height: 1.45;
}

#orderRefundSubmitBtn:disabled {
    opacity: 0.65;
    cursor: wait;
}

.refund-math-input:focus {
    border-color: #ff7875;
    box-shadow: 0 0 0 2px rgba(255, 120, 117, 0.18);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-icon {
    font-size: 3.4286rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* ========== 价格编辑模态框 ========== */
body .price-edit-modal.modal .modal-box {
    width: 380px !important;
    max-width: 380px !important;
    min-width: 380px !important;
    height: auto !important;
    max-height: none !important;
    min-height: auto !important;
    overflow: visible !important;
}

.price-edit-modal .modal-header {
    background: linear-gradient(135deg, #ff9a56 0%, #ff6b6b 100%);
    color: #fff;
    padding: 20px;
    border-bottom: none;
}

.price-edit-modal .modal-header h3 {
    margin: 0;
    font-size: 1.2857rem;
    font-weight: bold;
}

.price-edit-modal .modal-close {
    color: rgba(255, 255, 255, 0.9);
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.2s;
}

.price-edit-modal .modal-close:hover {
    color: #fff;
    transform: rotate(90deg);
}

.price-edit-modal .modal-body {
    padding: 30px 20px;
    overflow-y: visible !important;
}

.price-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
}

.price-prefix {
    font-size: 1.7143rem;
    color: #ff6b6b;
    font-weight: bold;
}

.price-input {
    width: 200px;
    padding: 12px 16px;
    font-size: 1.4286rem;
    font-weight: bold;
    border: 2px solid #e0e4e8;
    border-radius: 8px;
    outline: none;
    transition: all 0.3s;
    text-align: right;
    color: #333;
}

.price-input:focus {
    border-color: #ff6b6b;
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}

.price-hint {
    margin-top: 12px;
    font-size: 0.9286rem;
    color: #999;
}

.price-edit-modal .modal-footer {
    padding: 14px 16px;
    gap: 10px;
}

.btn-confirm:active {
    transform: scale(0.98);
}

/* ========== 批量删除确认模态框（与价格编辑风格统一）========== */
body #batchDeleteModal.modal .modal-box {
    width: 400px !important;
    max-width: 400px !important;
    min-width: 400px !important;
    height: auto !important;
    max-height: none !important;
    min-height: auto !important;
    overflow: visible !important;
}

#batchDeleteModal .modal-header {
    background: linear-gradient(135deg, #ff9a56 0%, #ff6b6b 100%);
    color: #fff;
    padding: 18px 20px;
    border-bottom: none;
    font-size: 1.1429rem;
}

#batchDeleteModal .modal-close {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.8571rem;
    cursor: pointer;
    transition: all 0.2s;
}

#batchDeleteModal .modal-close:hover {
    color: #fff;
    transform: rotate(90deg);
}

#batchDeleteModal .modal-body {
    padding: 24px 22px 16px;
    overflow-y: visible !important;
}

#batchDeleteModal #batchDeleteConfirmInput {
    width: 100% !important;
    padding: 12px 14px;
    font-size: 1rem;
    border: 2px solid #e0e4e8;
    border-radius: 8px;
    box-sizing: border-box;
    outline: none;
    transition: all 0.3s;
}

#batchDeleteModal #batchDeleteConfirmInput:focus {
    border-color: #ff6b6b;
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}

#batchDeleteModal .modal-footer {
    padding: 14px 16px;
    gap: 10px;
    border-top: 1px solid #f0f2f5;
}

/* ========== 批量分类模态框 ========== */
body #batchCategoryModal.modal .modal-box {
    width: 420px !important;
    max-width: 92vw !important;
    min-width: 0 !important;
    height: auto !important;
    max-height: none !important;
    min-height: auto !important;
    overflow: visible !important;
}

#batchCategoryModal .modal-header {
    background: var(--primary-header-gradient);
    color: var(--primary-on-color);
    padding: 18px 20px;
    border-bottom: none;
    font-size: 1.1429rem;
}

#batchCategoryModal .modal-close {
    color: var(--primary-on-color);
    opacity: 0.9;
    font-size: 1.8571rem;
    cursor: pointer;
}

#batchCategoryModal .modal-close:hover {
    color: var(--primary-on-color);
    opacity: 1;
}

#batchCategoryModal .modal-body {
    padding: 20px;
}

.batch-category-tip {
    margin: 0 0 14px;
    color: #666;
    font-size: 0.9286rem;
    line-height: 1.55;
    background: #f0f7ff;
    border-radius: 8px;
    padding: 10px 12px;
}

.batch-category-count {
    margin: 0 0 16px;
    color: #333;
    font-size: 1rem;
}

.batch-category-count strong {
    color: #337ab7;
    font-size: 1.1429rem;
}

#batchCategoryModal .form-group {
    margin-bottom: 0;
}

#batchCategoryModal .form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-size: 0.9286rem;
    font-weight: 500;
}

#batchCategorySelect {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    background: #fff;
    box-sizing: border-box;
}

#batchCategorySelect:focus {
    outline: none;
    border-color: #337ab7;
    box-shadow: 0 0 0 2px rgba(51, 122, 183, 0.15);
}

#batchCategoryModal .modal-footer {
    padding: 16px 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

#batchCategoryModal .modal-footer button {
    min-height: 44px;
    min-width: 96px;
    flex: 1 1 auto;
}

/* ========== 确认对话框样式 ========== */
body #confirmModal.modal .modal-box {
    width: 360px !important;
    max-width: 360px !important;
    min-width: 280px !important;
    height: auto !important;
    max-height: none !important;
    min-height: auto !important;
    border-radius: 12px;
    overflow: visible !important;
}

#confirmModal .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

#confirmModal .modal-body {
    padding: 22px 22px 12px;
    text-align: center;
}

#confirmMessage {
    font-size: 1.0714rem;
    color: #333;
    margin-bottom: 0;
    line-height: 1.55;
    word-break: break-word;
}

#confirmModal .btn-danger:active {
    transform: scale(0.98);
}

/* ========== 设置页面样式 ========== */
.settings-container {
    max-width: 900px;
    margin: 0 auto;
}

.settings-tabs {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f2f5;
    position: relative;
}

.settings-tabs::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(135deg, #ff9a56 0%, #ff6b6b 100%);
    transition: all 0.3s ease;
    border-radius: 2px;
}

.tab-item {
    position: relative;
    padding: 10px 20px;
    background: transparent;
    border: none;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: #333;
    transition: all 0.3s ease;
}

.tab-item:hover {
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.05);
}

.tab-item.active {
    color: #fff;
    background: linear-gradient(135deg, #ff9a56 0%, #ff6b6b 100%);
    font-weight: 600;
}

.settings-tabs .tab-item.fixed-text.active {
    color: #333 !important;
}

.tab-content {
    animation: fadeSlideIn 0.3s ease;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.settings-section {
    background: #fff;
    border-radius: 16px;
    padding: 28px;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid #f0f2f5;
    transition: all 0.3s ease;
}

.settings-section:hover {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
}

.settings-section h3 {
    font-size: 1.2857rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-section h3::before {
    content: '';
    width: 4px;
    height: 18px;
    background: linear-gradient(135deg, #ff9a56 0%, #ff6b6b 100%);
    border-radius: 2px;
}

.section-desc {
    font-size: 1rem;
    color: #888;
    margin-bottom: 24px;
    line-height: 1.5;
}

/* 个人中心 */
.admin-profile-avatar-row {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.admin-profile-avatar-btn {
    position: relative;
    flex-shrink: 0;
    width: 88px;
    height: 88px;
    padding: 0;
    border: none;
    background: linear-gradient(135deg, #ff9a56, #ff6b6b);
    cursor: pointer;
    border-radius: 50%;
    color: #fff;
    font-size: 2rem;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(255, 107, 107, 0.25);
}

.admin-profile-avatar-btn img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: none;
}

.admin-profile-avatar-btn #adminProfileAvatarLetter {
    position: relative;
    z-index: 1;
}

.admin-profile-avatar-badge {
    position: absolute;
    right: -2px;
    bottom: -2px;
    z-index: 2;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #1a1a1a;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    line-height: 24px;
    text-align: center;
    border: 2px solid #fff;
}

.admin-profile-avatar-meta {
    flex: 1;
    min-width: 140px;
}

.admin-profile-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.3;
}

.admin-profile-sub {
    margin-top: 4px;
    font-size: 0.93rem;
    color: #888;
}

.admin-profile-upload-btn {
    margin-top: 12px;
    padding: 8px 14px;
}

.admin-profile-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 20px;
    margin-bottom: 18px;
}

.admin-profile-info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    padding: 12px 14px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #f0f2f5;
}

.admin-profile-info-item--full {
    grid-column: 1 / -1;
    align-items: center;
    text-align: center;
}

.admin-profile-label {
    font-size: 0.86rem;
    color: #94a3b8;
}

.admin-profile-value {
    font-size: 1.05rem;
    font-weight: 600;
    color: #334155;
    white-space: nowrap;
}

.admin-profile-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.admin-profile-actions .btn-primary {
    width: auto;
    min-width: 120px;
}

.admin-profile-action-btn {
    flex: 1 1 140px;
    min-height: 42px;
    border-radius: 10px;
    font-weight: 600;
}

.admin-secure-modal .modal-body {
    padding-top: 14px;
}

.admin-secure-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 14px;
    padding: 4px;
    background: #f3f4f6;
    border-radius: 10px;
}

.admin-secure-tab {
    flex: 1;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 8px 4px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}

.admin-secure-tab.active {
    background: #fff;
    color: #0f172a;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.admin-secure-hint {
    margin: 0 0 12px;
    line-height: 1.5;
}

.admin-secure-pane .form-item:last-child {
    margin-bottom: 0;
}

body.dark-theme .admin-secure-tabs {
    background: #2a2a2a;
}

body.dark-theme .admin-secure-tab {
    color: #94a3b8;
}

body.dark-theme .admin-secure-tab.active {
    background: #3a3a3a;
    color: #f8fafc;
}

body.dark-theme .admin-profile-name {
    color: #f4f4f5;
}

body.dark-theme .admin-profile-info-item {
    background: #1a1a1a;
    border-color: #2a2a2a;
}

body.dark-theme .admin-profile-value {
    color: #e4e4e7;
}

body.dark-theme .user-info-profile:hover {
    background: rgba(255, 107, 107, 0.12);
}

body.dark-theme .admin-profile-avatar-badge {
    border-color: #1a1a1a;
}

/* 主题选项 */
.theme-options {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 16px;
    align-items: stretch;
}

.theme-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
    padding: 20px 16px;
    border-radius: 16px;
    transition: box-shadow 0.3s ease, border-color 0.3s ease, background-color 0.3s ease;
    border: 2px solid transparent;
    background: #fafafa;
    flex: 1 1 0;
    min-width: 0;
    position: relative;
}

.theme-option:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    border-color: #e0e4e8;
}

.theme-option input[type="radio"] {
    display: none;
}

.theme-option input[type="radio"]:checked + .theme-preview {
    border-color: #ff6b6b;
    box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.15);
}

.theme-option input[type="radio"]:checked ~ span:not(.theme-preview):not(.check-icon) {
    color: #ff6b6b;
    font-weight: 600;
}

.theme-option input[type="radio"]:checked ~ .check-icon {
    opacity: 1;
    transform: scale(1);
}

.theme-preview {
    display: block;
    width: 90px;
    height: 90px;
    border-radius: 20px;
    border: 3px solid #e0e4e8;
    transition: all 0.35s ease;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}

.theme-preview::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    height: 40%;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
}

.theme-preview::after {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 8px;
    right: 8px;
    height: 40%;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 8px;
}

.light-preview {
    background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%);
    border-color: #e2e8f0;
}

.light-preview::before {
    background: rgba(255, 107, 107, 0.1);
}

.light-preview::after {
    background: #fff;
    border: 1px solid #e2e8f0;
}

.dark-preview {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border-color: #334155;
}

.dark-preview::before {
    background: rgba(255, 107, 107, 0.2);
}

.dark-preview::after {
    background: #1e293b;
    border: 1px solid #475569;
}

.theme-option span {
    font-size: 1.0714rem;
    color: #555;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.check-icon {
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #ff9a56 0%, #ff6b6b 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.8571rem;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.3s ease;
    position: absolute;
    top: -8px;
    right: -8px;
}

/* 字体大小选项 */
.font-size-options {
    display: flex;
    gap: 12px;
    flex-wrap: nowrap;
    align-items: stretch;
}

.font-option {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    padding: 20px 8px;
    background: #f8fafc;
    border-radius: 12px;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    border: 2px solid transparent;
    position: relative;
}

.font-option:hover {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.font-option input[type="radio"] {
    display: none;
}

.font-option input[type="radio"]:checked ~ span {
    color: #ff6b6b;
    font-weight: 600;
}

.font-option input[type="radio"]:checked ~ .font-preview-text {
    color: #ff6b6b;
}

.font-option input[type="radio"]:checked {
    background: linear-gradient(135deg, #ff9a56 0%, #ff6b6b 100%);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.font-option span {
    font-size: 1rem;
    color: #666;
    font-weight: 500;
}

.font-preview-text {
    font-size: 1.1429rem;
    color: #333;
    transition: all 0.3s ease;
}

.font-option:nth-child(1) .font-preview-text {
    font-size: 0.8571rem;
}

.font-option:nth-child(2) .font-preview-text {
    font-size: 1rem;
}

.font-option:nth-child(3) .font-preview-text {
    font-size: 1.1429rem;
}

.font-option:nth-child(4) .font-preview-text {
    font-size: 1.2857rem;
}

.font-preview {
    margin-top: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #fff7ed 0%, #fef3c7 100%);
    border-radius: 12px;
    border: 1px solid #fed7aa;
}

.font-preview p {
    font-size: 1.0714rem;
    color: #451a03;
    margin: 0;
    line-height: 1.6;
}

/* 主题色选择器（Material 风格，兼容安卓 WebView） */
.theme-color-picker {
    display: flex;
    flex-direction: column;
    gap: 18px;
    -webkit-user-select: none;
    user-select: none;
}

.color-picker-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px;
    border-radius: 20px;
    background: #fff;
    border: 1px solid #eceff1;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
}

.color-picker-sv,
.color-picker-hue {
    position: relative;
    overflow: hidden;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
}

.color-picker-sv canvas,
.color-picker-hue canvas {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    pointer-events: none;
    touch-action: none;
}

.color-picker-sv {
    width: 100%;
    height: 200px;
    border-radius: 16px;
    cursor: crosshair;
    background: #f5f5f5;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.color-picker-hue {
    width: 100%;
    height: 44px;
    border-radius: 22px;
    cursor: ew-resize;
    background: #f5f5f5;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.color-picker-thumb {
    position: absolute;
    z-index: 3;
    width: 22px;
    height: 22px;
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(0, 0, 0, 0.08);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.color-picker-thumb-hue {
    width: 26px;
    height: 26px;
    border-width: 4px;
}

.color-picker-toolbar {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-width: 0;
}

.color-picker-current {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 14px;
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
    background: #ff6b6b;
}

.color-picker-hex-input-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    min-width: 0;
    min-height: 48px;
    padding: 0 14px;
    border-radius: 14px;
    background: #fff;
    border: 1.5px solid #dbe3ea;
    box-sizing: border-box;
}

.color-picker-hex-prefix {
    color: #94a3b8;
    font-weight: 600;
    font-family: Consolas, Monaco, monospace;
    flex-shrink: 0;
}

#colorPickerHexInput {
    flex: 1;
    width: 0;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    font-family: Consolas, Monaco, monospace;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #1e293b;
}

#colorPickerHexInput.invalid {
    color: #ef4444;
}

.color-picker-apply-btn {
    flex-shrink: 0;
    min-width: 76px;
    min-height: 48px;
    padding: 0 16px;
    border: none;
    border-radius: 14px;
    background: var(--primary-color);
    color: #fff;
    font-size: 0.9286rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.24);
    cursor: pointer;
    white-space: nowrap;
}

.color-picker-presets {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.color-picker-presets-label {
    font-size: 0.8571rem;
    color: #64748b;
    font-weight: 500;
}

.color-picker-preset-list {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.color-picker-preset {
    width: 36px;
    height: 36px;
    border: 3px solid #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.color-picker-preset:active {
    transform: scale(0.95);
}

.color-picker-preset.active {
    box-shadow: 0 0 0 2px var(--primary-color), 0 2px 8px rgba(15, 23, 42, 0.12);
}

/* 恢复默认按钮 */
.settings-section .btn-primary {
    width: 100%;
    padding: 14px 24px;
    font-size: 1.0714rem;
    font-weight: 500;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.settings-section .btn-primary:hover {
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.3);
}

/* 关于页面 */
.about-section {
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid #f0f2f5;
}

.about-section:first-child {
    text-align: center;
    background: linear-gradient(135deg, #fff7ed 0%, #fef3c7 100%);
    border-color: #fed7aa;
}

.about-logo {
    font-size: 5.7143rem;
    margin-bottom: 16px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.about-section h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.about-version {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(255, 107, 107, 0.15);
    color: #ea580c;
    border-radius: 20px;
    font-size: 0.9286rem;
    font-weight: 500;
    margin-bottom: 16px;
}

.about-desc {
    font-size: 1.0714rem;
    color: #666;
    line-height: 1.7;
    max-width: 500px;
    margin: 0 auto;
}

.about-update-actions {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
}

.about-native-btns {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.about-btn {
    min-width: 132px;
    height: 42px;
    padding: 0 22px;
    border-radius: 21px;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.15s, box-shadow 0.15s, background 0.15s, border-color 0.15s;
}

.about-btn:active {
    transform: scale(0.97);
}

.about-btn[hidden] {
    display: none !important;
}

.about-btn-update {
    border: none;
    color: #fff;
    background: linear-gradient(135deg, var(--primary-color, #ff6b6b) 0%, #ff9a56 100%);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.28);
}

.about-btn-update:hover {
    box-shadow: 0 6px 16px rgba(255, 107, 107, 0.36);
}

.about-btn-cache {
    border: 1.5px solid var(--primary-color, #ff6b6b);
    color: var(--primary-color, #ff6b6b);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.1);
}

.about-btn-cache:hover {
    background: rgba(255, 107, 107, 0.08);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.16);
}

.about-update-hint {
    margin: 0;
    max-width: 320px;
    font-size: 0.82rem;
    line-height: 1.45;
    color: #999;
}

.about-update-hint[hidden] {
    display: none !important;
}

.about-section h3 {
    font-size: 1.2857rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.about-section h3::before {
    content: '';
    width: 4px;
    height: 18px;
    background: linear-gradient(135deg, #ff9a56 0%, #ff6b6b 100%);
    border-radius: 2px;
}

.feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

/* 默认只显示前 6 条，减轻关于页首屏长度（安卓友好） */
.feature-list.is-collapsed > li:nth-child(n+7) {
    display: none;
}

.feature-list li {
    padding: 16px 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    font-size: 1rem;
    color: #475569;
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
}

.feature-list li:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    background: #fff;
}

.about-fold-btn {
    display: block;
    width: 100%;
    min-height: 44px;
    margin-top: 14px;
    padding: 10px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    color: #334155;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.about-fold-btn:active {
    transform: scale(0.99);
}

.about-fold-btn:hover {
    background: #fff;
    border-color: #cbd5e1;
    color: #0f172a;
}

.changelog {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-radius: 12px;
    padding: 12px 14px;
    border: 1px solid #bbf7d0;
}

.changelog-item {
    font-size: 1rem;
}

.changelog-item + .changelog-item {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #bbf7d0;
}

.changelog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    min-height: 44px;
    padding: 8px 6px;
    margin: 0;
    border: none;
    border-radius: 10px;
    background: transparent;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.changelog-head:hover {
    background: rgba(255, 255, 255, 0.55);
}

.changelog-head:active {
    background: rgba(255, 255, 255, 0.75);
}

.changelog-head-main {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    min-width: 0;
}

.changelog-item .version {
    display: inline-block;
    padding: 4px 12px;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: #fff;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9286rem;
    margin-right: 0;
}

.changelog-item .date {
    color: #666;
    margin-right: 0;
    font-size: 0.9286rem;
}

.changelog-arrow {
    flex-shrink: 0;
    width: 10px;
    height: 10px;
    border-right: 2px solid #16a34a;
    border-bottom: 2px solid #16a34a;
    transform: rotate(45deg);
    transition: transform 0.2s ease;
    margin-right: 6px;
    margin-top: -4px;
}

.changelog-item.is-open .changelog-arrow {
    transform: rotate(-135deg);
    margin-top: 4px;
}

.changelog-body {
    display: none;
    padding: 0 6px 6px;
}

.changelog-item.is-open .changelog-body {
    display: block;
}

.changelog-item ul {
    margin: 4px 0 0 24px;
    padding: 0;
    color: #475569;
}

.changelog-item li {
    margin-bottom: 6px;
    position: relative;
}

.changelog-item li::marker {
    color: #22c55e;
}

@media (max-width: 768px) {
    .feature-list {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .feature-list li {
        padding: 12px 14px;
        font-size: 0.95rem;
    }

    .about-section {
        padding: 20px 16px;
    }

    .changelog {
        padding: 8px 10px;
    }
}

/* 技术支持卡片 */
.support-cards-container {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.support-card {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    flex: 1 1 0;
    min-width: 0;
}

.support-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.support-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4286rem;
    flex-shrink: 0;
}

.support-icon.email {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
}

.support-icon.phone {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
}

.support-info {
    flex: 1;
}

.support-info p {
    margin: 0;
    font-size: 0.9286rem;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.support-info p:first-child {
    font-size: 0.8571rem;
    color: #999;
    margin-bottom: 4px;
}

/* 深色模式样式 */
body.dark-theme {
    background: #0f0f0f;
    color: #e4e4e7;
}

body.dark-theme .card,
body.dark-theme .modal-box,
body.dark-theme .table-card,
body.dark-theme .order-card,
body.dark-theme .material-card,
body.dark-theme .dish-mobile-card,
body.dark-theme .op-log-card,
body.dark-theme .staff-card,
body.dark-theme .settings-section,
body.dark-theme .about-section,
body.dark-theme .font-preview,
body.dark-theme .changelog,
body.dark-theme .support-card {
    background: #1a1a1a;
    border-color: #2a2a2a;
}

body.dark-theme .staff-card-name {
    color: #f1f5f9;
}

body.dark-theme .staff-card-user,
body.dark-theme .staff-card-meta,
body.dark-theme .staff-card-perms {
    color: #94a3b8;
}

body.dark-theme .staff-card-avatar {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

body.dark-theme .staff-card-perms {
    border-top-color: #2a2a2a;
}

body.dark-theme .dish-mobile-name {
    color: #e4e4e7;
}

body.dark-theme .op-log-card-target {
    color: #e4e4e7;
}

body.dark-theme .op-log-card-meta,
body.dark-theme .op-log-card-detail,
body.dark-theme .op-log-card-time {
    color: #a1a1aa;
}

body.dark-theme .op-log-target,
body.dark-theme .op-log-detail {
    color: #a1a1aa;
}

body.dark-theme .op-log-list-desktop {
    background: #141414;
    border-color: #2a2a2a;
}

body.dark-theme .op-log-desk-row {
    border-bottom-color: #222;
}

body.dark-theme .op-log-desk-row:hover {
    background: #1c1c1c;
}

body.dark-theme .op-log-desk-row.selected {
    background: rgba(255, 107, 107, 0.08);
}

body.dark-theme .op-log-time-date,
body.dark-theme .op-log-desk-target {
    color: #e4e4e7;
}

body.dark-theme .op-log-time-clock,
body.dark-theme .op-log-desk-module,
body.dark-theme .op-log-desk-detail,
body.dark-theme .op-log-desk-meta {
    color: #a1a1aa;
}

body.dark-theme .op-log-desk-module::before {
    background: #52525b;
}

body.dark-theme .op-log-action-create {
    color: #86efac;
    background: rgba(34, 197, 94, 0.16) !important;
}

body.dark-theme .op-log-action-edit {
    color: #93c5fd;
    background: rgba(59, 130, 246, 0.16) !important;
}

body.dark-theme .op-log-action-delete {
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.16) !important;
}

body.dark-theme .op-log-action-refund {
    color: #fdba74;
    background: rgba(249, 115, 22, 0.16) !important;
}

body.dark-theme .op-log-toolbar,
body.dark-theme .op-log-mobile-bar,
body.dark-theme .op-log-filter-panel {
    background: #141414;
    border-color: #2a2a2a;
}

body.dark-theme .op-log-select-all {
    color: #a1a1aa;
}

body.dark-theme .op-log-card.selected {
    border-color: #7f3d3d;
    box-shadow: 0 2px 10px rgba(255, 107, 107, 0.08);
}

body.dark-theme .op-log-filter-select,
body.dark-theme .op-log-filter-input {
    background: #1a1a1a;
    border-color: #2a2a2a;
    color: #e4e4e7;
}

body.dark-theme .op-log-filter-label {
    color: #a1a1aa;
}

body.dark-theme .dish-mobile-select-all {
    color: #a1a1aa;
}

body.dark-theme .dish-mobile-img {
    background: #262626;
}

body.dark-theme .sidebar {
    background: #141414;
    border-color: #2a2a2a;
}

body.dark-theme .menu-item {
    color: #a1a1aa;
}

body.dark-theme .menu-item:hover,
body.dark-theme .menu-item.active {
    background: rgba(255, 107, 107, 0.1);
    color: #ff6b6b;
}

body.dark-theme .user-info {
    border-color: #2a2a2a;
    color: #a1a1aa;
}

body.dark-theme table th {
    background: #141414;
    color: #a1a1aa;
}

body.dark-theme table td {
    border-color: #2a2a2a;
}

body.dark-theme table tr:hover td {
    background: #2a2a2a;
}

body.dark-theme .btn-default {
    background: #2a2a2a;
    color: #a1a1aa;
}

body.dark-theme .tab-item {
    color: #e4e4e7;
}

body.dark-theme .tab-item:hover {
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.08);
}

body.dark-theme .tab-item.active {
    color: #fff;
    background: linear-gradient(135deg, #ff9a56 0%, #ff6b6b 100%);
    font-weight: 600;
}

body.dark-theme .settings-tabs .tab-item.fixed-text.active {
    color: #fff !important;
}

body.dark-theme .settings-section {
    border-color: #2a2a2a;
}

body.dark-theme .settings-section h3 {
    color: #f4f4f5;
}

body.dark-theme .section-desc {
    color: #71717a;
}

body.dark-theme .theme-option {
    background: #242424;
    border-color: #2a2a2a;
}

body.dark-theme .theme-option:hover {
    border-color: #3a3a3a;
}

body.dark-theme .theme-option span {
    color: #a1a1aa;
}

body.dark-theme .theme-option input[type="radio"]:checked ~ span {
    color: #ff6b6b;
}

body.dark-theme .font-option {
    background: #242424;
    border-color: #2a2a2a;
}

body.dark-theme .font-option:hover {
    background: #2a2a2a;
    border-color: #3a3a3a;
}

body.dark-theme .font-option span {
    color: #a1a1aa;
}

body.dark-theme .font-preview-text {
    color: #e4e4e7;
}

body.dark-theme .font-preview {
    background: linear-gradient(135deg, #292524 0%, #1c1917 100%);
    border-color: #3f3f46;
}

body.dark-theme .font-preview p {
    color: #d4d4d8;
}

body.dark-theme .color-picker-panel {
    background: #1f1f1f;
    border-color: #2f2f2f;
    box-shadow: none;
}

body.dark-theme .color-picker-hex-input-wrap {
    background: #242424;
    border-color: #3f3f46;
}

body.dark-theme #colorPickerHexInput {
    color: #f1f5f9;
}

body.dark-theme .color-picker-presets-label {
    color: #a1a1aa;
}

body.dark-theme .feature-list li {
    background: #242424;
    border-color: #2a2a2a;
    color: #a1a1aa;
}

body.dark-theme .feature-list li:hover {
    background: #2a2a2a;
}

body.dark-theme .about-section:first-child {
    background: linear-gradient(135deg, #292524 0%, #1c1917 100%);
    border-color: #3f3f46;
}

body.dark-theme .about-section h2 {
    color: #f4f4f5;
}

body.dark-theme .about-desc {
    color: #a1a1aa;
}

body.dark-theme .about-btn-cache {
    background: rgba(26, 26, 26, 0.9);
    border-color: var(--primary-color, #ff6b6b);
    color: var(--primary-color, #ff6b6b);
}

body.dark-theme .about-btn-cache:hover {
    background: rgba(255, 107, 107, 0.12);
}

body.dark-theme .about-update-hint {
    color: #71717a;
}

body.dark-theme .changelog {
    background: linear-gradient(135deg, #14532d 0%, #166534 100%);
    border-color: #166534;
}

body.dark-theme .changelog-item + .changelog-item {
    border-top-color: rgba(187, 247, 208, 0.25);
}

body.dark-theme .changelog-item ul {
    color: #a1a1aa;
}

body.dark-theme .changelog-item .date {
    color: #a1a1aa;
}

body.dark-theme .changelog-head:hover,
body.dark-theme .changelog-head:active {
    background: rgba(0, 0, 0, 0.18);
}

body.dark-theme .changelog-arrow {
    border-right-color: #86efac;
    border-bottom-color: #86efac;
}

body.dark-theme .about-fold-btn {
    background: #242424;
    border-color: #3f3f46;
    color: #e4e4e7;
}

body.dark-theme .about-fold-btn:hover {
    background: #2a2a2a;
    border-color: #52525b;
    color: #f4f4f5;
}

body.dark-theme .form-item input,
body.dark-theme .form-item textarea,
body.dark-theme .form-item select {
    background: #242424;
    border-color: #3f3f46;
    color: #e4e4e7;
}

body.dark-theme .modal {
    background: rgba(0, 0, 0, 0.85);
}

body.dark-theme .modal-header {
    border-color: #2a2a2a;
}

body.dark-theme .light-preview {
    background: linear-gradient(180deg, #374151 0%, #1f2937 100%);
    border-color: #4b5563;
}

body.dark-theme .light-preview::before {
    background: rgba(255, 107, 107, 0.15);
}

body.dark-theme .light-preview::after {
    background: #374151;
    border-color: #4b5563;
}

/* 移动端优化 */
@media (max-width: 768px) {
    body .price-edit-modal.modal .modal-box {
        width: 280px !important;
        max-width: 280px !important;
        min-width: 280px !important;
        height: auto !important;
        max-height: none !important;
        min-height: auto !important;
        overflow: visible !important;
    }

    .price-edit-modal .modal-header {
        padding: 14px 16px;
    }

    .price-edit-modal .modal-header h3 {
        font-size: 1.07rem;
    }

    .price-edit-modal .modal-close {
        font-size: 1.57rem;
    }

    .price-edit-modal .modal-body {
        padding: 16px;
    }

    .price-input-wrapper {
        margin-top: 10px;
    }

    .price-prefix {
        font-size: 1.29rem;
    }

    .price-input {
        width: 180px;
        padding: 8px 12px;
        font-size: 1.14rem;
    }

    .price-hint {
        font-size: 0.79rem;
        margin-top: 6px;
    }

    /* 确认对话框移动端优化 */
    body #confirmModal.modal .modal-box {
        width: 260px !important;
        max-width: 260px !important;
        min-width: 260px !important;
        height: auto !important;
        max-height: none !important;
        min-height: auto !important;
        overflow: visible !important;
    }

    #confirmModal .modal-body {
        padding: 20px 16px 8px;
    }

    #confirmMessage {
        font-size: 1rem;
    }

    /* 批量删除确认弹窗移动端优化 */
    body #batchDeleteModal.modal .modal-box {
        width: 300px !important;
        max-width: 300px !important;
        min-width: 300px !important;
        height: auto !important;
        max-height: none !important;
        min-height: auto !important;
        overflow: visible !important;
    }

    #batchDeleteModal .modal-header {
        padding: 14px 16px;
        font-size: 1.0714rem;
    }

    #batchDeleteModal .modal-body {
        padding: 18px 16px 12px;
    }

    /* 批量分类弹窗移动端 */
    body #batchCategoryModal.modal .modal-box {
        width: 92vw !important;
        max-width: 92vw !important;
        min-width: 0 !important;
    }

    #batchCategoryModal .modal-header {
        padding: 14px 16px;
        font-size: 1.0714rem;
    }

    #batchCategoryModal .modal-body {
        padding: 16px;
    }

    #batchCategoryModal .modal-footer {
        padding: 14px 16px;
    }

    #batchCategoryModal .modal-footer button {
        flex: 1 1 45%;
    }
}

/* ============ 经营报表 ============ */
.revenue-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.revenue-stat-card {
    background: #fff;
    border-radius: 10px;
    padding: 12px 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid #f0f2f5;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.revenue-stat-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.revenue-stat-card.highlight {
    background: linear-gradient(135deg, rgba(255, 154, 86, 0.1) 0%, rgba(255, 107, 107, 0.1) 100%);
    border-color: rgba(255, 107, 107, 0.25);
}

.revenue-stat-card--refund {
    background: #fff7f6;
    border-color: #ffccc7;
}

.revenue-stat-card--refund .revenue-stat-value {
    color: #cf1322;
}

.revenue-refund-cell {
    color: #cf1322;
}

.revenue-stat-label {
    font-size: 0.857rem;
    color: #888;
    margin-bottom: 4px;
}

.revenue-stat-value {
    font-size: 1.2857rem;
    font-weight: 700;
    color: #333;
    line-height: 1.2;
    word-break: break-all;
}

.revenue-stat-sub {
    font-size: 0.7857rem;
    color: #999;
    margin-top: 4px;
}

.revenue-stat-compare {
    font-size: 0.7143rem;
    margin-top: 6px;
    padding: 3px 8px;
    border-radius: 12px;
    display: inline-block;
    max-width: 100%;
    line-height: 1.35;
    word-break: break-word;
}

.revenue-stat-compare.up {
    background: rgba(82, 196, 26, 0.12);
    color: #389e0d;
}

.revenue-stat-compare.down {
    background: rgba(255, 77, 79, 0.12);
    color: #cf1322;
}

.revenue-stat-compare.flat {
    background: #f5f5f5;
    color: #999;
}

.revenue-chart-card {
    margin-bottom: 20px;
}

.revenue-chart-header,
.revenue-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.revenue-chart-header h3,
.revenue-history-header h3 {
    margin: 0;
    font-size: 1.1429rem;
    color: #333;
}

.revenue-chart-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.chart-tab {
    padding: 6px 14px;
    border: 1px solid #e0e4e8;
    border-radius: 20px;
    background: #fff;
    color: #666;
    cursor: pointer;
    font-size: 0.9286rem;
    transition: all 0.2s;
}

.chart-tab:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.chart-tab.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.revenue-chart-wrap {
    position: relative;
    height: 320px;
}

.revenue-history-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    width: 100%;
    min-width: 0;
}

.revenue-history-filter input[type="date"] {
    padding: 8px 6px;
    border: 1px solid #e0e4e8;
    border-radius: 6px;
    font-size: 0.9286rem;
    min-width: 0;
}

.revenue-history-pagination {
    margin-top: 12px;
    margin-bottom: 8px;
}

.revenue-page-bar {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid #f0f2f5;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

.revenue-page-bar .btn-default {
    margin-right: 0;
}

@media (min-width: 992px) {
    .revenue-summary-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 14px;
    }

    .revenue-stat-card {
        padding: 16px 18px;
    }

    .revenue-stat-value {
        font-size: 1.5714rem;
    }
}

body.dark-theme .revenue-stat-card {
    background: #2a2a2a;
    border-color: #3a3a3a;
}

body.dark-theme .revenue-stat-card.highlight {
    background: linear-gradient(135deg, rgba(255, 154, 86, 0.15) 0%, rgba(255, 107, 107, 0.15) 100%);
    border-color: rgba(255, 107, 107, 0.3);
}

body.dark-theme .revenue-stat-value,
body.dark-theme .revenue-chart-header h3,
body.dark-theme .revenue-history-header h3 {
    color: #e8e8e8;
}

body.dark-theme .chart-tab {
    background: #333;
    border-color: #444;
    color: #bbb;
}

/* 新订单提醒横幅 */
.order-notify-banner {
    position: sticky;
    top: 0;
    z-index: 1200;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    border: 1px solid #fdba74;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(255, 107, 107, 0.18);
    animation: orderNotifyPulse 1.2s ease-in-out 2;
}

@keyframes orderNotifyPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.01);
    }
}

.order-notify-body {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.order-notify-icon {
    font-size: 1.4286rem;
    line-height: 1.2;
    flex-shrink: 0;
}

.order-notify-text {
    flex: 1;
    font-size: 1rem;
    font-weight: 600;
    color: #9a3412;
    line-height: 1.5;
    word-break: break-word;
}

.order-notify-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.order-notify-btn {
    padding: 8px 14px;
    font-size: 0.9286rem;
}

.order-notify-setting {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.order-notify-switch {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    color: #475569;
    cursor: pointer;
}

.order-notify-switch input {
    width: 18px;
    height: 18px;
    accent-color: #ff6b6b;
}

body.dark-theme .order-notify-banner {
    background: linear-gradient(135deg, #3f2a1d 0%, #4a2f18 100%);
    border-color: #b45309;
}

body.dark-theme .order-notify-text {
    color: #fdba74;
}

body.dark-theme .order-notify-switch {
    color: #cbd5e1;
}

/* 发票申请提醒横幅：复用订单提醒样式，区分配色 */
.invoice-notify-banner {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-color: #93c5fd;
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.16);
}

.invoice-notify-banner .order-notify-text {
    color: #1e40af;
}

body.dark-theme .invoice-notify-banner {
    background: linear-gradient(135deg, #1e3a5f 0%, #1e293b 100%);
    border-color: #3b82f6;
}

body.dark-theme .invoice-notify-banner .order-notify-text {
    color: #93c5fd;
}

/* 语音提醒：订单 / 发票子 Tab */
.voice-notify-subtabs {
    display: flex;
    gap: 8px;
    margin: 4px 0 16px;
    padding: 4px;
    background: #f1f5f9;
    border-radius: 10px;
}

.voice-notify-subtab {
    flex: 1;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.voice-notify-subtab:hover {
    color: #334155;
    background: rgba(255, 255, 255, 0.55);
}

.voice-notify-subtab.active {
    color: #fff;
    background: linear-gradient(135deg, #ff9a56 0%, #ff6b6b 100%);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.25);
}

.voice-notify-pane {
    animation: voiceNotifyPaneIn 0.18s ease;
}

@keyframes voiceNotifyPaneIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

body.dark-theme .voice-notify-subtabs {
    background: #1e293b;
}

body.dark-theme .voice-notify-subtab {
    color: #94a3b8;
}

body.dark-theme .voice-notify-subtab:hover {
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.06);
}

body.dark-theme .voice-notify-subtab.active {
    color: #fff;
}

.receipt-print-device-block {
    margin-top: 14px;
}

.receipt-printer-select {
    width: 100%;
    max-width: 420px;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    background: #fff;
    color: #334155;
    box-sizing: border-box;
}

.receipt-font-block {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px dashed #e8eaed;
}

.receipt-paper-block {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px dashed #e8eaed;
}

.receipt-paper-item {
    max-width: 420px;
}

/* 小票预览：全屏 + 中间可滚 + 底层不跟滚 */
.receipt-preview-modal {
    padding: 0 !important;
    align-items: stretch !important;
    justify-content: stretch !important;
}

.receipt-preview-modal-box {
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    max-height: 100% !important;
    margin: 0 !important;
    border-radius: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    box-shadow: none !important;
}

.receipt-preview-modal-box > .modal-header,
.receipt-preview-modal-box > .modal-footer {
    flex-shrink: 0;
}

.receipt-preview-modal-body {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    max-height: none !important;
    padding: 12px 16px 20px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
    background: #f1f5f9;
}

.receipt-preview-stage {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 8px 0 24px;
    overflow: visible;
    width: 100%;
    box-sizing: border-box;
}

.receipt-preview-scale-wrap {
    display: flex;
    justify-content: center;
    width: 100%;
    overflow: visible;
}

.receipt-preview-paper {
    background: #fff;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.12);
    border: 1px solid #e2e8f0;
    box-sizing: border-box;
    flex-shrink: 0;
    transform-origin: top center;
}

.receipt-preview-paper::before {
    content: attr(data-paper-mm) 'mm 纸宽' attr(data-preview-scale);
    display: block;
    text-align: center;
    font-size: 11px;
    color: #64748b;
    padding: 4px 0 2px;
    border-bottom: 1px dashed #cbd5e1;
    background: #f8fafc;
    letter-spacing: 0.02em;
}

.receipt-preview-paper .rcpt {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0;
    box-sizing: border-box;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.receipt-preview-paper .rcpt-total {
    flex-wrap: wrap;
    gap: 4px;
}

.receipt-preview-footer {
    flex-wrap: nowrap;
    gap: 10px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid #e8eaed;
    background: #fff;
}

.receipt-preview-footer .btn-default,
.receipt-preview-footer .btn-primary {
    flex: 1;
}

body.dark-theme .receipt-preview-modal-body {
    background: #111;
}

body.dark-theme .receipt-preview-paper {
    background: #fff;
    border-color: #333;
}

body.dark-theme .receipt-preview-footer {
    background: #1a1a1a;
    border-top-color: #333;
}

.receipt-font-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.receipt-font-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.receipt-font-item .custom-select-wrapper,
.receipt-print-device-block .custom-select-wrapper {
    width: 100%;
    max-width: 100%;
}

.receipt-font-name {
    font-size: 0.88rem;
    color: #64748b;
}

.receipt-font-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    background: #fff;
    color: #334155;
    box-sizing: border-box;
}

.receipt-font-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

@media (max-width: 768px) {
    .receipt-font-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .receipt-printer-select,
    .receipt-font-select {
        max-width: none;
        font-size: 16px; /* 安卓避免输入框自动放大 */
    }

    .receipt-font-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .receipt-font-actions .btn-default,
    .receipt-font-actions .btn-primary {
        width: 100%;
    }

    .order-notify-setting {
        flex-direction: column;
        align-items: stretch;
    }

    .order-notify-setting .btn-default,
    .order-notify-setting .btn-primary {
        width: 100%;
    }
}

body.dark-theme .receipt-printer-select,
body.dark-theme .receipt-font-select {
    background: #1f1f1f;
    border-color: #333;
    color: #e5e7eb;
}

body.dark-theme .receipt-font-name {
    color: #94a3b8;
}

body.dark-theme .receipt-font-block {
    border-top-color: #333;
}

body.dark-theme .receipt-paper-block {
    border-top-color: #333;
}

.voice-preset-block,
.custom-broadcast-block {
    margin-top: 18px;
}

.voice-preset-label {
    font-size: 0.9286rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 10px;
}

.voice-preset-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.voice-preset-item {
    flex: 1 1 calc(50% - 10px);
    min-width: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 10px;
    background: #f8fafc;
    border: 2px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.9286rem;
    color: #475569;
}

.voice-preset-item input {
    display: none;
}

.voice-preset-item:has(input:checked) {
    border-color: #ff6b6b;
    background: #fff7ed;
    color: #c2410c;
    font-weight: 600;
}

.custom-broadcast-input {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.9286rem;
    line-height: 1.5;
    resize: vertical;
    font-family: inherit;
}

.custom-broadcast-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}

body.dark-theme .voice-preset-item {
    background: #2a2a2a;
    color: #cbd5e1;
}

body.dark-theme .voice-preset-item:has(input:checked) {
    background: #3f2a1d;
    border-color: #ff6b6b;
    color: #fdba74;
}

body.dark-theme .custom-broadcast-input {
    background: #2a2a2a;
    border-color: #444;
    color: #e8e8e8;
}

body.dark-theme .voice-preset-label {
    color: #cbd5e1;
}

/* ========== 会员管理页 ========== */
/* 覆盖 settings-section 内 btn-primary 的 width:100%，避免保存/开通按钮撑满整行 */
#page-member .settings-section .btn-primary {
    width: auto;
    padding: 8px 16px;
    font-size: 0.93rem;
    font-weight: 500;
    border-radius: 6px;
    white-space: nowrap;
}

#page-member .settings-section .btn-primary:hover {
    box-shadow: none;
    opacity: 0.9;
}

#page-member .member-list-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
}

#page-member .member-search-input {
    flex: 1;
    min-width: 160px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-sizing: border-box;
}

#page-member .member-open-btn {
    flex-shrink: 0;
}

#page-member .member-rule-row {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 6px;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

#page-member .member-rule-label {
    color: #666;
    font-size: 0.86rem;
    flex-shrink: 0;
    white-space: nowrap;
}

#page-member .member-rule-input {
    flex: 1 1 0;
    min-width: 0;
    width: 0;
    padding: 6px 6px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.86rem;
    box-sizing: border-box;
}

#page-member .member-rule-row .member-action-btn.disable {
    flex-shrink: 0;
    margin-left: auto;
    padding: 6px 10px;
    font-size: 0.86rem;
}

#page-member .member-rule-add-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    align-items: center;
}

#page-member .member-rule-add-input {
    flex: 1 1 0;
    min-width: 0;
    width: 0;
    padding: 8px 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.86rem;
    box-sizing: border-box;
}

#page-member .member-rule-add-row .btn-default {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 8px 12px;
    font-size: 0.86rem;
}

#page-member .member-card-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

#page-member .member-action-btn {
    padding: 6px 14px;
    border: none;
    border-radius: 6px;
    font-size: 0.93rem;
    cursor: pointer;
    white-space: nowrap;
    color: #fff;
    transition: opacity 0.2s;
}

#page-member .member-action-btn:hover {
    opacity: 0.88;
}

#page-member .member-action-btn.recharge {
    background: linear-gradient(135deg, #ff9a56 0%, #ff6b6b 100%);
}

#page-member .member-action-btn.disable {
    background: #ff4d4f;
}

#page-member .member-action-btn.enable {
    background: #52c41a;
}

#memberStatusModal .member-status-confirm.disable {
    background: linear-gradient(135deg, #ff6b6b 0%, #f56c6c 100%);
}

#memberStatusModal .member-status-confirm.enable {
    background: #52c41a;
}

/* ========== 打料方式 ========== */
.preparation-header-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-left: auto;
}

.prep-toolbar {
    --prep-filter-h: 40px;
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 16px;
    width: 100%;
    height: var(--prep-filter-h);
}

.prep-search-input {
    flex: 1 1 0;
    min-width: 0;
    height: var(--prep-filter-h);
    min-height: var(--prep-filter-h);
    max-height: var(--prep-filter-h);
    margin: 0;
    padding: 0 12px;
    border: 1px solid #e0e4e8;
    border-radius: 8px;
    font-size: 14px;
    line-height: var(--prep-filter-h);
    color: #333;
    background-color: #fff;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.prep-search-input::placeholder {
    color: #aaa;
    line-height: normal;
}

.prep-search-input:hover,
#page-preparation .prep-category-wrap .custom-select-trigger:hover,
.prep-category-filter:hover {
    border-color: #ff9a56;
}

.prep-search-input:focus,
#page-preparation .prep-category-wrap .custom-select-trigger:focus-visible,
.prep-category-filter:focus {
    border-color: #ff6b6b;
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}

.prep-category-wrap {
    flex: 0 0 auto;
    width: 38%;
    max-width: 148px;
    min-width: 92px;
    height: var(--prep-filter-h);
    min-height: var(--prep-filter-h);
    overflow: hidden;
    display: flex;
    align-items: stretch;
}

#page-preparation .prep-category-wrap .custom-select-wrapper {
    width: 100%;
    height: 100%;
    min-height: var(--prep-filter-h);
    display: flex;
    align-items: stretch;
}

#page-preparation .prep-category-wrap .custom-select-trigger {
    flex: 1;
    width: 100%;
    height: 100%;
    min-height: var(--prep-filter-h);
    max-height: var(--prep-filter-h);
    margin: 0;
    padding: 0 28px 0 10px;
    border: 1px solid #e0e4e8;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.25;
    box-sizing: border-box;
    background-position: right 8px center;
}

.prep-category-filter {
    width: 100%;
    height: var(--prep-filter-h);
    min-height: var(--prep-filter-h);
    max-height: var(--prep-filter-h);
    margin: 0;
    padding: 0 28px 0 10px;
    border: 1px solid #e0e4e8;
    border-radius: 8px;
    font-size: 14px;
    line-height: var(--prep-filter-h);
    color: #333;
    background-color: #fff;
    box-sizing: border-box;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.prep-row-actions {
    flex: 0 0 auto;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.prep-action-btn {
    min-height: 34px;
    padding: 6px 14px !important;
    font-size: 0.86rem !important;
}

/* 打料编辑弹窗 */
.prep-modal-wrap .prep-modal-box {
    width: 100%;
    max-width: 480px;
    max-height: min(88vh, 680px);
    min-height: 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
}

.prep-modal-wrap .modal-body {
    padding: 20px 20px 8px;
}

.prep-modal-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.prep-modal-footer {
    flex-shrink: 0;
    background: #fff;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.06);
    position: relative;
    z-index: 2;
}

/* 弹窗内不受全局 .form-item input{width:100%} 影响，颜色块保持小方块 */
.prep-modal-wrap .form-item {
    margin-bottom: 18px;
}

.prep-modal-wrap .form-item input[type="color"],
.prep-modal-wrap .prep-color-dot,
.prep-modal-wrap .prep-step-color {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px;
    max-width: 44px;
    padding: 4px !important;
    flex-shrink: 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    box-sizing: border-box;
}

.prep-modal-wrap .form-item input:not([type="color"]):not([type="hidden"]),
.prep-modal-wrap .form-item select,
.prep-modal-wrap .form-item textarea {
    width: 100%;
    box-sizing: border-box;
}

.prep-form-block {
    margin-bottom: 0;
}

.prep-form-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.prep-form-input,
.prep-step-input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.95rem;
    background: #fff;
}

.prep-form-hint {
    font-size: 0.88rem;
    color: #666;
    flex: 1;
    line-height: 1.4;
}

.prep-name-color-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
    padding: 10px 12px;
    background: #f8f9fb;
    border-radius: 8px;
    border: 1px solid #eef0f3;
}

.prep-color-dot {
    cursor: pointer;
}

.prep-step-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 10px 0 12px;
}

.prep-step-row {
    display: grid;
    grid-template-columns: 28px 1fr 44px auto;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    background: #f8f9fb;
    border-radius: 8px;
    border: 1px solid #eef0f3;
}

.prep-step-num {
    text-align: center;
    font-size: 0.85rem;
    color: #999;
    font-weight: 600;
}

.prep-step-remove {
    border: none;
    background: transparent;
    color: #f56c6c;
    font-size: 0.86rem;
    padding: 6px 8px;
    cursor: pointer;
    white-space: nowrap;
}

.prep-add-step-btn {
    width: 100%;
    min-height: 42px;
    margin-top: 4px;
    border-style: dashed !important;
}

.prep-modal-box .prep-color-field {
    flex: 1;
}

.preparation-card {
    padding: 16px 18px;
}

.preparation-view-box {
    max-width: 920px;
    margin: 0 auto;
}

.preparation-empty {
    text-align: center;
    color: #999;
    padding: 40px 16px;
}

.prep-section {
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px dashed #e8e8e8;
}

.prep-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.prep-section-title {
    text-align: center;
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0 0 10px;
    line-height: 1.4;
}

.prep-section-intro-bar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 12px;
    padding: 0 2px;
}

.prep-section-intro-content {
    width: 100%;
    min-width: 0;
}

.prep-section-intro-content.is-empty {
    text-align: center;
}

.prep-section-intro-actions {
    display: flex;
    justify-content: flex-end;
    width: 100%;
}

.prep-intro-edit-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border: none;
    background: transparent;
    color: #999;
    font-size: 0.8rem;
    line-height: 1.4;
    cursor: pointer;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}

.prep-intro-edit-link:hover,
.prep-intro-edit-link:focus-visible {
    color: #2f9e44;
}

.prep-intro-edit-icon {
    display: block;
    flex-shrink: 0;
    width: 14px;
    height: 14px;
}

.prep-intro-line-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 12px 0 14px;
}

.prep-intro-line-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e8ebef;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.prep-intro-line-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.prep-intro-line-tag {
    font-size: 0.82rem;
    font-weight: 600;
    color: #888;
    letter-spacing: 0.02em;
}

.prep-intro-line-del {
    border: none;
    background: transparent;
    color: #f56c6c;
    font-size: 0.86rem;
    padding: 4px 8px;
    cursor: pointer;
    border-radius: 4px;
}

.prep-intro-line-del:hover,
.prep-intro-line-del:focus-visible {
    background: #fff1f0;
}

.prep-intro-line-input {
    width: 100%;
    min-width: 0;
    min-height: 72px;
    padding: 11px 12px;
    border: 1px solid #dde1e6;
    border-radius: 8px;
    font-size: 0.95rem;
    line-height: 1.55;
    font-family: inherit;
    resize: vertical;
    background: #fafbfc;
}

.prep-intro-line-input:focus {
    outline: none;
    border-color: #2f9e44;
    background: #fff;
    box-shadow: 0 0 0 2px rgba(47, 158, 68, 0.12);
}

.prep-intro-line-tools {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 20px;
    padding: 10px 12px;
    background: #f8f9fb;
    border: 1px solid #eef0f3;
    border-radius: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.prep-intro-tool-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.prep-intro-tool-group + .prep-intro-tool-group {
    padding-left: 20px;
    border-left: 1px solid #e4e8ec;
}

.prep-intro-tool-label {
    flex: 0 0 auto;
    font-size: 0.84rem;
    color: #666;
    white-space: nowrap;
    line-height: 1;
}

.prep-intro-line-tools .prep-intro-line-color {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    max-width: 36px !important;
    padding: 2px !important;
    flex-shrink: 0;
    border: 1px solid #dde1e6;
    border-radius: 6px;
    cursor: pointer;
}

.prep-intro-font-size {
    width: 56px;
    min-width: 56px;
    height: 36px;
    min-height: 36px;
    padding: 0 8px;
    border: 1px solid #dde1e6;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    color: #333;
    background: #fff;
    flex-shrink: 0;
}

.prep-intro-font-size:focus {
    outline: none;
    border-color: #2f9e44;
    box-shadow: 0 0 0 2px rgba(47, 158, 68, 0.12);
}

.prep-intro-font-unit {
    flex: 0 0 auto;
    font-size: 0.84rem;
    color: #666;
    line-height: 1;
    white-space: nowrap;
}

.prep-intro-empty-tip {
    padding: 18px 14px;
    text-align: center;
    color: #999;
    font-size: 0.9rem;
    background: #f8f9fb;
    border: 1px dashed #dde1e6;
    border-radius: 8px;
}

.prep-intro-modal-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.prep-intro-modal-actions .prep-add-step-btn,
.prep-intro-modal-actions .prep-clear-intro-btn {
    flex: 1;
    min-width: 120px;
    margin-top: 0;
}

.prep-clear-intro-btn {
    border-color: #f5c6cb !important;
    color: #e03131 !important;
}

.prep-intro-modal-box {
    max-width: 580px;
}

.prep-intro-line {
    line-height: 1.6;
    margin-bottom: 4px;
    white-space: pre-wrap;
    word-break: break-word;
}

.prep-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f5f5f5;
    line-height: 1.55;
}

.prep-row:last-child {
    border-bottom: none;
}

.prep-row-name {
    flex: 0 0 118px;
    min-width: 96px;
    font-weight: 600;
    word-break: break-all;
}

.prep-row-steps {
    flex: 1;
    min-width: 0;
    word-break: break-word;
}

.prep-arrow {
    color: #999;
    margin: 0 4px;
}

.prep-muted {
    color: #bbb;
}

.prep-color-field {
    flex: 1;
    min-width: 200px;
}

.prep-field-label {
    display: block;
    font-size: 0.78rem;
    color: #888;
    margin-bottom: 4px;
}

.prep-color-input-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.prep-text-input {
    flex: 1;
    min-width: 120px;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
}

.prep-color-picker {
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    background: #fff;
}

.prep-color-hex {
    width: 88px;
    padding: 8px 6px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.85rem;
    font-family: monospace;
}

@media (max-width: 768px) {
    .prep-modal-wrap.modal {
        align-items: flex-end;
        padding: 0;
    }

    .prep-modal-wrap .prep-modal-box {
        max-width: 100%;
        width: 100%;
        max-height: 90vh;
        border-radius: 16px 16px 0 0;
    }

    .prep-modal-wrap .modal-header {
        padding: 14px 18px;
    }

    .prep-modal-wrap .modal-body {
        padding: 16px 18px 12px;
    }

    .prep-modal-wrap .modal-footer {
        padding: 14px 18px calc(14px + env(safe-area-inset-bottom, 0px));
    }

    .prep-step-row {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 10px;
        padding: 12px;
    }

    .prep-step-num {
        width: 26px;
        flex-shrink: 0;
    }

    .prep-step-input {
        flex: 1 1 calc(100% - 120px);
        min-width: 0;
    }

    .prep-step-row .prep-step-color {
        margin-left: auto;
    }

    .prep-step-remove {
        width: auto;
        margin-left: auto;
        padding: 4px 0;
    }

    .prep-row {
        flex-direction: column;
        gap: 6px;
    }

    .prep-row-actions {
        width: 100%;
    }

    .prep-action-btn {
        flex: 1;
        min-height: 38px !important;
    }

    .prep-row-name {
        flex: none;
        width: 100%;
    }

    .preparation-card {
        padding: 12px 10px;
    }

    .prep-toolbar {
        --prep-filter-h: 40px;
        gap: 6px;
    }

    .prep-search-input {
        font-size: 16px;
        line-height: var(--prep-filter-h);
    }

    #page-preparation .prep-category-wrap .custom-select-trigger {
        font-size: 16px;
        padding: 0 24px 0 8px;
        background-position: right 6px center;
    }

    .prep-category-wrap {
        width: 34%;
        max-width: 124px;
        min-width: 84px;
    }

    .prep-category-filter {
        font-size: 16px;
        padding: 0 24px 0 8px;
        background-position: right 6px center;
    }

    .prep-section-title {
        font-size: 1.15rem;
    }

    .prep-intro-edit-link {
        min-height: 36px;
        padding: 6px 12px;
        font-size: 0.85rem;
        border-radius: 6px;
        background: #f5f7f6;
    }

    .prep-intro-edit-link:active {
        background: #e8f5e9;
        color: #2f9e44;
    }

    .prep-intro-line-row {
        padding: 14px 12px;
        gap: 14px;
    }

    .prep-intro-line-input {
        font-size: 16px;
        min-height: 88px;
    }

    .prep-intro-line-tools {
        gap: 16px;
        padding: 12px;
    }

    .prep-intro-tool-group + .prep-intro-tool-group {
        padding-left: 16px;
    }

    .prep-intro-font-size {
        width: 60px;
        min-width: 60px;
        height: 40px;
        min-height: 40px;
        font-size: 16px;
    }

    .prep-intro-line-tools .prep-intro-line-color {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        max-width: 40px !important;
    }

    .prep-intro-line-del {
        min-height: 36px;
        padding: 6px 10px;
    }

    .prep-intro-modal-box {
        width: calc(100% - 24px);
        max-width: none;
        margin: 12px;
    }

    .prep-intro-modal-box .prep-modal-footer .btn-primary,
    .prep-intro-modal-box .prep-modal-footer .btn-cancel {
        min-height: 42px;
    }
}

/* ===== 操作日志 ===== */
.operation-log-card {
    padding: 16px 18px;
}

.operation-log-card .section-desc {
    margin: 0 0 14px;
    padding: 0 2px;
    color: #888;
    font-size: 0.88rem;
    line-height: 1.5;
}

.operation-log-filter-bar {
    margin-bottom: 14px;
}

.op-log-filter-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
    background: linear-gradient(180deg, #fafbfc 0%, #fff 100%);
    border: 1px solid #eef0f3;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}

.op-log-filter-row-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.op-log-filter-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.op-log-filter-item.op-log-filter-keyword {
    width: 100%;
}

.op-log-filter-dates {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.op-log-date-range {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-width: 0;
}

.op-log-date-wrap {
    flex: 1 1 0;
    min-width: 0;
}

.op-log-filter-label {
    font-size: 0.8rem;
    color: #999;
    font-weight: 500;
}

.op-log-filter-select,
.op-log-filter-input {
    height: 40px;
    padding: 0 12px;
    border: 1px solid #e0e4e8;
    border-radius: 10px;
    font-size: 0.92rem;
    background: #fff;
    color: #333;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.op-log-filter-select:hover,
.op-log-filter-input:hover {
    border-color: #ff9a56;
}

.op-log-filter-select:focus,
.op-log-filter-input:focus {
    border-color: #ff6b6b;
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}

.op-log-filter-input::placeholder {
    color: #bbb;
}

.operation-log-box {
    margin-top: 8px;
}

.operation-log-toolbar-wrap {
    margin: 0 0 12px;
}

.op-log-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 10px 12px;
    background: #fafbfc;
    border: 1px solid #eef0f3;
    border-radius: 10px;
}

.op-log-mobile-bar {
    display: none;
}

.op-log-select-all {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    color: #666;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.op-log-select-all input,
.op-log-check-input,
.op-log-card-check input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: #ff6b6b;
    flex-shrink: 0;
}

.op-log-selected-hint {
    font-size: 0.85rem;
    color: #ff6b6b;
    font-weight: 500;
    min-height: 1.2em;
}

.op-log-batch-delete-btn {
    margin-left: auto;
    height: 34px;
    padding: 0 14px;
    font-size: 0.86rem;
    border-radius: 8px;
    white-space: nowrap;
}

.op-log-batch-delete-btn.is-empty,
.op-log-batch-delete-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.op-log-card-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin: -4px 0 -4px -4px;
    flex-shrink: 0;
    cursor: pointer;
}

.op-log-card.selected {
    border-color: #ffb4b4;
    box-shadow: 0 2px 10px rgba(255, 107, 107, 0.12);
}

.operation-log-empty {
    text-align: center;
    color: #999;
    padding: 36px 12px;
}

/* ===== PC 操作日志：时间轴列表 ===== */
.op-log-list-desktop {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid #e8ecf1;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.op-log-desk-row {
    display: grid;
    grid-template-columns: 40px 108px minmax(0, 1fr);
    gap: 12px 14px;
    align-items: start;
    padding: 16px 18px;
    border-bottom: 1px solid #f1f3f5;
    transition: background 0.15s ease;
}

.op-log-desk-row:last-child {
    border-bottom: none;
}

.op-log-desk-row:hover {
    background: #fafbfd;
}

.op-log-desk-row.selected {
    background: rgba(255, 107, 107, 0.05);
}

.op-log-desk-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin-top: 2px;
    cursor: pointer;
}

.op-log-desk-time {
    padding-top: 2px;
    line-height: 1.25;
    white-space: nowrap;
}

.op-log-time-date {
    display: block;
    color: #334155;
    font-size: 0.86rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.op-log-time-clock {
    display: block;
    margin-top: 3px;
    color: #94a3b8;
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
}

.op-log-desk-body {
    min-width: 0;
}

.op-log-desk-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    margin-bottom: 8px;
}

.op-log-action-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 2px 9px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
    border: none;
}

.op-log-action-create {
    color: #166534;
    background: #dcfce7 !important;
}

.op-log-action-edit {
    color: #1e40af;
    background: #dbeafe !important;
}

.op-log-action-delete {
    color: #991b1b;
    background: #fee2e2 !important;
}

.op-log-action-refund {
    color: #9a3412;
    background: #ffedd5 !important;
}

.op-log-desk-module {
    color: #64748b;
    font-size: 0.82rem;
}

.op-log-desk-module::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 3px;
    margin-right: 10px;
    margin-bottom: 2px;
    border-radius: 50%;
    background: #cbd5e1;
    vertical-align: middle;
}

.op-log-desk-target {
    color: #0f172a;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.35;
}

.op-log-desk-detail {
    color: #64748b;
    font-size: 0.88rem;
    line-height: 1.55;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.op-log-desk-meta {
    margin-top: 6px;
    color: #94a3b8;
    font-size: 0.78rem;
}

/* 操作详情中的颜色块（hex 由后端写入 {{color:#RRGGBB}}，前端渲染） */
.op-log-color-swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    border: 1px solid rgba(15, 23, 42, 0.18);
    vertical-align: -1px;
    margin: 0 4px;
    box-sizing: border-box;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

@media (max-width: 768px) {
    .op-log-color-swatch {
        width: 16px;
        height: 16px;
        vertical-align: -3px;
        margin: 0 4px;
    }
}

body.dark-theme .op-log-color-swatch {
    border-color: rgba(255, 255, 255, 0.35);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
}

/* APK/手机端：卡片列表（与员工管理、订单卡片风格一致） */
.op-log-list-mobile {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.op-log-card {
    background: #fff;
    border: 1px solid #e8eaed;
    border-radius: 10px;
    padding: 14px 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.op-log-card-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.op-log-card-time {
    font-size: 0.82rem;
    color: #999;
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: auto;
}

.op-log-card-meta {
    font-size: 0.86rem;
    color: #666;
    margin-bottom: 6px;
}

.op-log-card-target {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
    word-break: break-all;
}

.op-log-card-detail {
    font-size: 0.88rem;
    color: #555;
    line-height: 1.5;
    word-break: break-word;
}

.operation-log-pager {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #f0f2f5;
}

.operation-log-pager-inner {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

/* admin-dom.js 通用分页 / 空状态 */
.admin-pager,
.admin-pager-bar,
.revenue-page-bar {
    --admin-pager-h: 36px;
}

/* 分页页码文案：仅桌面显示完整版 */
@media (min-width: 769px) {
    .pager-info-short {
        display: none;
    }
}

.admin-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 10px;
    margin-top: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

.admin-pager-bar {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #f0f2f5;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

.admin-pager-bar-dish {
    margin-top: 16px;
}

.admin-pager .btn-default,
.admin-pager-bar .btn-default,
.revenue-page-bar .btn-default,
.operation-log-pager-inner .btn-default {
    margin-right: 0;
    min-width: 72px;
    height: var(--admin-pager-h);
    min-height: var(--admin-pager-h);
    max-height: var(--admin-pager-h);
    padding: 0 14px;
    font-size: 0.88rem;
    line-height: var(--admin-pager-h);
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: 1px solid transparent;
    vertical-align: middle;
    flex-shrink: 0;
}

.admin-pager .btn-default:disabled,
.admin-pager-bar .btn-default:disabled,
.revenue-page-bar .btn-default:disabled,
.operation-log-pager .btn-default:disabled,
.member-list-pager .btn-default:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.admin-page-info {
    color: #888;
    font-size: 0.88rem;
    line-height: var(--admin-pager-h);
    white-space: nowrap;
    flex-shrink: 0;
}

.admin-page-info-muted {
    color: #aaa;
}

.admin-page-size {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 4px;
    height: var(--admin-pager-h);
    flex-shrink: 0;
    vertical-align: middle;
}

.admin-page-size-label {
    color: #888;
    font-size: 0.88rem;
    white-space: nowrap;
    line-height: var(--admin-pager-h);
}

.admin-page-size-box {
    display: inline-flex;
    align-items: stretch;
    width: 92px;
    height: var(--admin-pager-h);
    min-height: var(--admin-pager-h);
    max-height: var(--admin-pager-h);
    flex-shrink: 0;
    box-sizing: border-box;
}

.admin-page-size-box .custom-select-wrapper {
    flex: 1;
    width: 100%;
    height: 100%;
    min-width: 0;
    display: flex;
}

.admin-page-size-box .custom-select-trigger {
    height: var(--admin-pager-h);
    min-height: var(--admin-pager-h);
    max-height: var(--admin-pager-h);
    padding: 0 26px 0 8px;
    font-size: 0.88rem;
    line-height: 1.2;
    border-radius: 6px;
    background-color: #f0f2f5;
    border: 1px solid #e0e4e8;
    box-shadow: none;
    box-sizing: border-box;
}

.admin-page-size-box .custom-select-trigger:hover {
    border-color: #ff9a56;
    box-shadow: none;
}

.admin-page-size-box .custom-select-trigger.is-open,
.admin-page-size-box .custom-select-trigger:focus-visible {
    border-color: #ff6b6b;
    box-shadow: 0 0 0 2px rgba(255, 107, 107, 0.1);
}

.admin-page-size-box .admin-page-size-select {
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: 100%;
    padding: 0 26px 0 8px;
    border: 1px solid #e0e4e8;
    border-radius: 6px;
    background-color: #f0f2f5;
    color: #555;
    font-size: 0.88rem;
    line-height: var(--admin-pager-h);
    cursor: pointer;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, #999 50%), linear-gradient(135deg, #999 50%, transparent 50%);
    background-position: calc(100% - 14px) calc(50% + 1px), calc(100% - 9px) calc(50% + 1px);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

.admin-page-size-box .admin-page-size-select:hover {
    border-color: #ff9a56;
}

.admin-page-size-box .admin-page-size-select:focus {
    border-color: #ff6b6b;
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 107, 107, 0.1);
}

.revenue-page-num,
.revenue-page-info {
    font-size: 0.88rem;
    color: #666;
    line-height: var(--admin-pager-h);
    white-space: nowrap;
    flex-shrink: 0;
}

.member-list-pager {
    margin-top: 12px;
}

.admin-table-empty {
    text-align: center;
    padding: 24px 12px;
    color: #999;
}

.admin-empty-state {
    text-align: center;
    color: #999;
    padding: 36px 12px;
}

.category-empty-mobile {
    text-align: center;
    padding: 40px 12px;
    color: #bbb;
    grid-column: 1 / -1;
}

.operation-log-page-info {
    color: #888;
    font-size: 0.88rem;
    line-height: var(--admin-pager-h, 36px);
    white-space: nowrap;
    flex-shrink: 0;
}

/* 分页移动页码文案：放文件后部，确保不被桌面规则盖掉 */
@media (max-width: 768px) {
    .admin-pager .pager-info-full,
    .admin-pager-bar .pager-info-full,
    .revenue-page-bar .pager-info-full,
    .operation-log-pager-inner .pager-info-full {
        display: none !important;
    }

    .admin-pager .pager-info-short,
    .admin-pager-bar .pager-info-short,
    .revenue-page-bar .pager-info-short,
    .operation-log-pager-inner .pager-info-short {
        display: inline !important;
        color: #666;
    }

    .pager-info-extra {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .operation-log-card {
        padding: 12px 14px;
    }

    .op-log-filter-panel {
        padding: 12px;
        gap: 10px;
    }

    .op-log-filter-row-split {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .op-log-date-range {
        flex-wrap: nowrap;
    }

    .op-log-filter-select,
    .op-log-filter-input {
        height: 38px;
        font-size: 0.88rem;
    }

    .op-log-list-desktop {
        display: none;
    }

    .op-log-toolbar {
        display: none;
    }

    .op-log-mobile-bar {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px 12px;
        margin-bottom: 2px;
        background: #fafbfc;
        border: 1px solid #eef0f3;
        border-radius: 10px;
    }

    .op-log-batch-delete-btn {
        height: 36px;
        padding: 0 12px;
        font-size: 0.84rem;
        border-radius: 9px;
    }

    .op-log-selected-hint-mobile {
        flex: 1;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .op-log-card {
        padding: 12px 14px;
    }

    .op-log-card-time {
        font-size: 0.78rem;
    }

    .op-log-card-target {
        font-size: 0.95rem;
    }
}

/* ===== 移动端自定义日期选择器 ===== */
body.admin-date-picker-open {
    overflow: hidden;
}

.admin-date-picker-overlay {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.45);
    overscroll-behavior: none;
}

.admin-date-picker {
    width: min(100%, 360px);
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}

.admin-date-picker-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 12px 8px;
    background: linear-gradient(135deg, #26a69a 0%, #00897b 100%);
    color: #fff;
}

.admin-date-picker-title {
    font-size: 1.05rem;
    font-weight: 600;
}

.admin-date-picker-nav {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}

.admin-date-picker-selected {
    padding: 8px 16px 12px;
    background: linear-gradient(135deg, #26a69a 0%, #00897b 100%);
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.92rem;
}

.admin-date-picker-weekdays,
.admin-date-picker-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    padding: 8px 12px;
}

.admin-date-picker-weekdays {
    padding-bottom: 4px;
    color: #999;
    font-size: 0.82rem;
    text-align: center;
}

.admin-date-picker-grid {
    padding-top: 0;
    padding-bottom: 12px;
}

.admin-date-picker-day {
    aspect-ratio: 1;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #333;
    font-size: 0.92rem;
    cursor: pointer;
}

.admin-date-picker-day.is-empty {
    pointer-events: none;
}

.admin-date-picker-day.is-today {
    color: #00897b;
    font-weight: 700;
}

.admin-date-picker-day.is-selected {
    background: #26a69a;
    color: #fff;
    font-weight: 600;
}

.admin-date-picker-footer {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 10px 14px 14px;
    border-top: 1px solid #f0f2f5;
}

.admin-date-picker-btn {
    min-width: 64px;
    height: 38px;
    padding: 0 14px;
    border: none;
    border-radius: 8px;
    font-size: 0.92rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
}

.admin-date-picker-btn-muted {
    background: transparent;
    color: #e57373;
}

.admin-date-picker-btn-primary {
    background: linear-gradient(135deg, #ff9a56 0%, #ff6b6b 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.25);
}

.admin-date-input[readonly] {
    cursor: pointer;
    caret-color: transparent;
}

/* 出餐排队设置 */
.shop-prep-setting {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.shop-prep-setting label {
    color: #666;
    font-size: 0.92rem;
}

.shop-prep-setting input {
    width: 120px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid #e0e4e8;
    border-radius: 8px;
    font-size: 0.95rem;
}

/* 订单出餐超时 */
.order-card-overtime {
    border-color: #ffccc7;
    box-shadow: 0 2px 12px rgba(255, 77, 79, 0.12);
}

.order-card-overtime .order-header {
    background: linear-gradient(180deg, #fff5f5 0%, #fff 100%);
}

.order-overtime-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    background: #fff1f0;
    color: #cf1322;
    border: 1px solid #ffa39e;
    font-size: 0.78rem;
    font-weight: 600;
}

.order-prep-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    background: #fff7e6;
    color: #d46b08;
    border: 1px solid #ffd591;
    font-size: 0.78rem;
}

/* dish modal height + spec editor */
#dishModal.modal {
    align-items: center;
    padding: 24px 16px;
    overflow: hidden;
}

#dishModal .dish-modal-box {
    width: 560px;
    max-width: 100%;
    max-height: calc(100vh - 48px);
    overflow: hidden;
}

#dishModal .dish-modal-box .modal-header,
#dishModal .dish-modal-box .modal-footer {
    flex-shrink: 0;
}

#dishModal .dish-modal-box .modal-body {
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* dish prep fields：避开 .form-item input{width:100%}；不依赖 :has()（安卓 WebView） */
.dish-prep-block {
    margin: 0 0 16px;
    padding: 12px 14px;
    background: #fafbfc;
    border: 1px solid #eef0f3;
    border-radius: 8px;
    box-sizing: border-box;
}

.dish-prep-block .form-item {
    margin-bottom: 12px;
}

.dish-prep-block .form-item:last-child {
    margin-bottom: 0;
}

.dish-prep-block .dish-prep-minutes-item input[type="number"] {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}

.dish-prep-concurrent-label-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.dish-prep-concurrent-label {
    display: inline;
    margin-bottom: 0;
    color: #666;
    font-size: 0.93rem;
}

.dish-prep-help {
    width: 20px;
    height: 20px;
    min-width: 20px;
    border-radius: 50%;
    border: 1px solid #c5cad0;
    background: #fff;
    color: #888;
    font-size: 12px;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
}

.dish-prep-help:active {
    background: #f0f2f5;
}

.dish-prep-help-body p {
    margin: 0 0 12px;
    font-size: 0.93rem;
    color: #444;
    line-height: 1.55;
}

.dish-prep-help-body p:last-child {
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .dish-prep-help {
        width: 24px;
        height: 24px;
        min-width: 24px;
        font-size: 13px;
    }
}

.dish-prep-radio-row {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 10px;
    width: 100%;
}

.dish-prep-radio {
    display: -webkit-inline-flex !important;
    display: inline-flex !important;
    -webkit-flex: 1 1 0;
    flex: 1 1 0;
    -webkit-flex-direction: row;
    flex-direction: row;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: center;
    justify-content: center;
    gap: 8px;
    margin: 0 !important;
    padding: 12px 10px;
    min-height: 44px;
    border: 1px solid #e0e4e8;
    border-radius: 8px;
    background: #fff;
    color: #333 !important;
    font-size: 0.93rem;
    font-weight: 500 !important;
    cursor: pointer;
    white-space: nowrap;
    line-height: 1.2;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
}

.dish-prep-radio input[type="radio"] {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    max-width: 18px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    -webkit-appearance: radio;
    appearance: radio;
    flex-shrink: 0;
}

.dish-prep-radio span {
    color: #333;
    pointer-events: none;
}

.dish-prep-radio.is-checked {
    border-color: var(--primary-color, #ff6b6b);
    background: #fff7f5;
}

.dish-prep-radio.is-disabled,
.dish-prep-concurrent-item.is-disabled .dish-prep-radio {
    opacity: 0.45;
    cursor: not-allowed;
}

.dish-prep-concurrent-item.is-disabled {
    opacity: 0.55;
}

@media (max-width: 768px) {
    .dish-prep-block {
        padding: 12px;
    }

    .dish-prep-radio-row {
        gap: 8px;
    }

    .dish-prep-radio {
        min-height: 48px;
        padding: 12px 8px;
        font-size: 1rem;
    }

    .dish-prep-block .dish-prep-minutes-item input[type="number"] {
        min-height: 44px;
        font-size: 16px; /* 避免 iOS/部分安卓自动放大页面 */
    }
}

/* dish spec / topping editor (outside .form-item to avoid width:100%) */
.dish-spec-block {
    margin-top: 4px;
    margin-bottom: 8px;
    padding-top: 12px;
    border-top: 1px solid #f0f2f5;
}

.dish-spec-title {
    font-size: 0.93rem;
    color: #666;
    margin-bottom: 10px;
    font-weight: 500;
}

.dish-spec-title small {
    color: #999;
    font-weight: 400;
}

.dish-spec-subtitle {
    margin-top: 16px;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.93rem;
    color: #333;
}

.dish-spec-add-btn {
    margin-top: 8px;
}

.dish-spec-groups,
.dish-topping-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dish-spec-group {
    border: 1px solid #e8eaed;
    border-radius: 8px;
    padding: 12px;
    background: #fafbfc;
}

.dish-spec-group-head {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding: 8px 10px;
    background: #f0f3f7;
    border: 1px solid #e2e6ec;
    border-radius: 6px;
}

.dish-spec-group-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    flex: 0 0 auto;
}

.dish-spec-option-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dish-spec-input {
    box-sizing: border-box;
    width: auto;
    min-width: 0;
    padding: 7px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    font-family: inherit;
}

.dish-spec-input:focus {
    border-color: #ff6b6b;
}

.dish-spec-name {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
    background: #fff;
    font-weight: 600;
}

.dish-spec-option,
.dish-topping-row {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) 72px auto auto 36px;
    gap: 8px;
    align-items: end;
    padding: 8px 10px;
    background: #fff;
    border: 1px solid #eef0f3;
    border-radius: 6px;
}

.dish-topping-row {
    grid-template-columns: minmax(120px, 1fr) 72px 72px 36px;
}

.dish-spec-option > .dish-spec-input,
.dish-topping-row > .dish-spec-input {
    width: 100%;
    min-width: 0;
}

.dish-spec-field {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin: 0;
    font-size: 11px;
    color: #888;
    min-width: 0;
}

.dish-spec-field span {
    line-height: 1.2;
    white-space: nowrap;
}

.dish-spec-field input[type='number'] {
    box-sizing: border-box;
    width: 100%;
    padding: 7px 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    color: #333;
    outline: none;
    font-family: inherit;
}

.dish-spec-field input[type='number']:focus {
    border-color: #ff6b6b;
}

.dish-spec-check {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding-bottom: 8px;
    font-size: 12px;
    color: #555;
    white-space: nowrap;
    cursor: pointer;
    line-height: 1;
}

.dish-spec-check input {
    width: auto !important;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
}

.dish-spec-empty {
    color: #999;
    font-size: 13px;
    padding: 4px 0;
}

.dish-spec-mini-btn {
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 4px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 12px;
    line-height: 1.2;
    flex-shrink: 0;
    white-space: nowrap;
}

.dish-spec-option .dish-spec-mini-btn,
.dish-topping-row .dish-spec-mini-btn {
    justify-self: end;
    margin-bottom: 1px;
}

.dish-spec-mini-btn.danger {
    color: #e74c3c;
    border-color: #f5c6cb;
}

.dish-spec-mini-btn:hover {
    background: #f7f8fa;
}

/* 安卓/窄屏：强制一行；加价只留两位数宽，剩余全给选项名 */
@media (max-width: 768px) {
    .dish-spec-group-head {
        gap: 6px;
        padding: 7px 8px;
    }

    .dish-spec-group-actions {
        gap: 6px;
    }

    .dish-spec-group-actions .dish-spec-mini-btn {
        padding: 6px 8px;
    }

    .dish-spec-option {
        display: flex;
        flex-wrap: nowrap;
        align-items: flex-end;
        gap: 4px;
    }

    .dish-spec-option > .dish-spec-input {
        flex: 1 1 0;
        min-width: 0;
        width: auto;
    }

    .dish-spec-option > .dish-spec-field {
        flex: 0 0 42px;
        width: 42px;
    }

    .dish-spec-option > .dish-spec-check {
        flex: 0 0 auto;
        padding-bottom: 6px;
        font-size: 11px;
        gap: 2px;
    }

    .dish-spec-option > .dish-spec-mini-btn {
        flex: 0 0 auto;
        padding: 6px 7px;
        margin-left: 0;
        justify-self: auto;
    }

    .dish-topping-row {
        display: flex;
        flex-wrap: nowrap;
        align-items: flex-end;
        gap: 4px;
    }

    .dish-topping-row > .dish-spec-input {
        flex: 1 1 0;
        min-width: 0;
        width: auto;
    }

    .dish-topping-row > .dish-spec-field {
        flex: 0 0 42px;
        width: 42px;
    }

    .dish-topping-row > .dish-spec-mini-btn {
        flex: 0 0 auto;
        padding: 6px 7px;
        margin-left: 0;
        justify-self: auto;
    }

    .dish-spec-field span {
        font-size: 10px;
        letter-spacing: -0.02em;
    }

    .dish-spec-field input[type='number'] {
        padding: 7px 2px;
        text-align: center;
        -moz-appearance: textfield;
        appearance: textfield;
    }

    .dish-spec-field input[type='number']::-webkit-outer-spin-button,
    .dish-spec-field input[type='number']::-webkit-inner-spin-button {
        -webkit-appearance: none;
        margin: 0;
    }
}

/* ========== 系统维护 / 健康检查（APK 友好） ========== */
.system-health-card {
    max-width: 720px;
}

.system-health-actions {
    margin: 12px 0 10px;
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    align-items: stretch;
}

.system-health-actions .btn-primary,
.system-health-actions .btn-danger {
    flex: 1 1 0;
    min-width: 0;
    min-height: 40px;
}

.system-last-restart {
    margin: 0 0 12px;
    font-size: 13px;
    line-height: 1.45;
    color: #64748b;
}

body.dark-theme .system-last-restart {
    color: #94a3b8;
}

.system-restart-tip {
    margin: -2px 0 14px;
    font-size: 13px;
    line-height: 1.5;
}

.system-restart-tip code {
    font-size: 12px;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.06);
}

.system-health-progress {
    margin-bottom: 14px;
}

.system-health-progress-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.system-health-progress-bar {
    height: 8px;
    border-radius: 999px;
    background: #e8ecf1;
    overflow: hidden;
}

.system-health-progress-bar i {
    display: block;
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, #3b82f6, #22c55e);
    transition: width .25s ease;
}

.system-health-progress-text {
    margin: 0;
    font-size: 13px;
    color: #64748b;
    flex: 1;
    min-width: 0;
}

.system-health-progress-pct {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

.system-health-idle {
    padding: 12px 14px;
    border-radius: 10px;
    background: #f8fafc;
    color: #475569;
    font-size: 13px;
    line-height: 1.55;
}

.system-health-idle ul {
    margin: 8px 0 0;
    padding-left: 1.2em;
}

.system-health-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.system-health-item {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 14px;
    background: #fff;
}

.system-health-item.is-ok {
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.system-health-item.is-fail {
    border-color: #fecaca;
    background: #fef2f2;
}

.system-health-item.is-pending,
.system-health-item.is-running {
    border-color: #e2e8f0;
    background: #f8fafc;
}

.system-health-item.is-running {
    border-color: #bfdbfe;
    background: #eff6ff;
}

.system-health-item-top {
    display: flex;
    align-items: center;
    gap: 8px;
}

.system-health-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

.system-health-item.is-ok .system-health-icon {
    background: #22c55e;
    color: #fff;
}

.system-health-item.is-fail .system-health-icon {
    background: #ef4444;
    color: #fff;
}

.system-health-item.is-pending .system-health-icon,
.system-health-item.is-running .system-health-icon {
    background: #94a3b8;
    color: #fff;
}

.system-health-item.is-running .system-health-icon {
    background: #3b82f6;
}

.system-health-name {
    font-weight: 600;
    font-size: 15px;
    color: #0f172a;
    flex: 1;
    min-width: 0;
}

.system-health-ms {
    font-size: 12px;
    color: #94a3b8;
    flex-shrink: 0;
}

.system-health-msg {
    margin-top: 8px;
    font-size: 13px;
    line-height: 1.5;
    color: #475569;
    word-break: break-word;
}

body.dark-theme .system-health-progress-bar {
    background: #334155;
}

body.dark-theme .system-health-progress-pct {
    color: #f1f5f9;
}

body.dark-theme .system-health-idle,
body.dark-theme .system-health-item {
    background: #1e293b;
    border-color: #334155;
    color: #cbd5e1;
}

body.dark-theme .system-health-item.is-ok {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.35);
}

body.dark-theme .system-health-item.is-fail {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.35);
}

body.dark-theme .system-health-name {
    color: #f1f5f9;
}

body.dark-theme .system-health-msg {
    color: #94a3b8;
}

/* —— 服务器日志查看（模态框样式卡片，控件高度勿再乱改） —— */
.system-log-card {
    margin-top: 14px;
    padding: 0;
    overflow: visible;
    background: transparent;
    border: none;
    box-shadow: none;
}

.system-log-modal {
    background: #fff;
    border-radius: 10px;
    overflow: visible;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    border: 1px solid #e8ecf0;
}

.system-log-modal-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid #eef1f4;
    background: #fafbfc;
}

.system-log-title {
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
    font-size: 16px;
    font-weight: 600;
    color: #0f172a;
}

.system-log-auto-tip {
    flex: 0 0 auto;
    font-size: 12px;
    color: #94a3b8;
    white-space: nowrap;
}

.system-log-clear-btn {
    flex: 0 0 auto;
    min-height: 32px !important;
    height: 32px;
    padding: 0 12px !important;
    font-size: 13px;
}

.system-log-modal-body {
    padding: 12px 14px 14px;
}

.system-log-modal-body .section-desc {
    margin: 0 0 10px;
}

.system-log-toolbar {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 8px;
}

/* 日志文件下拉：独占一行，避免与搜索/级别挤在一起 */
.system-log-file-row {
    display: flex;
    align-items: stretch;
    gap: 8px;
    margin: 0 0 10px;
}

.system-log-file-dd {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
}

.system-log-file-dd > .system-log-dd-btn {
    width: 100%;
}

.system-log-file-menu {
    left: 0;
    right: 0;
    width: auto;
    z-index: 50;
    max-height: min(52vh, 320px);
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}

.system-log-file-menu[hidden] {
    display: none !important;
}

.system-log-file-menu-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    border-bottom: 1px solid #eef1f4;
    background: #fafbfc;
    flex: 0 0 auto;
}

.system-log-files-checkall {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #64748b;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.system-log-files-checkall input {
    margin: 0;
}

.system-log-batch-del-btn {
    flex: 0 0 auto;
    min-height: 30px !important;
    height: 30px;
    padding: 0 10px !important;
    font-size: 12px !important;
}

.system-log-batch-del-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.system-log-file-menu-list {
    flex: 1 1 auto;
    min-height: 0;
    max-height: 240px;
    overflow-y: auto;
    padding: 4px;
    -webkit-overflow-scrolling: touch;
}

.system-log-files-empty {
    padding: 14px 10px;
    text-align: center;
    color: #94a3b8;
    font-size: 13px;
}

.system-log-file-item {
    display: flex;
    align-items: center;
    gap: 6px;
    border-radius: 8px;
    padding: 2px 4px;
}

.system-log-file-item.is-active {
    background: rgba(24, 144, 255, 0.1);
}

.system-log-file-check {
    flex: 0 0 22px;
    width: 22px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
}

.system-log-file-check.is-locked {
    visibility: hidden;
}

.system-log-file-check input {
    margin: 0;
}

.system-log-file-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    border: none;
    background: transparent;
    padding: 6px 8px;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    border-radius: 6px;
}

.system-log-file-main:hover {
    background: rgba(15, 23, 42, 0.04);
}

.system-log-file-name {
    font-size: 13px;
    color: #0f172a;
    word-break: break-all;
    line-height: 1.35;
}

.system-log-file-meta {
    font-size: 11px;
    color: #94a3b8;
    line-height: 1.3;
}

body.dark-theme .system-log-file-menu-head {
    background: #0f172a;
    border-bottom-color: #2a3344;
}

body.dark-theme .system-log-file-item.is-active {
    background: rgba(24, 144, 255, 0.18);
}

body.dark-theme .system-log-file-name {
    color: #f1f5f9;
}

body.dark-theme .system-log-file-main:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* 搜索框 / 下拉按钮：统一白底浅边；高度保持 36px */
.system-log-ctrl {
    box-sizing: border-box;
    flex: 1 1 0;
    width: 0;
    min-width: 0;
    height: 36px;
    margin: 0;
    padding: 0 12px;
    border: 1px solid #e0e4e8;
    border-radius: 8px;
    background-color: #fff;
    color: #333;
    font-size: 14px;
    font-family: inherit;
    font-weight: 400;
    line-height: 34px;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* 搜索框收窄到约等于占位文字宽度 */
.system-log-keyword {
    flex: 0 0 auto;
    width: 10.5em;
    max-width: 38%;
}

.system-log-ctrl:focus {
    border-color: #94a3b8;
}

.system-log-dd {
    position: relative;
    flex: 1 1 0;
    width: 0;
    min-width: 0;
}

.system-log-dd-btn {
    display: block;
    width: 100%;
    flex: none;
    padding-right: 28px;
    text-align: left;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 14px;
}

.system-log-dd-menu {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    z-index: 40;
    margin: 0;
    padding: 4px;
    border: 1px solid #e0e4e8;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
}

.system-log-dd-menu[hidden] {
    display: none !important;
}

.system-log-dd-menu button {
    display: block;
    width: 100%;
    margin: 0;
    padding: 8px 10px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #333;
    font-size: 14px;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
}

.system-log-dd-menu button:hover,
.system-log-dd-menu button.is-active {
    background: #f1f5f9;
}

.system-log-meta {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 8px;
    word-break: break-all;
}

/* 日志内容面板高度：勿改乱 */
.system-log-panel-wrap {
    position: relative;
}

.system-log-panel {
    min-height: 200px;
    max-height: min(52vh, 420px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #0b1220;
    color: #e2e8f0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
}

.system-log-fs-btn {
    position: absolute;
    right: 10px;
    bottom: 10px;
    z-index: 3;
    min-height: 32px;
    height: 32px;
    padding: 0 12px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.88);
    color: #e2e8f0;
    font-size: 12px;
    font-family: inherit;
    line-height: 1;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.system-log-fs-btn:active {
    opacity: 0.85;
}

/* 日志全屏：盖住整页，安卓用 dvh + safe-area */
.system-log-panel-wrap.is-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: flex;
    flex-direction: column;
    padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
    background: #0b1220;
    box-sizing: border-box;
}

.system-log-panel-wrap.is-fullscreen .system-log-panel {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    height: 100%;
    border-radius: 0;
    border: none;
    font-size: 12px;
}

.system-log-panel-wrap.is-fullscreen .system-log-fs-btn {
    right: max(12px, env(safe-area-inset-right, 0px));
    bottom: max(12px, env(safe-area-inset-bottom, 0px));
    min-height: 36px;
    height: 36px;
    padding: 0 14px;
    font-size: 13px;
}

body.system-log-fs-open {
    overflow: hidden;
}

body.dark-theme .system-log-fs-btn {
    border-color: rgba(148, 163, 184, 0.35);
    background: rgba(30, 41, 59, 0.92);
    color: #f1f5f9;
}

.system-log-empty {
    color: #94a3b8;
    padding: 12px 4px;
}

.system-log-line {
    padding: 3px 6px 3px 8px;
    margin: 0 -2px;
    border-radius: 4px;
    border-left: 3px solid transparent;
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
    color: #e2e8f0;
}

.system-log-line.is-error {
    border-left-color: #f87171;
    background: rgba(248, 113, 113, 0.06);
}

.system-log-line.is-warn {
    border-left-color: #fbbf24;
    background: rgba(251, 191, 36, 0.05);
}

.system-log-line.is-info {
    border-left-color: transparent;
}

.system-log-line.is-debug {
    border-left-color: transparent;
}

.system-log-line.is-live {
    animation: systemLogLiveIn .35s ease;
}

/* —— 日志语法高亮（IDEA 风格，柔和不易疲劳） —— */
.system-log-line .lg-time {
    color: #64748b;
}

.system-log-line .lg-thread {
    color: #94a3b8;
}

.system-log-line .lg-level {
    display: inline-block;
    min-width: 3.2em;
    padding: 0 5px;
    margin: 0 1px;
    border-radius: 3px;
    font-weight: 700;
    font-size: 10px;
    letter-spacing: 0.04em;
    line-height: 1.55;
    text-align: center;
    vertical-align: baseline;
}

.system-log-line .lg-level-info {
    color: #86efac;
    background: rgba(34, 197, 94, 0.22);
}

.system-log-line .lg-level-debug,
.system-log-line .lg-level-trace {
    color: #7dd3fc;
    background: rgba(56, 189, 248, 0.2);
}

.system-log-line .lg-level-warn {
    color: #fde68a;
    background: rgba(251, 191, 36, 0.22);
}

.system-log-line .lg-level-error,
.system-log-line .lg-level-fatal {
    color: #fecaca;
    background: rgba(248, 113, 113, 0.28);
}

.system-log-line .lg-logger {
    color: #f0abfc;
}

.system-log-line .lg-sep {
    color: #475569;
}

.system-log-line .lg-msg {
    color: #e2e8f0;
}

.system-log-line .lg-str {
    color: #4ade80;
}

.system-log-line .lg-num {
    color: #f9a8d4;
}

.system-log-line .lg-url {
    color: #6ee7b7;
    text-decoration: underline;
    text-decoration-color: rgba(110, 231, 183, 0.35);
}

.system-log-line .lg-bracket {
    color: #a5b4fc;
}

.system-log-line .lg-sql-mark {
    color: #67e8f9;
    font-weight: 600;
}

.system-log-line .lg-sql-kw {
    color: #93c5fd;
    font-weight: 600;
}

@keyframes systemLogLiveIn {
    from {
        background: rgba(74, 222, 128, 0.22);
    }
    to {
        background: transparent;
    }
}

body.dark-theme .system-log-modal {
    background: #1e293b;
    border-color: #334155;
}

body.dark-theme .system-log-modal-header {
    background: #0f172a;
    border-bottom-color: #334155;
}

body.dark-theme .system-log-title {
    color: #f1f5f9;
}

body.dark-theme .system-log-ctrl,
body.dark-theme .system-log-dd-menu {
    background-color: #0f172a;
    border-color: #334155;
    color: #f1f5f9;
}

body.dark-theme .system-log-dd-btn {
    background-color: #0f172a;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

body.dark-theme .system-log-dd-menu button {
    color: #f1f5f9;
}

body.dark-theme .system-log-dd-menu button:hover,
body.dark-theme .system-log-dd-menu button.is-active {
    background: #334155;
}

body.dark-theme .system-log-meta {
    color: #94a3b8;
}

body.dark-theme .system-log-panel {
    border-color: #334155;
}

@media (max-width: 768px) {
    .system-health-card {
        max-width: none;
        padding: 12px 14px;
    }

    .system-health-actions {
        flex-wrap: nowrap;
        gap: 8px;
    }

    .system-health-actions .btn-primary,
    .system-health-actions .btn-danger {
        width: auto;
        flex: 1 1 0;
        min-width: 0;
        padding-left: 8px;
        padding-right: 8px;
        font-size: 14px;
    }

    .system-last-restart {
        font-size: 12px;
        margin-bottom: 10px;
    }

    .system-health-name {
        font-size: 14px;
    }

    .system-health-msg {
        font-size: 12px;
    }

    .system-log-modal-header {
        padding: 10px 12px;
        flex-wrap: wrap;
    }

    .system-log-modal-body {
        padding: 10px 12px 12px;
    }

    .system-log-toolbar {
        gap: 6px;
    }

    .system-log-file-row {
        margin-bottom: 8px;
    }

    .system-log-file-menu {
        max-height: min(48vh, 280px);
    }

    .system-log-file-menu-list {
        max-height: 200px;
    }

    .system-log-ctrl {
        height: 34px;
        font-size: 12px;
        line-height: 32px;
        padding: 0 8px;
    }

    .system-log-keyword {
        flex: 1 1 0;
        width: 0;
        max-width: none;
        font-size: 12px;
    }

    .system-log-dd-btn {
        padding-right: 24px;
        background-position: right 8px center;
        background-size: 12px;
    }

    .system-log-dd-menu button {
        font-size: 12px;
        padding: 7px 8px;
    }

    .system-log-panel {
        min-height: 180px;
        max-height: 48vh;
        font-size: 10.5px;
    }

    .system-log-fs-btn {
        right: 8px;
        bottom: 8px;
        min-height: 34px;
        height: 34px;
        padding: 0 12px;
        font-size: 12px;
    }

    .system-log-panel-wrap.is-fullscreen .system-log-panel {
        font-size: 11px;
        padding: 12px;
    }
}

/* ========== 系统维护 Tab + 资源监控（宝塔风格，PC/安卓） ========== */
.system-maint-tabs {
    display: flex;
    gap: 6px;
    margin: 0 0 14px;
    padding: 4px;
    border-radius: 12px;
    background: #f1f5f9;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.system-maint-tab {
    flex: 1 1 0;
    min-width: 0;
    min-height: 40px;
    padding: 8px 10px;
    border: none;
    border-radius: 9px;
    background: transparent;
    color: #64748b;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s ease, color .15s ease;
}

.system-maint-tab.is-active {
    background: #fff;
    color: #0f172a;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.system-maint-pane[hidden] {
    display: none !important;
}

.system-resource-card {
    max-width: 960px;
}

.system-resource-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.system-resource-desc {
    margin: 0;
    flex: 1;
    min-width: 0;
}

.system-resource-live {
    flex-shrink: 0;
    margin-top: 2px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    background: #e2e8f0;
}

.system-resource-live.is-ok {
    color: #15803d;
    background: #dcfce7;
}

.system-resource-live.is-fail {
    color: #b91c1c;
    background: #fee2e2;
}

.system-resource-gauges {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 12px 0 18px;
}

.system-resource-gauge {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 14px 10px 12px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #e8ecf1;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.system-resource-gauge:hover,
.system-resource-gauge.is-tip-open {
    border-color: #86efac;
    box-shadow: 0 2px 10px rgba(32, 165, 58, 0.12);
}

.system-resource-hw-tip {
    position: fixed;
    z-index: 10050;
    width: min(320px, calc(100vw - 16px));
    max-height: min(50vh, 320px);
    overflow: auto;
    padding: 12px 14px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.16);
    pointer-events: auto;
    -webkit-overflow-scrolling: touch;
}

.system-resource-hw-tip-title {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
}

.system-resource-hw-tip-list {
    margin: 0;
    padding-left: 1.1em;
    font-size: 12px;
    line-height: 1.55;
    color: #334155;
    word-break: break-word;
}

.system-resource-hw-tip-list li + li {
    margin-top: 4px;
}

body.dark-theme .system-resource-hw-tip {
    background: #0f172a;
    border-color: #334155;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

body.dark-theme .system-resource-hw-tip-title {
    color: #f8fafc;
}

body.dark-theme .system-resource-hw-tip-list {
    color: #cbd5e1;
}

.system-resource-gauge-ring {
    position: relative;
    width: 92px;
    height: 92px;
}

.system-resource-gauge-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.system-resource-gauge-track,
.system-resource-gauge-prog {
    fill: none;
    stroke-width: 8;
}

.system-resource-gauge-track {
    stroke: #e8ecf1;
}

.system-resource-gauge-prog {
    stroke-linecap: round;
    transition: stroke-dashoffset .35s ease, stroke .25s ease;
}

.system-resource-gauge-center {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.system-resource-gauge-title {
    margin-top: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}

.system-resource-gauge-sub {
    margin-top: 4px;
    font-size: 12px;
    color: #20a53a;
    font-variant-numeric: tabular-nums;
    word-break: break-all;
}

.system-resource-proc-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.system-resource-proc-tab {
    min-height: 36px;
    padding: 6px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.system-resource-proc-tab.is-active {
    border-color: #20a53a;
    color: #15803d;
    background: #f0fdf4;
}

.system-resource-proc-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.system-resource-proc {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #eef2f7;
}

.system-resource-proc-rank {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    background: #e2e8f0;
}

.system-resource-proc-name {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.system-resource-proc-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    margin-top: 3px;
    font-size: 12px;
    color: #64748b;
}

.system-resource-port {
    color: #0369a1;
    font-weight: 600;
}

.system-resource-proc-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.system-resource-proc-stats .is-cpu {
    color: #15803d;
    font-weight: 700;
}

.system-resource-proc-stats .is-mem {
    color: #475569;
}

.system-resource-empty {
    padding: 16px;
    border-radius: 10px;
    background: #f8fafc;
    color: #64748b;
    font-size: 13px;
    text-align: center;
}

body.dark-theme .system-maint-tabs {
    background: #1e293b;
}

body.dark-theme .system-maint-tab {
    color: #94a3b8;
}

body.dark-theme .system-maint-tab.is-active {
    background: #0f172a;
    color: #f8fafc;
}

body.dark-theme .system-resource-gauge {
    background: #0f172a;
    border-color: #334155;
}

body.dark-theme .system-resource-gauge-track {
    stroke: #334155;
}

body.dark-theme .system-resource-gauge-title {
    color: #e2e8f0;
}

body.dark-theme .system-resource-proc {
    background: #0f172a;
    border-color: #334155;
}

body.dark-theme .system-resource-proc-name {
    color: #f1f5f9;
}

body.dark-theme .system-resource-proc-tab {
    background: #0f172a;
    border-color: #334155;
    color: #94a3b8;
}

body.dark-theme .system-resource-proc-tab.is-active {
    border-color: #22c55e;
    color: #86efac;
    background: rgba(34, 197, 94, 0.12);
}

body.dark-theme .system-resource-empty {
    background: #1e293b;
    color: #94a3b8;
}

@media (max-width: 900px) {
    .system-resource-gauges {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .system-maint-tab {
        font-size: 13px;
        min-height: 38px;
        padding: 8px 8px;
    }

    .system-resource-card {
        max-width: none;
        padding: 12px 14px;
    }

    .system-resource-head {
        flex-direction: column;
        align-items: stretch;
    }

    .system-resource-live {
        align-self: flex-start;
    }

    .system-resource-gauge-ring {
        width: 78px;
        height: 78px;
    }

    .system-resource-gauge-center {
        font-size: 15px;
    }

    .system-resource-proc {
        grid-template-columns: 24px minmax(0, 1fr);
        gap: 8px;
    }

    .system-resource-proc-stats {
        grid-column: 2;
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        gap: 12px;
        margin-top: 2px;
    }
}