/* ============================================
   团购小程序商户管理后台 - 样式表
   主色调: #FF6B35 (橙色)
   ============================================ */

/* ---------- 设计变量 ---------- */
:root {
    --primary: #FF6B35;
    --primary-dark: #E5552B;
    --primary-light: #FF8A5C;
    --primary-soft: #FFF1EB;
    --primary-hover: #FF7A47;

    --bg: #F5F6FA;
    --surface: #FFFFFF;
    --surface-2: #FAFBFC;
    --sidebar-bg: #1E1F2E;
    --sidebar-bg-2: #272838;

    --text: #1F2937;
    --text-2: #4B5563;
    --text-3: #9CA3AF;
    --text-inv: #FFFFFF;
    --text-sidebar: #B8BAC8;
    --text-sidebar-active: #FFFFFF;

    --border: #ECEEF3;
    --border-2: #F0F1F5;

    --success: #10B981;
    --success-soft: #ECFDF5;
    --warning: #F59E0B;
    --warning-soft: #FFFBEB;
    --danger: #EF4444;
    --danger-soft: #FEF2F2;
    --info: #3B82F6;
    --info-soft: #EFF6FF;

    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 16px;

    --shadow-sm: 0 1px 2px rgba(17, 24, 39, 0.04);
    --shadow: 0 4px 14px rgba(17, 24, 39, 0.06);
    --shadow-lg: 0 12px 32px rgba(17, 24, 39, 0.12);
    --shadow-primary: 0 8px 20px rgba(255, 107, 53, 0.28);

    --sidebar-w: 232px;
    --header-h: 60px;

    --font: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Helvetica Neue", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ---------- 基础重置 ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
    font-family: var(--font);
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: 14px; outline: none; }
ul, ol { list-style: none; }
img { display: block; max-width: 100%; }

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #D1D5DB; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #B8BCC4; }
::-webkit-scrollbar-track { background: transparent; }

/* ============================================
   登录页
   ============================================ */
.login-page {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #FF6B35 0%, #FF9558 45%, #FFB347 100%);
    overflow: hidden;
}
.login-page::before {
    content: '';
    position: absolute;
    width: 600px; height: 600px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    top: -200px; right: -150px;
}
.login-page::after {
    content: '';
    position: absolute;
    width: 420px; height: 420px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    bottom: -120px; left: -100px;
}
.login-card {
    position: relative;
    width: 400px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
    padding: 44px 40px 36px;
    z-index: 1;
    animation: loginIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes loginIn {
    from { opacity: 0; transform: translateY(24px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.login-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}
.login-logo-icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 22px; font-weight: 800;
    box-shadow: var(--shadow-primary);
}
.login-title { font-size: 22px; font-weight: 700; color: var(--text); }
.login-subtitle { color: var(--text-3); font-size: 13px; margin-bottom: 32px; }
.login-form .form-group { margin-bottom: 20px; }
.login-form label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: 8px;
}
.login-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.login-input-wrap .input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-3);
    font-size: 16px;
    pointer-events: none;
    display: flex;
    align-items: center;
}

.login-input-wrap .input-icon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}
.login-form input {
    width: 100%;
    height: 46px;
    padding: 0 14px 0 42px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
    transition: all 0.2s;
}
.login-form input:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px var(--primary-soft);
}
.login-btn {
    width: 100%;
    height: 46px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 1px;
    margin-top: 8px;
    transition: all 0.2s;
    box-shadow: var(--shadow-primary);
}
.login-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(255, 107, 53, 0.38); }
.login-btn:active { transform: translateY(0); }
.login-btn:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }
.login-tip {
    text-align: center;
    color: var(--text-3);
    font-size: 12px;
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px dashed var(--border);
}
.login-tip code {
    background: var(--primary-soft);
    color: var(--primary);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
}

/* ============================================
   主布局
   ============================================ */
.app { display: none; height: 100vh; }
.app.active { display: flex; }

/* ---------- 侧边栏 ---------- */
.sidebar {
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: width 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 20;
}
.sidebar-brand {
    height: var(--header-h);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}
.sidebar-brand-icon {
    width: 34px; height: 34px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 800; font-size: 17px;
    flex-shrink: 0;
}
.sidebar-brand-name { color: #fff; font-size: 16px; font-weight: 700; letter-spacing: 0.5px; white-space: nowrap; }
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 14px 12px;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); }
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 14px;
    margin-bottom: 4px;
    border-radius: var(--radius-sm);
    color: var(--text-sidebar);
    cursor: pointer;
    transition: all 0.18s;
    position: relative;
    font-size: 14px;
    white-space: nowrap;
}

.nav-item:not(.nav-parent) {
    height: 44px;
}

.nav-parent {
    cursor: pointer;
    flex-direction: column;
    align-items: stretch;
    height: auto;
    padding: 0;
}

.nav-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 14px;
    height: 44px;
}

.nav-row .nav-icon {
    width: 20px;
    text-align: center;
    font-size: 17px;
    flex-shrink: 0;
    font-style: normal;
    line-height: 1;
}

.nav-icon svg,
.nav-arrow svg {
    width: 20px;
    height: 20px;
    display: block;
    stroke: currentColor;
}

.nav-arrow {
    margin-left: auto;
    font-size: 10px;
    transition: transform 0.2s;
    color: rgba(255,255,255,0.5);
    display: flex;
    align-items: center;
}

.nav-arrow svg {
    width: 14px;
    height: 14px;
}
.nav-parent.open .nav-arrow {
    transform: rotate(90deg);
}
.sub-menu {
    display: none;
    padding-left: 32px;
    overflow: hidden;
}
.nav-parent.open .sub-menu {
    display: block;
}
.sub-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: rgba(255,255,255,0.8);
    cursor: pointer;
    transition: all 0.15s;
    margin-bottom: 2px;
}
.sub-item:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}
.sub-item.active {
    background: rgba(255,107,53,0.15);
    color: var(--text-sidebar-active);
}
.sub-item.active .nav-icon {
    color: var(--primary-light);
}

.sidebar-footer {
    padding: 14px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

/* ---------- 主区域 ---------- */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}
.header {
    height: var(--header-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    flex-shrink: 0;
}
.menu-toggle-btn {
    display: none;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 18px;
    color: var(--text-2);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    flex-shrink: 0;
}

.menu-toggle-btn svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
}
.menu-toggle-btn:hover {
    background: var(--bg-2);
    color: var(--text);
}
.header-title { font-size: 17px; font-weight: 700; color: var(--text); flex: 1; }
.header-right { display: flex; align-items: center; gap: 16px; }
.header-store-status {
    display: flex; align-items: center; gap: 6px;
    font-size: 13px; color: var(--text-2);
    padding: 5px 12px;
    background: var(--success-soft);
    border-radius: 20px;
    color: var(--success);
    font-weight: 600;
}
.header-store-status.closed { background: var(--danger-soft); color: var(--danger); }
.header-store-status .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.user-chip-wrap {
    position: relative;
}
.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 8px 5px 5px;
    border-radius: 24px;
    cursor: pointer;
    transition: background 0.15s;
}
.user-chip:hover { background: var(--surface-2); }
.user-chip .nav-arrow {
    margin-left: 0;
    color: var(--text-3);
    transition: transform 0.2s;
}
.user-chip-wrap.open .nav-arrow {
    transform: rotate(180deg);
}
.user-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 14px;
    flex-shrink: 0;
}
.user-name { font-size: 13px; font-weight: 600; color: var(--text); }
.user-role { font-size: 11px; color: var(--text-3); }

/* 用户下拉菜单 */
.user-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 240px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s;
    z-index: 1000;
}
.user-chip-wrap.open .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.user-dropdown-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--surface-2);
}
.user-dropdown-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}
.user-dropdown-role {
    font-size: 12px;
    color: var(--text-3);
    margin-top: 2px;
}
.user-dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 0;
}
.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    font-size: 13px;
    color: var(--text-2);
    cursor: pointer;
    transition: all 0.15s;
}
.user-dropdown-item:hover {
    background: var(--surface-2);
    color: var(--text);
}
.user-dropdown-item.danger {
    color: var(--danger);
}
.user-dropdown-item.danger:hover {
    background: var(--danger-soft);
}
.dropdown-item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    flex-shrink: 0;
    color: var(--text-3);
}
.user-dropdown-item.danger .dropdown-item-icon {
    color: var(--danger);
}
.dropdown-item-icon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}
.logout-btn {
    color: var(--text-3);
    font-size: 16px;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    cursor: pointer;
}

.logout-btn svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

.logout-btn:hover { background: var(--danger-soft); color: var(--danger); }

.content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}
.page { display: none; animation: pageIn 0.3s ease; }
.page.active { display: block; }
@keyframes pageIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   通用组件
   ============================================ */

/* 卡片 */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-2);
}
.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-2);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-title { font-size: 15px; font-weight: 700; color: var(--text); }
.card-body { padding: 20px; }

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 36px;
    padding: 0 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    transition: all 0.15s;
    white-space: nowrap;
    border: 1px solid transparent;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-default { background: var(--surface); color: var(--text-2); border-color: var(--border); }
.btn-default:hover:not(:disabled) { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); }
.btn-secondary { background: var(--surface); color: var(--text-2); border-color: var(--border); }
.btn-secondary:hover:not(:disabled) { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover:not(:disabled) { background: #0EA371; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #DC2C2C; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover:not(:disabled) { background: #D98309; }
.btn-sm { height: 30px; padding: 0 12px; font-size: 12px; }
.btn-text {
    height: auto; padding: 4px 8px;
    font-size: 13px; font-weight: 500;
    color: var(--primary);
}
.btn-text:hover { background: var(--primary-soft); }
.btn-text.danger { color: var(--danger); }
.btn-text.danger:hover { background: var(--danger-soft); }
.btn-text.success { color: var(--success); }
.btn-text.success:hover { background: var(--success-soft); }
.btn-text.warning { color: var(--warning); }
.btn-text.warning:hover { background: var(--warning-soft); }
.btn-icon { 
    width: 32px; 
    height: 32px; 
    padding: 0; 
    border-radius: 8px; 
    color: var(--text-3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

.btn-icon:hover { background: var(--surface-2); color: var(--primary); }

/* 表单 */
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: 7px;
}
.form-group label .req,
.form-label .req { color: var(--danger); margin-left: 2px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 7px; }
.form-control {
    width: 100%;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    transition: all 0.15s;
    font-size: 14px;
}
.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
    outline: none;
}
.form-control.readonly {
    background: var(--surface-2);
    color: var(--text-2);
    cursor: not-allowed;
    line-height: 38px;
    height: 38px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.form-control::placeholder { color: var(--text-3); }
.form-input, .form-select, .form-textarea {
    width: 100%;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    transition: all 0.15s;
}
.form-textarea { height: auto; padding: 10px 12px; resize: vertical; min-height: 80px; line-height: 1.6; }
.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-3); }
.form-row { display: flex; gap: 16px; }
.form-row .form-group { flex: 1; }
.form-hint { font-size: 12px; color: var(--text-3); margin-top: 5px; }
.w-50 { width: 50%; }

/* 输入框带按钮 */
.input-with-btn { display: flex; gap: 8px; align-items: center; }
.input-with-btn .form-control { flex: 1; }
.input-with-btn .btn-sm { flex-shrink: 0; white-space: nowrap; }

/* 输入框组 */
.input-group { display: flex; align-items: stretch; }
.input-group .form-control { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.input-prepend {
    display: flex;
    align-items: center;
    padding: 0 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-right: none;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    color: var(--text-2);
    font-size: 13px;
    white-space: nowrap;
}

/* 表格 */
.table-wrap { overflow-x: auto; }
table.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
table.table th {
    text-align: left;
    padding: 12px 16px;
    background: var(--surface-2);
    color: var(--text-3);
    font-weight: 600;
    font-size: 12px;
    border-bottom: 1px solid var(--border-2);
    white-space: nowrap;
}
table.table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-2);
    color: var(--text-2);
    vertical-align: middle;
}
table.table tbody tr { transition: background 0.12s; }
table.table tbody tr:hover { background: var(--surface-2); }
table.table tbody tr:last-child td { border-bottom: none; }
.table-cell-strong { color: var(--text); font-weight: 600; }
.table-cell-mono { font-family: "SFMono-Regular", Consolas, monospace; font-size: 12.5px; }
.table-cell-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.table-thumb {
    width: 44px; height: 44px;
    border-radius: 8px;
    object-fit: cover;
    background: var(--border-2);
}
.table-thumb-lg { width: 56px; height: 56px; }

/* 搜索高亮 */
mark {
    background: #FFF3CD;
    color: #856404;
    padding: 1px 3px;
    border-radius: 3px;
    font-weight: 600;
}

/* 状态标签 */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.6;
}
.tag-success { background: var(--success-soft); color: var(--success); }
.tag-warning { background: var(--warning-soft); color: var(--warning); }
.tag-danger { background: var(--danger-soft); color: var(--danger); }
.tag-info { background: var(--info-soft); color: var(--info); }
.tag-default { background: #F3F4F6; color: var(--text-2); }
.tag-primary { background: var(--primary-soft); color: var(--primary); }
.tag .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

/* 搜索栏 */
.toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.toolbar .search-input {
    height: 38px;
    width: 240px;
    padding: 0 12px 0 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface) 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='%239CA3AF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E") no-repeat 12px center;
    transition: all 0.15s;
}
.toolbar .search-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.toolbar .toolbar-right { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.toolbar .filter-select {
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text-2);
    cursor: pointer;
}

/* 分页 */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-top: 1px solid var(--border-2);
}
.pagination-info { font-size: 13px; color: var(--text-3); }
.pagination-controls { display: flex; align-items: center; gap: 6px; }
.page-btn {
    min-width: 32px; height: 32px;
    padding: 0 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text-2);
    font-size: 13px;
    transition: all 0.15s;
}
.page-btn:hover:not(:disabled):not(.active) { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.page-size-select {
    height: 32px;
    padding: 0 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    font-size: 13px;
    color: var(--text-2);
}

/* 空状态 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-3);
}
.empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-state .empty-icon svg {
    width: 64px;
    height: 64px;
    stroke: currentColor;
}
.empty-state .empty-text { font-size: 14px; }

/* 加载状态 */
.loading-state {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-3);
    gap: 10px;
    font-size: 13px;
}
.spinner {
    width: 20px; height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================
   仪表盘
   ============================================ */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 22px;
}
.stat-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-2);
    position: relative;
    overflow: hidden;
    transition: all 0.2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-card::after {
    content: '';
    position: absolute;
    right: -20px; top: -20px;
    width: 90px; height: 90px;
    border-radius: 50%;
    opacity: 0.08;
}
.stat-card.sc-orders::after { background: var(--primary); }
.stat-card.sc-sales::after { background: var(--success); }
.stat-card.sc-deals::after { background: var(--info); }
.stat-card.sc-users::after { background: var(--warning); }
.stat-icon {
    width: 42px; height: 42px;
    border-radius: 11px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; font-style: normal;
    margin-bottom: 14px;
}

.stat-icon svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
}
.sc-orders .stat-icon { background: var(--primary-soft); color: var(--primary); }
.sc-sales .stat-icon { background: var(--success-soft); color: var(--success); }
.sc-deals .stat-icon { background: var(--info-soft); color: var(--info); }
.sc-users .stat-icon { background: var(--warning-soft); color: var(--warning); }
.stat-label { font-size: 13px; color: var(--text-3); margin-bottom: 6px; }
.stat-value { font-size: 26px; font-weight: 700; color: var(--text); letter-spacing: -0.5px; }
.stat-value .unit { font-size: 14px; font-weight: 500; color: var(--text-3); margin-left: 2px; }

.dash-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 18px;
}
.dash-section-title {
    font-size: 15px; font-weight: 700; color: var(--text);
    display: flex; align-items: center; gap: 8px;
}
.dash-section-title .bar { width: 4px; height: 16px; background: var(--primary); border-radius: 2px; }

.hot-deal-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-2);
}
.hot-deal-item:last-child { border-bottom: none; }
.hot-deal-rank {
    width: 24px; height: 24px;
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700;
    background: var(--surface-2);
    color: var(--text-3);
    flex-shrink: 0;
}
.hot-deal-rank.r1 { background: var(--primary); color: #fff; }
.hot-deal-rank.r2 { background: #FFB347; color: #fff; }
.hot-deal-rank.r3 { background: #FFCB7C; color: #fff; }
.hot-deal-info { flex: 1; min-width: 0; }
.hot-deal-name { font-size: 13px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hot-deal-sold { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.hot-deal-img { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }

.recent-order-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid var(--border-2);
}
.recent-order-row:last-child { border-bottom: none; }
.recent-order-no { font-family: monospace; font-size: 12.5px; color: var(--text-2); width: 150px; }
.recent-order-deal { flex: 1; font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-order-amount { font-size: 13px; font-weight: 600; color: var(--text); width: 90px; text-align: right; }
.recent-order-time { font-size: 12px; color: var(--text-3); width: 120px; text-align: right; }

/* ============================================
   商品/评价图片
   ============================================ */
.review-imgs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.review-img { width: 60px; height: 60px; border-radius: 6px; object-fit: cover; cursor: pointer; transition: transform 0.15s; }
.review-img:hover { transform: scale(1.05); }
.review-stars { color: var(--warning); font-size: 13px; letter-spacing: 1px; }
.review-content { font-size: 13px; color: var(--text); line-height: 1.6; margin-top: 4px; word-break: break-all; }
.review-reply-box {
    margin-top: 8px;
    padding: 10px 12px;
    background: var(--primary-soft);
    border-radius: 8px;
    border-left: 3px solid var(--primary);
    font-size: 12.5px;
    color: var(--text-2);
}
.review-reply-box .label { color: var(--primary); font-weight: 600; }

/* 相册网格 */
.album-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}
.album-item {
    position: relative;
    width: 100%;
    height: 120px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--border-2);
}
.album-item img { width: 100%; height: 100%; object-fit: cover; }
.album-item .album-del {
    position: absolute;
    top: 6px; right: 6px;
    width: 26px; height: 26px;
    border-radius: 50%;
    background: rgba(0,0,0,0.55);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.15s;
}
.album-item:hover .album-del { opacity: 1; }

/* ============================================
   弹窗 Modal
   ============================================ */
.modal-mask {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.5);
    backdrop-filter: blur(2px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    animation: maskIn 0.2s ease;
}
.modal-mask.active { display: flex; }
@keyframes maskIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 520px;
    max-width: 92vw;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    animation: modalIn 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalIn {
    from { opacity: 0; transform: translateY(20px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal.modal-lg { width: 720px; }
.modal.modal-sm { width: 400px; }
.modal-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.modal-title { font-size: 16px; font-weight: 700; color: var(--text); }
.modal-close { font-size: 20px; color: var(--text-3); width: 30px; height: 30px; border-radius: 8px; transition: all 0.15s; }
.modal-close:hover { background: var(--surface-2); color: var(--text); }
.modal-body { padding: 24px; overflow-y: auto; flex: 1; }
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-2);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-shrink: 0;
}

/* 确认弹窗 */
.confirm-modal .modal { width: 400px; }
.confirm-modal .modal-body { text-align: center; padding: 32px 24px 24px; }
.confirm-icon {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: var(--warning-soft);
    color: var(--warning);
    display: flex; align-items: center; justify-content: center;
    font-size: 26px;
    margin: 0 auto 16px;
}

.confirm-icon svg {
    width: 32px;
    height: 32px;
    stroke: currentColor;
}
.confirm-icon.danger { background: var(--danger-soft); color: var(--danger); }
.confirm-title { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.confirm-text { font-size: 14px; color: var(--text-2); line-height: 1.6; }

/* 图片预览 */
.image-viewer {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.88);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
    cursor: zoom-out;
    animation: maskIn 0.2s ease;
}
.image-viewer.active { display: flex; }
.image-viewer img { max-width: 90vw; max-height: 90vh; border-radius: 8px; }

/* ============================================
   Toast 提示
   ============================================ */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    pointer-events: none;
}
.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 20px;
    border-radius: 10px;
    background: var(--text);
    color: #fff;
    font-size: 14px;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    max-width: 90vw;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); }
.toast.info { background: var(--info); }
.toast .toast-icon { 
    font-size: 16px; 
    font-style: normal;
    display: flex;
    align-items: center;
}

.toast .toast-icon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}
@keyframes toastIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}
.toast.out { animation: toastOut 0.25s ease forwards; }
@keyframes toastOut {
    to { opacity: 0; transform: translateY(-16px); }
}

/* ============================================
   开关 Switch
   ============================================ */
.switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 22px;
    cursor: pointer;
    vertical-align: middle;
}
.switch input { display: none; }
.switch-slider {
    position: absolute;
    inset: 0;
    background: #D1D5DB;
    border-radius: 22px;
    transition: 0.25s;
}
.switch-slider::before {
    content: '';
    position: absolute;
    width: 18px; height: 18px;
    left: 2px; top: 2px;
    background: #fff;
    border-radius: 50%;
    transition: 0.25s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.switch input:checked + .switch-slider { background: var(--success); }
.switch input:checked + .switch-slider::before { transform: translateX(20px); }

/* ============================================
   评分星星
   ============================================ */
.star-rating { display: inline-flex; gap: 2px; }
.star-rating .star { color: #D1D5DB; font-size: 16px; cursor: pointer; }
.star-rating .star.active { color: var(--warning); }

/* ============================================
   详情展示
   ============================================ */
.detail-grid {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 14px 18px;
    font-size: 13px;
}
.detail-label { color: var(--text-3); text-align: right; }
.detail-value { color: var(--text); word-break: break-all; }

/* 门店信息表单特殊 */
.store-form { max-width: 680px; }

/* 工具类 */
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--text-3); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.mt-0 { margin-top: 0; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-0 { margin-bottom: 0; }
.mb-16 { margin-bottom: 16px; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.max-w-140 { max-width: 140px; }
.max-w-200 { max-width: 200px; }
.max-w-300 { max-width: 300px; }
.text-xs { font-size: 12px; }
.justify-end { justify-content: flex-end; }

/* 通用列表行样式（用于弹窗内子列表） */
.table-row {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-2);
    background: var(--surface);
    transition: background 0.12s;
}
.table-row:hover {
    background: var(--surface-2);
}
.table-row:last-child {
    border-bottom: none;
}
.table-col {
    flex: 1;
    padding: 0 8px;
    word-break: break-word;
    font-size: 13px;
    color: var(--text-2);
}
.table-col:first-child {
    padding-left: 0;
}
.table-col:last-child {
    padding-right: 0;
}
.table-col.text-right {
    text-align: right;
}

/* ============================================
   用户管理弹窗样式
   ============================================ */

/* 用户小头像 */
.user-avatar-sm {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--text-2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}
.user-avatar-sm img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

/* 用户详情大头像 */
.avatar-lg {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--text-2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 600;
    flex-shrink: 0;
}
.avatar-lg img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

/* 用户详情头部 */
.user-detail-body { padding: 0; }
.user-detail-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 0 20px 0;
    border-bottom: 1px solid var(--border-2);
    margin-bottom: 20px;
}
.user-detail-info h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

/* 表单分区 */
.form-section {
    margin-bottom: 24px;
}
.form-section:last-child {
    margin-bottom: 0;
}
.section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-2);
}

/* 统计信息行 */
.stat-row {
    display: flex;
    gap: 24px;
}
.stat-item {
    flex: 1;
    text-align: center;
    padding: 16px;
    background: var(--surface-2);
    border-radius: var(--radius-sm);
}
.stat-num {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}
.stat-label {
    font-size: 12px;
    color: var(--text-3);
}

/* 标签页样式 */
.tabs-wrap {
    display: flex;
    border-bottom: 2px solid var(--border);
    margin-bottom: 20px;
}
.tab-item {
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-2);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
    background: none;
    border: none;
}
.tab-item:hover {
    color: var(--primary);
}
.tab-item.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}
.tab-content {
    display: none;
}
.tab-content.active {
    display: block;
}

/* 卡片底部 */
.card-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    background: var(--surface-2);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* 工具条右侧 */
.toolbar-right {
    margin-left: auto;
}

/* 用户头像上传 */
.user-avatar-uploader {
    display: flex;
    align-items: center;
    gap: 16px;
}
.user-avatar-preview {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--surface-2);
    border: 2px dashed var(--border);
    cursor: pointer;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    position: relative;
}
.user-avatar-preview:hover {
    border-color: var(--primary);
    background: var(--primary-soft);
}
.user-avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.user-avatar-placeholder {
    color: var(--text-3);
    font-size: 12px;
    text-align: center;
}

/* 会员等级颜色徽章 */
.level-color-badge {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    vertical-align: middle;
    margin-right: 6px;
    border: 1px solid rgba(0,0,0,0.08);
}

/* ============================================
   图片上传字段
   ============================================ */
.image-field {
    margin-bottom: 16px;
}
.image-field-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.image-preview {
    width: 120px;
    height: 120px;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-2);
    flex-shrink: 0;
}
.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.image-placeholder {
    color: var(--text-3);
    font-size: 13px;
    text-align: center;
    padding: 10px;
}
.image-upload-btn {
    flex-shrink: 0;
    margin-top: 0;
}

/* ============================================
   标签输入
   ============================================ */
.tag-input-wrapper {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px;
    background: var(--surface);
}
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
    min-height: 0;
}
.tag-list:empty {
    margin-bottom: 0;
}
.tag-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--primary-soft);
    color: var(--primary);
    border-radius: 16px;
    font-size: 13px;
    font-weight: 500;
}
.tag-remove {
    cursor: pointer;
    font-size: 14px;
    opacity: 0.6;
    transition: opacity 0.15s;
}
.tag-remove:hover {
    opacity: 1;
}
.tag-add-row {
    display: flex;
    gap: 8px;
}
.tag-add-input {
    flex: 1;
    height: 34px;
}

/* ============================================
   相册上传区域
   ============================================ */
.album-upload-area {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 10px;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    min-height: 100px;
}
.album-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.album-preview-item {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
}
.album-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.album-preview-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s;
}
.album-preview-item:hover .album-preview-remove {
    opacity: 1;
}
.album-add-btn {
    width: 100px;
    height: 100px;
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
}
.album-add-btn:hover {
    border-color: var(--primary);
    background: var(--primary-soft);
}
.album-add-icon {
    font-size: 24px;
    color: var(--text-3);
    margin-bottom: 4px;
}
.album-add-btn:hover .album-add-icon {
    color: var(--primary);
}
.album-add-text {
    font-size: 12px;
    color: var(--text-3);
}
.album-add-btn:hover .album-add-text {
    color: var(--primary);
}
.album-tip {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-3);
}

.hidden {
    display: none !important;
}

/* 预约表单 - 列表项 */
.booking-list-item {
    background: var(--surface-2);
    border: 1px solid var(--border-2);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    overflow: hidden;
}
.booking-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--surface);
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}
.booking-list-header:hover {
    background: var(--primary-soft);
}
.booking-list-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-1);
}
.booking-list-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}
.booking-list-arrow {
    font-size: 10px;
    color: var(--text-3);
    transition: transform 0.2s;
}
.booking-list-item.collapsed .booking-list-arrow {
    transform: rotate(-90deg);
}
.booking-list-item.collapsed .booking-list-header {
    border-bottom: none;
}
.booking-list-body {
    padding: 16px;
    border-top: 1px solid var(--border-2);
}
.booking-list-item.collapsed .booking-list-body {
    display: none;
}

/* 预约表单 - 上传区域 */
.booking-list-upload {
    width: 100%;
    max-width: 400px;
    height: 200px;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.2s, background 0.2s;
}
.booking-list-upload:hover {
    border-color: var(--primary);
    background: var(--primary-soft);
}
.booking-list-upload img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.booking-list-upload span {
    font-size: 14px;
    color: var(--text-3);
    display: flex;
    align-items: center;
    gap: 8px;
}

.booking-list-upload-sm {
    width: 120px;
    height: 120px;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.2s, background 0.2s;
}
.booking-list-upload-sm:hover {
    border-color: var(--primary);
    background: var(--primary-soft);
}
.booking-list-upload-sm img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.booking-list-upload-sm span {
    font-size: 12px;
    color: var(--text-3);
}

/* 预约表单 - 复选框 */
.booking-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-2);
    cursor: pointer;
    padding: 8px 0;
}
.booking-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

.booking-detail-divider {
    font-size: 13px;
    font-weight: 600;
    color: #999;
    margin: 20px 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px dashed #eee;
}

/* 辅助类 */
.w-25 {
    width: 25%;
}
.mt-16 {
    margin-top: 16px;
}

/* 响应式 */
@media (max-width: 1200px) {
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .dash-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .sidebar { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%); z-index: 100; }
    .sidebar.open { transform: translateX(0); }
    .menu-toggle-btn { display: flex; }
    .content { padding: 16px; }
    .stat-grid { grid-template-columns: 1fr; }
    .toolbar .search-input { width: 100%; }
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(0,0,0,0.4);
        z-index: 99;
    }
    .sidebar-overlay.show { display: block; }
}

/* ---------- 地图选点弹窗 ---------- */
.map-picker-mask {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.map-picker-mask.active {
    opacity: 1;
}

.map-picker-modal {
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    background: #FFFFFF;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.map-picker-modal .modal-body {
    overflow-y: auto;
}

.map-picker-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.map-search-bar {
    display: flex;
    gap: 8px;
}

.map-search-bar .form-input {
    height: 38px;
}

.map-picker-map {
    width: 100%;
    height: 400px;
    border-radius: 8px;
    border: 1px solid var(--border);
    overflow: hidden;
    background: var(--bg);
}

.map-picker-info {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 10px 16px;
    background: var(--surface-2);
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-2);
}

.map-picker-info strong {
    color: var(--primary);
    font-weight: 600;
    font-family: monospace;
}

.map-picker-toast-container {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    pointer-events: none;
}

.map-search-results {
    max-height: 150px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #FFFFFF;
}

.map-search-results-title {
    padding: 8px 12px;
    font-size: 12px;
    color: var(--text-2);
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
}

.map-search-result-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-light);
    transition: background 0.2s;
}

.map-search-result-item:last-child {
    border-bottom: none;
}

.map-search-result-item:hover {
    background: var(--surface-1);
}

.map-search-result-title {
    font-size: 14px;
    color: var(--text);
    font-weight: 500;
    margin-bottom: 2px;
}

.map-search-result-address {
    font-size: 12px;
    color: var(--text-2);
}

.map-picker-group {
    margin-bottom: 24px;
}

.map-picker-group .btn svg {
    width: 14px;
    height: 14px;
    margin-right: 4px;
    vertical-align: middle;
}

/* ============================================
   新增：系统应用页面
   ============================================ */
.page-header {
    margin-bottom: 20px;
}
.page-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}
.page-subtitle {
    font-size: 13px;
    color: var(--text-3);
}

.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
}
.apps-section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 24px 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
}
.app-card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border-2);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
}
.app-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--primary-soft);
}
.app-card.expired {
    border-color: var(--danger-soft);
    background: linear-gradient(135deg, #fff 0%, #FEF2F2 100%);
}
.app-card.soon {
    border-color: var(--warning-soft);
    background: linear-gradient(135deg, #fff 0%, #FFFBEB 100%);
}
.app-card.display-only {
    border-color: var(--warning-soft);
    border-style: dashed;
    background: linear-gradient(135deg, #fff 0%, #FFFBEB 100%);
}
.app-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}
.app-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}
.app-icon svg {
    width: 28px;
    height: 28px;
    color: #fff;
}
.app-icon-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.app-icon-letter {
    color: #fff;
    font-size: 22px;
    font-weight: 700;
}
.app-info {
    flex: 1;
    min-width: 0;
}
.app-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}
.app-desc {
    font-size: 12.5px;
    color: var(--text-3);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.app-card-status {
    margin-bottom: 14px;
    min-height: 24px;
}
.app-card-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
}
.app-card-actions .btn {
    flex: 1;
}

/* ============================================
   新增：续费弹窗 & 账户续费页面
   ============================================ */
.renew-plan-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    padding: 4px;
}
.renew-tab {
    flex: 1;
    text-align: center;
    padding: 10px 0;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-2);
    cursor: pointer;
    transition: all 0.15s;
}
.renew-tab:hover {
    color: var(--text);
}
.renew-tab.active {
    background: var(--surface);
    color: var(--primary);
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.renew-tab-tag {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    font-size: 11px;
    font-weight: 500;
    border-radius: 10px;
    background: var(--success-soft);
    color: var(--success);
    vertical-align: middle;
}
.renew-price-box {
    text-align: center;
    padding: 24px 0;
}
.renew-price-info {
    display: inline-block;
    text-align: center;
}
.renew-price-label {
    font-size: 13px;
    color: var(--text-3);
    margin-bottom: 8px;
}
.renew-price-amount {
    font-size: 36px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}
.renew-price-amount span {
    font-size: 36px;
}
.renew-discount {
    display: inline-block;
    margin-top: 10px;
    padding: 3px 10px;
    background: var(--danger-soft);
    color: var(--danger);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.renew-note {
    text-align: center;
    font-size: 12px;
    color: var(--text-3);
    margin-top: 12px;
}

/* 账户续费信息卡片 */
.renew-info-card {
    margin-bottom: 18px;
}
.renew-info-card-inner {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border-2);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.renew-info-card-inner.normal {
    background: linear-gradient(135deg, #fff 0%, #ECFDF5 100%);
    border-color: var(--success-soft);
}
.renew-info-card-inner.soon {
    background: linear-gradient(135deg, #fff 0%, #FFFBEB 100%);
    border-color: var(--warning-soft);
}
.renew-info-card-inner.expired {
    background: linear-gradient(135deg, #fff 0%, #FEF2F2 100%);
    border-color: var(--danger-soft);
}
.renew-info-main {
    flex: 1;
}
.renew-info-label {
    font-size: 13px;
    color: var(--text-3);
    margin-bottom: 6px;
}
.renew-info-date {
    font-size: 16px;
    color: var(--text);
    font-weight: 500;
    margin-bottom: 6px;
}
.renew-info-days {
    font-size: 13px;
    color: var(--text-2);
}
.renew-info-days strong {
    color: var(--primary);
    font-size: 18px;
    font-weight: 700;
    margin: 0 2px;
}
.renew-info-merchant {
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px dashed var(--border-2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}
.renew-info-merchant .merchant-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}
.merchant-id {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    background: rgba(0,0,0,0.03);
    border-radius: 6px;
    font-size: 12.5px;
}
.merchant-id-label {
    color: var(--text-3);
}
.merchant-id-value {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: var(--primary);
    letter-spacing: 0.5px;
}
.merchant-id-copy {
    border: none;
    background: transparent;
    padding: 2px 8px;
    font-size: 12px;
    color: var(--text-3);
    cursor: pointer;
    border-radius: 4px;
}
.merchant-id-copy:hover {
    background: var(--primary-soft);
    color: var(--primary);
}
.renew-info-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

/* 续费套餐卡片 */
.renew-plans {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}
.renew-plan-card {
    background: var(--surface);
    border: 2px solid var(--border-2);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}
.renew-plan-card:hover {
    border-color: var(--primary-soft);
    transform: translateY(-2px);
}
.renew-plan-card.selected {
    border-color: var(--primary);
    background: var(--primary-soft);
}
.renew-plan-card.selected::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 28px 28px 0;
    border-color: transparent var(--primary) transparent transparent;
}
.plan-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 10px;
}
.plan-tags-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    margin-bottom: 8px;
    min-height: 20px;
}
.plan-tags-row:empty {
    display: none;
}
.plan-marketing-tag {
    display: inline-block;
    padding: 2px 8px;
    background: linear-gradient(135deg, #FF6B6B, #FF8E53);
    color: #fff;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
}
.plan-recommend-tag {
    display: inline-block;
    padding: 2px 8px;
    background: var(--warning, #F59E0B);
    color: #fff;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
}
.plan-type-tag {
    display: inline-block;
    padding: 2px 8px;
    background: var(--success-soft, #D1FAE5);
    color: var(--success, #10B981);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
}
.plan-price {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 8px;
}
.plan-price span {
    font-size: 28px;
}
.plan-discount {
    display: inline-block;
    padding: 2px 8px;
    background: var(--danger-soft);
    color: var(--danger);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}
.plan-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* 门店数量信息 */
.store-count-info {
    margin-left: auto;
    margin-right: 12px;
}
.store-count-text {
    font-size: 13px;
    color: var(--text-2);
}
.store-count-text strong {
    color: var(--primary);
    font-weight: 600;
}
.btn-disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 自定义购买 */
.store-custom-wrap {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px dashed var(--border-2);
}
.store-custom-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 14px;
}
.store-custom-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.store-custom-input-wrap {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-2);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.store-qty-btn {
    width: 36px;
    height: 38px;
    border: none;
    background: var(--surface-2);
    color: var(--text);
    font-size: 18px;
    cursor: pointer;
    transition: background 0.2s;
}
.store-qty-btn:hover {
    background: var(--border-2);
}
.store-qty-input {
    width: 70px;
    height: 38px;
    border: none;
    border-left: 1px solid var(--border-2);
    border-right: 1px solid var(--border-2);
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    outline: none;
}
.store-qty-input::-webkit-outer-spin-button,
.store-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.store-custom-unit {
    font-size: 14px;
    color: var(--text-2);
}
.store-custom-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    margin-left: auto;
}

.renew-preview {
    text-align: center;
    margin-bottom: 20px;
    padding: 14px;
    background: var(--surface-2);
    border-radius: var(--radius-sm);
}
.renew-preview-text {
    font-size: 13px;
    color: var(--text-2);
}
.renew-preview-text strong {
    color: var(--primary);
    font-weight: 600;
}
.renew-pay-btn-wrap {
    text-align: center;
}
.renew-pay-btn-wrap .btn-lg {
    min-width: 200px;
    height: 44px;
    font-size: 15px;
}
.btn-lg {
    height: 44px;
    padding: 0 24px;
    font-size: 15px;
    border-radius: var(--radius-sm);
}

/* ============================================
   新增：支付配置页面
   ============================================ */
.pay-config-form {
    max-width: 680px;
}
.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-2);
}

/* ============================================
   新增：仪表盘到期提醒
   ============================================ */
.expiry-warn-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-2);
}
.expiry-warn-card.soon {
    background: linear-gradient(135deg, #FFFBEB 0%, #fff 100%);
    border-color: var(--warning-soft);
}
.expiry-warn-card.expired {
    background: linear-gradient(135deg, #FEF2F2 0%, #fff 100%);
    border-color: var(--danger-soft);
}
.expiry-warn-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 20px;
}
.expiry-warn-card.soon .expiry-warn-icon {
    background: var(--warning-soft);
    color: var(--warning);
}
.expiry-warn-card.expired .expiry-warn-icon {
    background: var(--danger-soft);
    color: var(--danger);
}
.expiry-warn-icon svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
}
.expiry-warn-content {
    flex: 1;
    min-width: 0;
}
.expiry-warn-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}
.expiry-warn-card.soon .expiry-warn-title {
    color: var(--warning);
}
.expiry-warn-card.expired .expiry-warn-title {
    color: var(--danger);
}
.expiry-warn-desc {
    font-size: 12.5px;
    color: var(--text-2);
}

/* 响应式 */
@media (max-width: 768px) {
    .renew-plans {
        grid-template-columns: 1fr;
    }
    .apps-grid {
        grid-template-columns: 1fr;
    }
    .renew-info-card-inner {
        flex-direction: column;
        text-align: center;
    }
    .renew-info-side {
        align-items: center;
    }
}

/* ============================================
   仪表盘：系统更新检查卡片
   ============================================ */
.system-update-wrap {
    margin-bottom: 22px;
}
.system-update-card .card-header {
    padding: 14px 20px;
}
.system-update-card .card-body {
    padding: 4px 20px;
}
.system-update-row {
    display: grid;
    grid-template-columns: 150px 1fr auto;
    gap: 16px;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-2);
    border-radius: 6px;
    transition: background 0.15s;
}
.system-update-row:last-child {
    border-bottom: none;
}
.system-update-row.row-warning {
    background: linear-gradient(90deg, #FFFBEB 0%, transparent 60%);
}
.system-update-row.row-danger {
    background: linear-gradient(90deg, #FEF2F2 0%, transparent 60%);
}
.system-update-row.row-success {
    background: linear-gradient(90deg, #ECFDF5 0%, transparent 60%);
}
.system-update-type {
    display: flex;
    align-items: center;
    gap: 10px;
}
.system-update-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--primary-soft);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.system-update-icon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}
.system-update-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}
.system-update-version {
    display: flex;
    align-items: center;
    gap: 12px;
}
.ver-block {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    min-width: 60px;
}
.ver-label {
    font-size: 11px;
    color: var(--text-3);
    line-height: 1.2;
}
.ver-num {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    letter-spacing: -0.2px;
}
.ver-arrow {
    display: flex;
    align-items: center;
    color: var(--text-3);
    flex-shrink: 0;
}
.ver-arrow svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}
.system-update-status {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
}
.system-update-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border-2);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}
.system-update-footer .btn .btn-icon-inline,
.btn .btn-icon-inline {
    display: inline-flex;
    align-items: center;
    width: 14px;
    height: 14px;
    margin-right: 2px;
    vertical-align: middle;
}
.system-update-footer .btn .btn-icon-inline svg,
.btn .btn-icon-inline svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
}

/* 版本详情弹窗 */
.version-desc-box {
    background: var(--surface-2);
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 13px;
    color: var(--text-2);
    line-height: 1.7;
    max-height: 240px;
    overflow-y: auto;
    word-break: break-all;
}
.version-download-url {
    display: flex;
    align-items: center;
    gap: 8px;
}
.version-url-text {
    flex: 1;
    min-width: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
    color: var(--text-2);
    background: var(--surface-2);
    padding: 6px 10px;
    border-radius: 6px;
    word-break: break-all;
}

/* 响应式：系统更新卡片 */
@media (max-width: 768px) {
    .system-update-row {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 14px 0;
    }
    .system-update-status {
        justify-content: space-between;
    }
    .system-update-version {
        justify-content: flex-start;
    }
}

/* ========== 表格行操作下拉菜单 ========== */
.row-action-wrap {
    position: relative;
    display: inline-block;
}
.row-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--primary);
    background: var(--primary-soft);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.row-action-btn:hover {
    background: #FFE6D9;
    color: var(--primary-hover);
}
.row-action-btn .caret {
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid currentColor;
    transition: transform 0.2s;
}
.row-action-wrap.open .row-action-btn .caret {
    transform: rotate(180deg);
}
.row-action-dropdown {
    position: fixed;
    min-width: 180px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.18s, transform 0.18s;
    z-index: 9999;
}
.row-action-wrap.open .row-action-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.row-action-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    font-size: 13px;
    color: var(--text-2);
    cursor: pointer;
    transition: all 0.12s;
}
.row-action-item:hover {
    background: var(--surface-2);
    color: var(--text);
}
.row-action-item .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-3);
    flex-shrink: 0;
}
.row-action-item.primary { color: var(--primary); }
.row-action-item.primary .dot { background: var(--primary); }
.row-action-item.success { color: var(--success); }
.row-action-item.success .dot { background: var(--success); }
.row-action-item.warning { color: var(--warning); }
.row-action-item.warning .dot { background: var(--warning); }
.row-action-item.danger { color: var(--danger); }
.row-action-item.danger .dot { background: var(--danger); }
.row-action-item.info { color: var(--info); }
.row-action-item.info .dot { background: var(--info); }
.row-action-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}
