/* ========== 全局变量与基础样式 ========== */
:root {
    --primary: #0ea5a4;
    --primary-dark: #0d9488;
    --primary-light: #14b8a6;
    --primary-bg: #f0fdfa;
    --secondary: #6366f1;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --text-primary: #1e293b;
    --text-main: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --card-bg: #ffffff;
    --bg: #f8fafc;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --radius: 10px;
    --radius-lg: 16px;
    --sidebar-width: 260px;
    --sidebar-collapsed: 70px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg-light);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ========== 登录页面 ========== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0ea5a4 0%, #6366f1 100%);
    padding: 20px;
}

.login-container {
    display: flex;
    width: 100%;
    max-width: 980px;
    min-height: 580px;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
}

.login-left {
    flex: 1.1;
    background: linear-gradient(135deg, #0f766e 0%, #4338ca 100%);
    color: white;
    padding: 50px 45px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.login-left::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 400px;
    height: 400px;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
}

.login-left::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -20%;
    width: 300px;
    height: 300px;
    background: rgba(255,255,255,0.06);
    border-radius: 50%;
}

.brand {
    position: relative;
    z-index: 1;
}

.brand-icon {
    width: 70px;
    height: 70px;
    background: rgba(255,255,255,0.15);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
}

.brand h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 6px;
}

.brand p {
    font-size: 15px;
    opacity: 0.85;
}

.login-features {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    background: rgba(255,255,255,0.1);
    padding: 12px 14px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.feature-item i {
    color: #5eead4;
    font-size: 16px;
}

.login-right {
    flex: 1;
    padding: 50px 45px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-form-wrapper {
    width: 100%;
    max-width: 340px;
}

.login-form-wrapper h2 {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.login-form-wrapper > p {
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 14px;
}

.form-group label i {
    color: var(--primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    transition: var(--transition);
    font-family: inherit;
    background: var(--bg-white);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(14,165,164,0.1);
}

.form-remember {
    margin-bottom: 20px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
}

.checkbox-label input {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

.btn-login {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(14,165,164,0.3);
}

.btn-login:active {
    transform: translateY(0);
}

.login-hint {
    margin-top: 20px;
    padding: 12px;
    background: var(--primary-bg);
    border-radius: 8px;
    text-align: center;
    font-size: 12px;
    color: var(--primary-dark);
}

/* ========== 主应用布局 ========== */
.app {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    overflow: hidden;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 700;
    color: white;
    white-space: nowrap;
    cursor: pointer;
}

.logo i {
    font-size: 24px;
    color: var(--primary-light);
}

.sidebar.collapsed .logo span {
    display: none;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: var(--transition);
}

.sidebar-toggle:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.sidebar.collapsed .sidebar-toggle {
    display: none;
}

.sidebar-nav {
    flex: 1;
    padding: 14px 10px;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-nav::-webkit-scrollbar {
    width: 5px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 3px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 11px 14px;
    margin-bottom: 4px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    color: #94a3b8;
    text-decoration: none;
    white-space: nowrap;
    position: relative;
}

.nav-item i {
    font-size: 17px;
    width: 22px;
    text-align: center;
}

.nav-item span {
    font-size: 14px;
}

.sidebar.collapsed .nav-item span {
    display: none;
}

.nav-item:hover {
    background: rgba(255,255,255,0.06);
    color: white;
}

.nav-item.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(14,165,164,0.35);
}

.nav-section-title {
    padding: 14px 14px 8px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #475569;
    font-weight: 600;
}

.sidebar.collapsed .nav-section-title {
    display: none;
}

.sidebar-footer {
    padding: 14px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    margin-bottom: 10px;
}

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 15px;
    flex-shrink: 0;
}

.user-details {
    overflow: hidden;
}

.user-name {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: white;
}

.user-role {
    display: block;
    font-size: 11px;
    color: #94a3b8;
}

.sidebar.collapsed .user-details {
    display: none;
}

.btn-logout,
.btn-password {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px;
    background: transparent;
    border: 1px solid rgba(239,68,68,0.3);
    color: #f87171;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    transition: var(--transition);
}

.btn-password {
    margin-bottom: 8px;
    border-color: rgba(255,255,255,0.2);
    color: #cbd5e1;
}

.btn-password:hover {
    background: rgba(255,255,255,0.08);
    border-color: #94a3b8;
    color: #fff;
}

.btn-logout:hover {
    background: rgba(239,68,68,0.15);
    border-color: var(--danger);
    color: #fca5a5;
}

.sidebar.collapsed .btn-logout span,
.sidebar.collapsed .btn-password span {
    display: none;
}

/* 主内容 */
.main-content {
    flex: 1;
    min-width: 0;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.sidebar.collapsed ~ .main-content {
    margin-left: var(--sidebar-collapsed);
}

/* 底部版权与备案 */
.main-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 4px 10px;
    padding: 12px 16px;
    font-size: 12px;
    line-height: 1.7;
    color: var(--text-muted);
    background: var(--bg-white);
    border-top: 1px solid var(--border);
}
.main-footer a {
    color: var(--text-muted);
    text-decoration: none;
}
.main-footer a:hover {
    color: var(--primary);
    text-decoration: underline;
}
.main-footer .footer-sep { color: var(--border); }

/* 登录页底部版权与备案 */
.login-page { position: relative; }
.login-footer {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 14px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 4px 10px;
    padding: 0 16px;
    font-size: 12px;
    line-height: 1.7;
    color: var(--text-muted);
    text-align: center;
}
.login-footer a { color: var(--text-muted); text-decoration: none; }
.login-footer a:hover { color: var(--primary); text-decoration: underline; }
.login-footer .footer-sep { color: var(--border); }

/* 登录页隐私政策与用户协议 */
.login-agreement {
    margin: 2px 0 14px;
    font-size: 12.5px;
    line-height: 1.7;
    color: var(--text-secondary);
}
.login-agreement .agree-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
}
.login-agreement input[type="checkbox"] {
    margin-top: 3px;
    flex: none;
}
.login-agreement a { color: var(--primary); text-decoration: none; }
.login-agreement a:hover { text-decoration: underline; }

/* 隐私政策/用户协议弹窗正文 */
.legal-content {
    max-height: 60vh;
    overflow-y: auto;
    line-height: 1.9;
    font-size: 13.5px;
    color: var(--text-secondary);
    padding-right: 6px;
}
.legal-content h3 {
    margin: 4px 0 10px;
    font-size: 16px;
    color: var(--text-primary);
}
.legal-content h4 {
    margin: 14px 0 6px;
    font-size: 14px;
    color: var(--text-primary);
}
.legal-content p { margin: 0 0 8px; }
.legal-content h2 { margin: 10px 0 8px; font-size: 18px; color: var(--text-primary); }
.legal-content ul, .legal-content ol { margin: 0 0 10px 20px; padding: 0; }
.legal-content li { margin: 0 0 4px; }
.legal-content blockquote { margin: 8px 0; padding: 8px 12px; border-left: 3px solid var(--border); background: rgba(0,0,0,.03); color: var(--text-muted); }
.legal-content strong { color: var(--text-primary); }
.legal-content code { background: rgba(0,0,0,.06); padding: 1px 4px; border-radius: 3px; font-size: 12px; }

/* 顶部栏 */
.topbar {
    background: var(--bg-white);
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-toggle {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    display: none;
}

.menu-toggle:hover {
    background: var(--bg-light);
}

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

.topbar-right {
    display: flex;
    align-items: center;
    gap: 18px;
    position: relative;
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--bg-light);
    padding: 8px 14px;
    border-radius: 8px;
    gap: 8px;
    width: 260px;
    border: 1px solid transparent;
    transition: var(--transition);
}

.search-box:focus-within {
    border-color: var(--primary);
    background: var(--bg-white);
}

.search-box i {
    color: var(--text-muted);
}

.search-box input {
    border: none;
    background: none;
    outline: none;
    flex: 1;
    font-size: 13px;
}

.topbar-icon-btn {
    position: relative;
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: var(--transition);
}

.topbar-icon-btn:hover {
    background: var(--bg-light);
    color: var(--primary);
}

.badge {
    position: absolute;
    top: 3px;
    right: 3px;
    background: var(--danger);
    color: white;
    font-size: 10px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.date-display {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* 内容区 */
.content-area {
    flex: 1;
    min-width: 0;
    padding: 28px;
    overflow-y: auto;
}

/* ========== 卡片 ========== */
.card {
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
    margin-bottom: 22px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

/* ========== 统计卡片 ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 18px;
    transition: var(--transition);
    border-left: 4px solid var(--primary);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.stat-card.success { border-left-color: var(--success); }
.stat-card.warning { border-left-color: var(--warning); }
.stat-card.danger { border-left-color: var(--danger); }
.stat-card.info { border-left-color: var(--info); }

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.stat-card .stat-icon { background: var(--primary-bg); color: var(--primary); }
.stat-card.success .stat-icon { background: #ecfdf5; color: var(--success); }
.stat-card.warning .stat-icon { background: #fffbeb; color: var(--warning); }
.stat-card.danger .stat-icon { background: #fef2f2; color: var(--danger); }
.stat-card.info .stat-icon { background: #eff6ff; color: var(--info); }

.stat-info {
    flex: 1;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-change {
    font-size: 12px;
    margin-top: 2px;
}

.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ========== 按钮 ========== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(14,165,164,0.35);
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

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

.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #059669; }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; }
.btn-warning { background: var(--warning); color: white; }
.btn-warning:hover { background: #d97706; }
.btn-info { background: var(--info); color: white; }
.btn-info:hover { background: #2563eb; }

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.btn-icon {
    padding: 7px 9px;
    border-radius: 6px;
    background: none;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
}

.btn-icon.edit { color: var(--info); }
.btn-icon.delete { color: var(--danger); }
.btn-icon.view { color: var(--success); }
.btn-icon:hover {
    background: var(--bg-light);
}

.btn-group {
    display: flex;
    gap: 8px;
}

/* ========== 表格 ========== */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius);
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-white);
}

.table thead {
    background: var(--bg-light);
}

.table th {
    padding: 13px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.table td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-primary);
}

.table tbody tr {
    transition: var(--transition);
}

.table tbody tr:hover {
    background: var(--primary-bg);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table-actions {
    display: flex;
    gap: 4px;
}

/* 直接使用在 td 上时保持表格单元格布局，避免整行分隔线错位呈阶梯状 */
td.table-actions {
    display: table-cell;
    white-space: nowrap;
}
td.table-actions > * {
    margin-right: 4px;
    vertical-align: middle;
}
td.table-actions > *:last-child { margin-right: 0; }

/* 标签/徽章 */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.tag-success { background: #d1fae5; color: #065f46; }
.tag-warning { background: #fef3c7; color: #92400e; }
.tag-danger { background: #fee2e2; color: #991b1b; }
.tag-info { background: #dbeafe; color: #1e40af; }
.tag-default { background: #f1f5f9; color: #475569; }
.tag-primary { background: var(--primary-bg); color: var(--primary-dark); }

/* ========== 搜索与筛选栏 ========== */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    flex-wrap: wrap;
    gap: 12px;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.search-input {
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: 7px;
    font-size: 13px;
    width: 240px;
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(14,165,164,0.1);
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 7px;
    font-size: 13px;
    background: var(--bg-white);
    cursor: pointer;
}

/* ========== 模态框 ========== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15,23,42,0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

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

.modal-lg { max-width: 780px; }
.modal-xl { max-width: 960px; }

.modal-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-title {
    font-size: 17px;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--bg-light);
    color: var(--danger);
}

.modal-body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 24px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.modal-footer {
    flex-shrink: 0;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* 表单网格 */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.form-grid .full {
    grid-column: 1 / -1;
}

/* 门店打卡规则：紧凑卡片与独立时间输入 */
.checkin-rule-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}
.checkin-rule-card {
    min-width: 0;
    padding: 9px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card-bg);
    transition: border-color .15s, background .15s, box-shadow .15s, opacity .15s;
}
.checkin-rule-card.is-active {
    border-color: var(--primary);
    background: var(--primary-bg);
    box-shadow: 0 0 0 2px rgba(14,165,164,.08);
}
.checkin-rule-card.is-muted { opacity: .58; }
.checkin-rule-toggle {
    width: 100%;
    align-items: flex-start;
    gap: 7px;
    margin: 0;
    padding: 0 0 8px;
    border: none;
    background: transparent;
}
.checkin-rule-copy { min-width: 0; line-height: 1.25; }
.checkin-rule-copy b { font-size: 13px; }
.checkin-rule-copy small { display: block; margin-top: 2px; color: var(--text-muted); font-size: 11px; }
.checkin-rule-times { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.checkin-rule-time { display: flex; flex-direction: column; gap: 4px; min-width: 0; color: var(--text-secondary); font-size: 11px; }
.checkin-rule-time input {
    width: 100%;
    min-width: 0;
    height: 32px;
    min-height: 32px;
    padding: 4px 6px;
    border-radius: 6px;
    background: #fff;
    font-size: 12px;
}
.checkin-rule-tip { margin: 7px 0 0; color: var(--text-muted); font-size: 12px; line-height: 1.6; }
@media (max-width: 640px) {
    .checkin-rule-grid { grid-template-columns: 1fr; }
}

/* ========== Toast 通知 ========== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: var(--bg-white);
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    border-left: 4px solid var(--success);
    min-width: 300px;
    animation: slideInRight 0.3s ease;
}

.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
.toast.info { border-left-color: var(--info); }

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.toast-icon {
    font-size: 18px;
}

.toast.success .toast-icon { color: var(--success); }
.toast.error .toast-icon { color: var(--danger); }
.toast.warning .toast-icon { color: var(--warning); }
.toast.info .toast-icon { color: var(--info); }

.toast-message {
    flex: 1;
    font-size: 13px;
    color: var(--text-primary);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
}

/* ========== 空状态 ========== */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 56px;
    margin-bottom: 16px;
    color: var(--border);
}

.empty-state p {
    font-size: 14px;
}

/* ========== 分页 ========== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.pagination-info {
    font-size: 13px;
    color: var(--text-secondary);
}

.pagination-controls {
    display: flex;
    gap: 6px;
}

.page-btn {
    padding: 6px 12px;
    border: 1px solid var(--border);
    background: var(--bg-white);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: var(--transition);
}

.page-btn:hover:not(:disabled) {
    background: var(--primary-bg);
    border-color: var(--primary);
}

.page-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========== 日历 ========== */
.calendar {
    background: var(--bg-white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.calendar-header h3 {
    font-size: 17px;
    font-weight: 700;
}

.calendar-nav {
    display: flex;
    gap: 8px;
}

.calendar-nav button {
    background: rgba(255,255,255,0.15);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
}

.calendar-nav button:hover {
    background: rgba(255,255,255,0.25);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.calendar-weekday {
    padding: 10px;
    text-align: center;
    font-weight: 600;
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--bg-light);
    border-bottom: 1px solid var(--border);
}

.calendar-day {
    min-height: 100px;
    padding: 8px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.calendar-day:nth-child(7n) {
    border-right: none;
}

.calendar-day:hover {
    background: var(--primary-bg);
}

.calendar-day.other-month {
    background: var(--bg-light);
    opacity: 0.5;
}

.calendar-day.today {
    background: var(--primary-bg);
}

.calendar-day.today .day-number {
    background: var(--primary);
    color: white;
}

.day-number {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
}

.appointment-dot {
    display: block;
    padding: 3px 6px;
    margin-bottom: 3px;
    background: var(--primary);
    color: white;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity 0.2s;
}
.appointment-dot:hover { opacity: 0.85; }

/* 日历视图状态颜色 — 与列表视图一致 */
.appointment-dot.appt-status-success { background: var(--success); }
.appointment-dot.appt-status-warning { background: var(--warning); }
.appointment-dot.appt-status-danger { background: var(--danger); }
.appointment-dot.appt-status-info { background: var(--info); }
.appointment-dot.appt-status-default { background: var(--text-muted); }

.appointment-dot.urgent { background: var(--danger); }

/* 排班月历：沿用预约日历结构与状态芯片 */
.schedule-calendar { box-shadow: none; border: 1px solid var(--border); }
.schedule-calendar .calendar-day { min-width: 0; }
.schedule-day-head { display: flex; align-items: center; justify-content: space-between; gap: 4px; min-height: 26px; margin-bottom: 4px; }
.schedule-day-head .day-number { flex: 0 0 26px; margin: 0; }
.schedule-day-badges { display: flex; align-items: center; justify-content: flex-end; gap: 3px; min-width: 0; }
.schedule-day-badge { display: inline-flex; align-items: center; gap: 2px; padding: 1px 4px; border-radius: 8px; background: #fff; font-size: 10px; line-height: 16px; }
.schedule-day-badge.checkin { color: #15803d; }
.schedule-day-badge.leave { color: #b45309; }
.schedule-shift { display: flex; align-items: center; gap: 5px; line-height: 1.35; }
.schedule-shift-name { flex: none; font-weight: 700; }
.schedule-shift-meta { min-width: 0; overflow: hidden; text-overflow: ellipsis; opacity: .92; }
.schedule-rest { line-height: 1.35; }
.schedule-more { padding: 2px 4px; color: var(--primary); font-size: 11px; font-weight: 600; cursor: pointer; }

/* ========== 年视图 ========== */
.year-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 16px;
}

.year-month-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
    background: var(--bg-white);
    transition: box-shadow 0.2s;
}

.year-month-card:hover {
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.ym-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
    text-align: center;
}

.ym-total {
    font-size: 11px;
    font-weight: normal;
    color: var(--text-muted);
}

.ym-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    margin-bottom: 4px;
}

.ym-weekdays span {
    font-size: 10px;
    color: var(--text-muted);
    text-align: center;
    padding: 2px 0;
}

.ym-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
}

.ym-cell {
    position: relative;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: var(--text-main);
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.15s;
}

.ym-cell:hover {
    background: var(--primary-bg);
}

.ym-cell.ym-empty {
    background: transparent;
    cursor: default;
}

.ym-cell.ym-today {
    background: var(--primary);
    color: white;
    font-weight: 700;
}

.ym-cell.ym-has {
    background: #dbeafe;
    color: #1d4ed8;
    font-weight: 600;
}

.ym-cell.ym-today.ym-has {
    background: var(--primary);
    color: white;
}

.ym-day {
    font-size: 11px;
}

.ym-cnt {
    position: absolute;
    bottom: 1px;
    right: 2px;
    font-size: 9px;
    font-weight: 700;
    color: #dc2626;
    background: white;
    border-radius: 50%;
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #dc2626;
}

.ym-cell.ym-today .ym-cnt {
    color: var(--primary);
    background: white;
}

/* 尾款记录行 */
.tail-row td {
    font-size: 12px;
    color: #6b7280;
}

/* ========== 权限矩阵 ========== */
.permission-table {
    width: 100%;
    border-collapse: collapse;
}

.permission-table th,
.permission-table td {
    padding: 10px 12px;
    border: 1px solid var(--border);
    text-align: center;
    font-size: 13px;
}

.permission-table th {
    background: var(--bg-light);
    font-weight: 600;
}

.permission-table td:first-child {
    text-align: left;
    font-weight: 500;
}

/* ========== 仪表盘图表区 ========== */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 22px;
}

.recent-list {
    list-style: none;
}

.recent-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.recent-list li:last-child {
    border-bottom: none;
}

.recent-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--primary-bg);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

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

.recent-name {
    font-weight: 600;
    font-size: 13px;
}

.recent-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

.recent-time {
    font-size: 12px;
    color: var(--text-muted);
}

/* 简易柱状图 */
.bar-chart {
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    height: 200px;
    padding: 20px 0;
    gap: 8px;
}

.bar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    flex: 1;
    gap: 8px;
}

.bar {
    width: 100%;
    max-width: 40px;
    background: linear-gradient(180deg, var(--primary-light) 0%, var(--primary) 100%);
    border-radius: 6px 6px 0 0;
    min-height: 4px;
    transition: height 0.5s ease;
    position: relative;
}

.bar:hover::after {
    content: attr(data-value);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 6px;
    background: var(--text-primary);
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    z-index: 10;
}

.bar-label {
    font-size: 12px;
    color: var(--text-secondary);
}

/* 环形进度 */
.progress-ring {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 10px 0;
}

.progress-ring svg {
    transform: rotate(-90deg);
}

.progress-ring text {
    font-size: 22px;
    font-weight: 700;
    fill: var(--text-primary);
    transform: rotate(90deg);
    transform-origin: center;
}

/* ========== 新增样式：牙位选择器、标签页、诊所/权限多选、诊费项目行等 ========== */

/* 模态框超大尺寸 */
.modal-xl { max-width: 1100px; width: 95vw; }
.modal-xl .modal-body { max-height: 78vh; overflow-y: auto; }

/* 标签页 */
.tab-bar { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 16px; }
.tab-btn { padding: 10px 20px; background: none; border: none; cursor: pointer; font-size: 14px; color: var(--text-secondary); border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all 0.2s; }
.tab-btn:hover { color: var(--primary); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tab-content { display: none; }
.tab-content.active { display: block; }
.detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.detail-grid .full { grid-column: 1 / -1; }
.detail-grid label { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.detail-grid > div { padding: 8px 12px; background: var(--bg); border-radius: 6px; }

/* 诊所只读显示 */
.clinic-readonly { padding: 8px 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; color: var(--text-secondary); }

/* 诊所/权限多选 */
.clinic-checkboxes, .perm-checkboxes { display: flex; flex-wrap: wrap; gap: 10px; padding: 14px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; align-items: flex-start; }
.clinic-cb, .perm-cb { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; background: #ffffff; border: 1px solid var(--border); border-radius: 6px; cursor: pointer; font-size: 13px; white-space: nowrap; word-break: keep-all; overflow-wrap: normal; flex: 0 0 auto; min-width: max-content; transition: all 0.15s; }
.clinic-cb:hover, .perm-cb:hover { border-color: var(--primary); background: var(--primary-bg); }
.clinic-cb input, .perm-cb input { width: 16px !important; height: 16px; cursor: pointer; accent-color: var(--primary); flex-shrink: 0; margin: 0; }

/* 牙位选择器 */
.tooth-picker { padding: 14px; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; }
.tooth-section { margin-bottom: 16px; }
.tooth-section:last-child { margin-bottom: 12px; }
.tooth-section-title { font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; }
.tooth-arch { display: flex; flex-direction: column; gap: 2px; align-items: center; }
.tooth-row { display: flex; gap: 2px; }
.tooth-midline { height: 4px; }
.tooth { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; background: var(--card-bg); border: 1.5px solid var(--border); border-radius: 6px; cursor: pointer; font-size: 11px; font-weight: 600; color: var(--text-secondary); transition: all 0.15s; user-select: none; }
.tooth:hover { border-color: var(--primary); transform: scale(1.08); }
.tooth.selected { background: var(--primary); color: #fff; border-color: var(--primary); }
.tooth.prim { background: #e8f5e9; border-color: #a5d6a7; }
.tooth.prim.selected { background: #43a047; border-color: #43a047; }
.tooth-selected { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); }
.tooth-selected-label { font-size: 13px; color: var(--text-secondary); margin-right: 8px; }
.tooth-tags { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.tooth-tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; background: var(--primary-bg); color: var(--primary); border-radius: 12px; font-size: 12px; font-weight: 600; }
.tooth-tag .fa-times { cursor: pointer; opacity: 0.7; }
.tooth-tag .fa-times:hover { opacity: 1; }

/* 静态牙位图（详情/打印） */
.tooth-print-wrap { display: inline-block; }
.tooth-print-row { display: flex; gap: 1px; margin-bottom: 1px; }
.tooth-print { width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; background: #f0f0f0; border: 1px solid #ccc; border-radius: 3px; font-size: 9px; font-weight: 600; }
.tooth-print.sel { background: #2c6e8f; color: #fff; border-color: #2c6e8f; }
.tooth-print-row.small .tooth-print { width: 16px; height: 16px; font-size: 8px; }

/* 诊费项目行 */
.fee-item-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; margin-bottom: 6px; }
.fee-item-row .btn-icon { color: var(--danger); }

/* 筛选下拉 */
.filter-select { padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--card-bg); color: var(--text-primary); font-size: 13px; cursor: pointer; }
.btn-sm { padding: 6px 12px; font-size: 12px; }

/* 可搜索选择器（备用） */
.search-select { position: relative; }
.search-select-input { width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--card-bg); color: var(--text-primary); }
.search-select-dropdown { position: absolute; top: 100%; left: 0; right: 0; background: #ffffff; border: 1px solid var(--border); border-radius: 6px; margin-top: 4px; max-height: 220px; overflow-y: auto; z-index: 9999; display: none; box-shadow: 0 6px 16px rgba(0,0,0,0.15); }
.search-select-dropdown.show { display: block; }
.ss-item { padding: 8px 12px; cursor: pointer; font-size: 13px; background: #ffffff; white-space: nowrap; }
.ss-item:hover { background: var(--primary-bg); }
.ss-create, .ss-empty { padding: 10px 12px; text-align: center; color: var(--primary); cursor: pointer; font-size: 13px; background: #ffffff; }

/* ========== 响应式 ========== */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .login-container {
        flex-direction: column;
    }
    .login-left {
        display: none;
    }
    .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width);
    }
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .menu-toggle {
        display: block;
    }
    .search-box {
        display: none;
    }
    .form-grid {
        grid-template-columns: 1fr;
    }
    .content-area {
        padding: 16px;
    }
}

/* ========== 通知下拉 ========== */
.notif-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 360px;
    max-height: 460px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.15);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.notif-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 14px;
    background: var(--bg);
}
.notif-list {
    overflow-y: auto;
    max-height: 400px;
}
.notif-item {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.15s;
}
.notif-item:hover { background: var(--bg); }
.notif-item.unread { background: #f0f7ff; }
.notif-item.unread:hover { background: #e6f0fa; }
.notif-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
}
.notif-body { flex: 1; min-width: 0; }
.notif-title { font-size: 13px; font-weight: 600; color: var(--text); }
.notif-content { font-size: 12px; color: var(--text-secondary); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-time { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.notif-empty { padding: 40px 20px; text-align: center; color: var(--text-muted); }
.notif-empty i { font-size: 32px; margin-bottom: 10px; opacity: 0.4; }

/* ========== 公告卡片 ========== */
.announcement-card {
    background: #fff;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 12px;
    border-left: 4px solid #2c6e8f;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.announcement-card .ann-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}
.announcement-card .ann-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.announcement-card .ann-content {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.7;
    white-space: pre-wrap;
}
.tabs-bar {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 16px;
}
.tab-item {
    padding: 10px 18px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.15s;
}
.tab-item.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}
.msg-item {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.15s;
}
.msg-item:hover { background: var(--bg); }
.msg-item.unread { background: #f0f7ff; }
.msg-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #2c6e8f;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}
.msg-body { flex: 1; min-width: 0; }
.msg-header { display: flex; justify-content: space-between; align-items: center; }
.msg-sender { font-weight: 600; font-size: 14px; }
.msg-time { font-size: 11px; color: var(--text-muted); }
.msg-content { font-size: 13px; color: var(--text-secondary); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ========== 新闻动态 ========== */
.news-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #f0fdfa 0%, #eef2ff 100%);
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    margin-bottom: 18px;
    border: 1px solid #e0e7ff;
}
.news-header-info { flex: 1; }
.news-title-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 10px;
}
.news-main-icon {
    font-size: 36px;
    color: var(--primary);
    background: #fff;
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
}
.news-main-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}
.news-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}
.news-meta {
    display: flex;
    gap: 16px;
    align-items: center;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
}
.news-update-time i, .news-source-badge i { margin-right: 4px; }
.news-source-badge {
    background: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    color: var(--secondary);
    font-weight: 500;
    border: 1px solid #e0e7ff;
}
.news-filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.news-filter-chip {
    padding: 6px 16px;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}
.news-filter-chip:hover { border-color: var(--primary); color: var(--primary); }
.news-filter-chip.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    font-weight: 500;
}
.news-loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.news-loading i {
    font-size: 32px;
    color: var(--primary);
    margin-bottom: 14px;
    display: block;
}
.news-loading p { font-size: 14px; }

/* 头条卡片 */
.news-headline {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 32px;
    border-radius: var(--radius-lg);
    color: #fff;
    margin-bottom: 20px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}
.news-headline::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.news-headline:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}
.news-headline-body { flex: 1; z-index: 1; }
.news-headline-badge {
    display: inline-block;
    background: rgba(255,255,255,0.25);
    padding: 3px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 10px;
}
.news-headline-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.4;
}
.news-headline-summary {
    font-size: 14px;
    opacity: 0.92;
    line-height: 1.6;
    margin-bottom: 14px;
}
.news-headline-meta {
    display: flex;
    gap: 20px;
    font-size: 12px;
    opacity: 0.85;
    align-items: center;
}
.news-headline-meta i { margin-right: 5px; }
.news-read-more {
    margin-left: auto;
    background: rgba(255,255,255,0.2);
    padding: 6px 14px;
    border-radius: 16px;
    font-weight: 500;
}

/* 新闻卡片网格 */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 18px;
}
.news-card {
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid var(--border);
}
.news-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}
.news-card-cover {
    height: 140px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.news-card-cat {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(255,255,255,0.95);
    color: var(--text-primary);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}
.news-card-body { padding: 16px 18px; }
.news-card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.news-card-summary {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.news-card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
}
.news-card-meta i { margin-right: 4px; }

/* 新闻详情弹窗 */
.news-detail { padding: 4px; }
.news-detail-cover {
    height: 180px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 20px;
}
.news-detail-cat {
    position: absolute;
    top: 16px;
    left: 16px;
    background: rgba(255,255,255,0.95);
    color: var(--text-primary);
    padding: 5px 14px;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 600;
}
.news-detail-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    line-height: 1.4;
}
.news-detail-meta {
    display: flex;
    gap: 20px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.news-detail-meta i { margin-right: 5px; }
.news-detail-summary {
    font-size: 15px;
    color: var(--primary-dark);
    background: var(--primary-bg);
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    line-height: 1.7;
    font-weight: 500;
    border-left: 4px solid var(--primary);
}
.news-detail-content {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.9;
}
.news-detail-content p { margin-bottom: 14px; }
.news-content-subtitle {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 18px 0 10px;
    padding-left: 10px;
    border-left: 3px solid var(--primary);
}

/* 原文配图 */
.news-detail-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.news-detail-img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: #f1f5f9;
}

/* 原文链接 */
.news-source-link {
    margin-top: 20px;
    padding: 14px 16px;
    background: var(--primary-bg);
    border: 1px dashed var(--primary);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}
.news-source-link i { color: var(--primary); }
.news-source-info { display: flex; flex-direction: column; gap: 4px; }
.news-source-info a {
    color: var(--primary-dark);
    text-decoration: none;
    font-weight: 500;
    word-break: break-all;
}
.news-source-info a:hover { text-decoration: underline; }
.news-source-host {
    font-size: 12px;
    color: var(--text-muted);
}

.news-detail-footer {
    margin-top: 24px;
    padding: 14px 16px;
    background: #f1f5f9;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: var(--text-muted);
}
.news-detail-footer i { color: var(--secondary); font-size: 16px; }

@media (max-width: 768px) {
    .news-headline {
        flex-direction: column;
        text-align: center;
        padding: 24px 20px;
    }
    .news-headline-title { font-size: 18px; }
    .news-headline-meta { flex-direction: column; gap: 8px; }
    .news-read-more { margin-left: 0; }
    .news-grid { grid-template-columns: 1fr; }
}

/* ========== 多支付方式选择器 ========== */
.payment-builder {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
}
.pay-loading { color: var(--text-muted); font-size: 13px; padding: 8px 0; }
.pay-method-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.pay-method-chip {
    display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
    border: 1px solid var(--border); background: #fff; border-radius: 999px;
    padding: 7px 13px; font-size: 13px; color: var(--text-secondary);
    transition: var(--transition); user-select: none;
}
.pay-method-chip:hover { border-color: var(--primary-light); color: var(--primary-dark); }
.pay-method-chip.active { border-color: var(--primary); background: var(--primary-bg); color: var(--primary-dark); font-weight: 600; }
.pay-method-chip.disabled { opacity: .45; cursor: not-allowed; }
.pay-method-chip input { display: none; }
.pay-method-chip small { font-size: 11px; color: var(--text-muted); font-weight: 400; }
.pay-method-chip.active small { color: var(--primary-dark); }
.pay-tip {
    margin-top: 10px; padding: 8px 10px; border-radius: 8px;
    background: #fffbeb; color: #92400e; font-size: 12px; line-height: 1.6;
}
.pay-tip i { margin-right: 4px; }
.pay-amount-list { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.pay-amount-row { display: flex; align-items: center; gap: 10px; }
.pay-amount-name { width: 74px; font-size: 13px; color: var(--text-secondary); flex: none; }
.pay-amount-row input {
    width: 130px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px;
    font-size: 13px; outline: none; background: #fff;
}
.pay-amount-row input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(14,165,164,.12); }
.pay-amount-row input.readonly { background: var(--bg); color: var(--primary-dark); font-weight: 600; }
.pay-amount-hint { font-size: 12px; color: var(--text-muted); line-height: 1.4; }
.pay-summary {
    margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border);
    display: flex; flex-wrap: wrap; gap: 8px 22px;
}
.pay-summary-item { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-secondary); }
.pay-summary-item strong { color: var(--text-primary); }
.pay-cell-line { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; line-height: 1.7; }
.pay-cell-line span { color: var(--text-secondary); }
.pay-cell-line b { color: var(--text-primary); }

/* ========== 会员管理 ========== */
.member-hero {
    background: linear-gradient(120deg, #0f766e 0%, #0ea5a4 55%, #14b8a6 100%);
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    color: #fff;
    margin-bottom: 18px;
    box-shadow: 0 10px 24px -12px rgba(13,148,136,.6);
    position: relative;
    overflow: hidden;
}
.member-hero::before,
.member-hero::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,.09);
    pointer-events: none;
}
.member-hero::before { width: 240px; height: 240px; right: -70px; top: -110px; }
.member-hero::after { width: 150px; height: 150px; right: 130px; bottom: -110px; background: rgba(255,255,255,.06); }
.member-hero > * { position: relative; z-index: 1; }
.member-hero-title { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 9px; margin-bottom: 16px; }
.member-stat-grid { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 12px; }
.member-stat {
    position: relative; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22);
    border-radius: 12px; padding: 13px 14px; backdrop-filter: blur(4px);
    transition: background .25s ease, transform .25s ease;
}
.member-stat:hover { background: rgba(255,255,255,.24); transform: translateY(-2px); }
.member-stat span { font-size: 12px; color: rgba(255,255,255,.82); display: block; }
.member-stat strong { font-size: 20px; font-weight: 700; display: block; margin-top: 5px; letter-spacing: .2px; }
.member-stat i { position: absolute; right: 12px; top: 12px; opacity: .3; font-size: 18px; }
.member-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 16px; flex-wrap: wrap; }
.member-tab {
    border: none; background: transparent; padding: 10px 16px; font-size: 14px;
    color: var(--text-secondary); cursor: pointer; border-bottom: 2px solid transparent;
    display: flex; align-items: center; gap: 7px; transition: var(--transition);
}
.member-tab:hover { color: var(--primary-dark); }
.member-tab.active { color: var(--primary-dark); border-bottom-color: var(--primary); font-weight: 600; }
.member-inline-value { font-size: 20px; font-weight: 700; color: var(--primary-dark); }
.member-logs { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.member-log-col h4 { font-size: 14px; color: var(--text-primary); margin-bottom: 10px; display: flex; align-items: center; gap: 7px; }
.member-log-col h4 i { color: var(--primary); }

.rules-panel { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px; }
.rules-header { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 18px; }
.rules-header h3 { font-size: 16px; display: flex; align-items: center; gap: 8px; }
.rules-header h3 i { color: var(--primary); }
.rules-header p { font-size: 12px; color: var(--text-muted); margin-top: 5px; }
.rules-grid { gap: 16px 22px; }
.switch-line { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-secondary); cursor: pointer; }
.switch-line input { width: 16px; height: 16px; accent-color: var(--primary); }
.rule-inline { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-secondary); flex-wrap: wrap; }
.rule-inline input { width: 80px; padding: 7px 9px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; }
.rules-tip { margin-top: 18px; padding: 12px 14px; background: var(--primary-bg); border-radius: 10px; font-size: 12px; color: var(--primary-dark); }
.rules-tip i { margin-right: 5px; }

/* 优惠监控：四大类 → 优惠活动 → 患者监控条目（父子级可折叠） */
.usage-cat { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card-bg); margin-bottom: 14px; overflow: hidden; }
.usage-cat-head { display: flex; align-items: center; gap: 10px; padding: 13px 16px; cursor: pointer; background: var(--bg-light); border-left: 4px solid var(--primary); user-select: none; }
.usage-cat-head:hover { background: var(--primary-bg); }
.usage-cat[data-cat="discount"] .usage-cat-head { border-left-color: #3b82f6; }
.usage-cat[data-cat="coupon"] .usage-cat-head { border-left-color: #f59e0b; }
.usage-cat[data-cat="gift"] .usage-cat-head { border-left-color: #10b981; }
.usage-cat[data-cat="card"] .usage-cat-head { border-left-color: #8b5cf6; }
.usage-cat[data-cat="discount"] .usage-rule { border-left-color: #3b82f6; }
.usage-cat[data-cat="coupon"] .usage-rule { border-left-color: #f59e0b; }
.usage-cat[data-cat="gift"] .usage-rule { border-left-color: #10b981; }
.usage-cat[data-cat="card"] .usage-rule { border-left-color: #8b5cf6; }
.usage-cat-ico { width: 26px; height: 26px; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: #fff; color: var(--text-secondary); border: 1px solid var(--border); }
.usage-cat-head b { font-size: 15px; }
.usage-cat-stat { margin-left: auto; font-size: 12px; color: var(--text-muted); }
.usage-caret { transition: transform .2s ease; color: var(--text-muted); font-size: 12px; }
.usage-cat.collapsed .usage-cat-head .usage-caret,
.usage-rule.collapsed .usage-rule-head .usage-caret { transform: rotate(-90deg); }
.usage-cat.collapsed .usage-cat-body { display: none; }
.usage-cat-body { padding: 14px 16px 6px 30px; }
.usage-rule { border: 1px solid var(--border); border-left: 3px solid var(--primary); border-radius: 10px; margin-bottom: 10px; background: #fff; overflow: hidden; }
.usage-rule-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 11px 14px; cursor: pointer; background: #fbfdff; user-select: none; }
.usage-rule-head:hover { background: var(--primary-bg); }
.usage-rule-head b { font-size: 14px; }
.usage-meta { font-size: 12px; color: var(--text-secondary); }
.usage-meta-strong { color: var(--primary-dark); font-weight: 600; }
.usage-rule-body { padding: 10px 12px 4px; border-top: 1px dashed var(--border); }
.usage-rule.collapsed .usage-rule-body { display: none; }
.usage-empty { padding: 16px; text-align: center; font-size: 12px; color: var(--text-muted); }

.redeem-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.redeem-card {
    background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-lg);
    overflow: hidden; display: flex; flex-direction: column; transition: var(--transition);
}
.redeem-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.redeem-card.off { opacity: .58; }
.redeem-img { height: 140px; background: var(--bg-light); display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 34px; }
.redeem-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease; }
.redeem-card:hover .redeem-img img { transform: scale(1.05); }
.redeem-body { padding: 12px 14px; flex: 1; }
.redeem-body h4 { font-size: 14px; color: var(--text-primary); margin-bottom: 5px; }
.redeem-body p { font-size: 12px; color: var(--text-muted); line-height: 1.5; min-height: 34px; }
.redeem-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 9px; font-size: 12px; color: var(--text-secondary); }
.redeem-points { color: #d97706; font-weight: 600; }
.redeem-actions { padding: 9px 14px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.image-upload-box {
    border: 1px dashed var(--border); border-radius: var(--radius); background: var(--bg-light);
    min-height: 120px; display: flex; align-items: center; justify-content: center; cursor: pointer; overflow: hidden;
}
.image-upload-box img { max-height: 160px; max-width: 100%; object-fit: contain; }
.upload-ph { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--text-muted); font-size: 12px; }
.upload-ph i { font-size: 24px; }

/* ========== 报表管理 ========== */
.report-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; flex-wrap: wrap; margin-bottom: 18px; }
/* 报表分类标签卡片 */
.report-tabs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 4px 0 18px; }
.report-tab-card {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer;
  border: 1.5px solid var(--border); border-radius: 12px; background: #fff;
  transition: all .18s ease; position: relative; overflow: hidden;
}
.report-tab-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--tab-color); opacity: .35; }
.report-tab-card:hover { border-color: var(--tab-color); transform: translateY(-2px); box-shadow: 0 6px 18px rgba(15, 23, 42, .08); }
.report-tab-card.active { border-color: var(--tab-color); background: color-mix(in srgb, var(--tab-color) 7%, #fff); box-shadow: 0 6px 18px rgba(15, 23, 42, .08); }
.report-tab-card.active::before { opacity: 1; }
.report-tab-icon {
  width: 42px; height: 42px; border-radius: 10px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: var(--tab-color); background: color-mix(in srgb, var(--tab-color) 12%, #fff);
}
.report-tab-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.report-tab-text strong { font-size: 14px; color: var(--text); }
.report-tab-text span { font-size: 11.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.report-head h2 { font-size: 20px; display: flex; align-items: center; gap: 9px; }
.report-head h2 i { color: var(--primary); }
.report-head p { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.report-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.report-toolbar input[type="date"] { padding: 6px 9px; border: 1px solid var(--border); border-radius: 8px; font-size: 12px; color: var(--text-secondary); }
.report-presets { display: flex; gap: 4px; background: var(--bg); border-radius: 8px; padding: 3px; }
.report-preset { border: none; background: transparent; padding: 6px 11px; border-radius: 6px; font-size: 12px; color: var(--text-secondary); cursor: pointer; }
.report-preset.active { background: #fff; color: var(--primary-dark); font-weight: 600; box-shadow: var(--shadow-sm); }
.report-tilde { color: var(--text-muted); font-size: 12px; }

.kpi-grid { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 12px; margin-bottom: 18px; }
.kpi-card {
    background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 14px 16px; display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow-sm);
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: rgba(14,165,164,.35); }
.kpi-icon { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 16px; flex: none; }
.kpi-card span { font-size: 12px; color: var(--text-muted); display: block; }
.kpi-card strong { font-size: 19px; color: var(--text-primary); display: block; margin-top: 2px; letter-spacing: .2px; }

.report-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.report-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px 18px; min-width: 0; transition: box-shadow .22s ease, border-color .22s ease; }
.report-card:hover { box-shadow: var(--shadow-md); border-color: rgba(14,165,164,.28); }
.report-card.span-2 { grid-column: span 2; }
.report-card.full { grid-column: 1 / -1; }
.report-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.report-card-head h3 { font-size: 14px; color: var(--text-primary); display: flex; align-items: center; gap: 7px; }
.report-card-head h3 i { color: var(--primary); }
.report-card-head span { font-size: 11px; color: var(--text-muted); }

.trend-chart { display: flex; align-items: flex-end; gap: 4px; height: 170px; padding-top: 8px; overflow: hidden; }
.trend-bar-wrap { flex: 1; min-width: 3px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; }
.trend-bar { width: 100%; max-width: 26px; height: 100%; display: flex; align-items: flex-end; background: transparent; }
.trend-bar-fill { width: 100%; border-radius: 4px 4px 0 0; min-height: 2px; opacity: .85; transition: height .4s ease; }
.trend-bar:hover .trend-bar-fill { opacity: 1; }
.trend-x { font-size: 10px; color: var(--text-muted); margin-top: 4px; height: 12px; overflow: hidden; white-space: nowrap; }
.trend-foot { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-muted); margin-top: 6px; border-top: 1px dashed var(--border); padding-top: 6px; }

.hbar-list { display: flex; flex-direction: column; gap: 9px; }
.hbar-row { display: flex; align-items: center; gap: 10px; }
.hbar-name { width: 108px; flex: none; font-size: 12px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { flex: 1; height: 10px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.hbar-fill { height: 100%; border-radius: 999px; min-width: 3px; transition: width .4s ease; }
.hbar-val { width: 104px; flex: none; text-align: right; font-size: 12px; color: var(--text-primary); font-weight: 600; }
.hbar-val span { display: block; font-size: 10px; color: var(--text-muted); font-weight: 400; }

.pie-wrap { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: center; }
.pie-svg { position: relative; width: 152px; height: 152px; flex: none; }
.pie-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.pie-center strong { font-size: 17px; color: var(--text-primary); line-height: 1; }
.pie-center span { font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.pie-legend { flex: 1; min-width: 130px; display: flex; flex-direction: column; gap: 6px; }
.pie-legend-row { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-secondary); }
.pie-dot { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.pie-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pie-val { color: var(--text-primary); font-weight: 600; }
.pie-pct { width: 44px; text-align: right; color: var(--text-muted); }

.rank-list { display: flex; flex-direction: column; gap: 9px; }
.rank-row { display: flex; align-items: center; gap: 10px; }
.rank-no { width: 22px; height: 22px; border-radius: 6px; background: var(--bg); color: var(--text-muted); font-size: 11px; display: flex; align-items: center; justify-content: center; flex: none; font-weight: 600; }
.rank-no.top { background: #fef3c7; color: #b45309; }
.rank-info { flex: 1; min-width: 0; }
.rank-info strong { display: block; font-size: 13px; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-info span { font-size: 11px; color: var(--text-muted); }
.rank-value { font-size: 13px; font-weight: 700; color: var(--primary-dark); }

@media (max-width: 1200px) {
    .member-stat-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
    .kpi-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
    .report-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .report-card.span-2 { grid-column: span 2; }
}
@media (max-width: 768px) {
    .member-stat-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .kpi-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .report-grid { grid-template-columns: 1fr; }
    .report-card.span-2, .report-card.full { grid-column: auto; }
    .member-logs { grid-template-columns: 1fr; }
    .member-hero { padding: 18px 16px; }
    .pay-summary { gap: 8px 14px; }
}

/* ========== 运营管理（AI 宣传物料） ========== */
.promo-hero {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    padding: 26px 28px 22px;
    margin-bottom: 18px;
    color: #fff;
    background: linear-gradient(120deg, #0f172a 0%, #134e4a 58%, #0d9488 100%);
    box-shadow: 0 16px 32px -18px rgba(15, 23, 42, 0.55);
}
.promo-hero-deco {
    position: absolute;
    width: 420px; height: 420px;
    right: -120px; top: -180px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(45, 212, 191, 0.42), rgba(45, 212, 191, 0) 68%);
    pointer-events: none;
}
.promo-hero::after {
    content: '';
    position: absolute;
    width: 260px; height: 260px;
    left: -90px; bottom: -150px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(250, 204, 21, 0.22), rgba(250, 204, 21, 0) 70%);
    pointer-events: none;
}
.promo-hero-top {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}
.promo-hero-top h2 { font-size: 21px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.promo-hero-top p { margin-top: 8px; font-size: 13px; color: rgba(255,255,255,0.72); line-height: 1.6; max-width: 720px; }
.promo-ai-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px; border-radius: 999px;
    background: rgba(255,255,255,0.14);
    border: 1px solid rgba(255,255,255,0.22);
    font-size: 12px; white-space: nowrap;
    backdrop-filter: blur(6px);
}
.promo-ai-badge.off { background: rgba(239, 68, 68, 0.18); border-color: rgba(239, 68, 68, 0.35); }
.promo-stat-grid {
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}
.promo-stat {
    position: relative;
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.14);
    transition: var(--transition);
}
.promo-stat:hover { background: rgba(255,255,255,0.16); transform: translateY(-2px); }
.promo-stat span { display: block; font-size: 12px; color: rgba(255,255,255,0.7); margin-bottom: 6px; }
.promo-stat strong { font-size: 24px; font-weight: 800; letter-spacing: 0.5px; }
.promo-stat i {
    position: absolute; right: 14px; top: 14px;
    font-size: 18px; color: rgba(255,255,255,0.35);
}
.promo-tabs {
    display: flex; gap: 6px; flex-wrap: wrap;
    padding: 6px; margin-bottom: 18px;
    background: #fff; border: 1px solid var(--border);
    border-radius: 14px; box-shadow: var(--shadow-sm);
}
.promo-tab {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 9px 18px; border: none; border-radius: 10px;
    background: transparent; color: var(--text-secondary);
    font-size: 13px; font-weight: 600; cursor: pointer;
    transition: var(--transition);
}
.promo-tab:hover { background: var(--bg-light); color: var(--text-primary); }
.promo-tab.active { background: linear-gradient(135deg, var(--primary), var(--primary-light)); color: #fff; box-shadow: 0 6px 14px -6px rgba(14, 165, 164, 0.6); }
.promo-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.promo-count { font-size: 12px; color: var(--text-muted); }

.promo-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}
.promo-card {
    background: #fff; border: 1px solid var(--border); border-radius: 16px;
    padding: 16px; transition: var(--transition);
    box-shadow: var(--shadow-sm);
}
.promo-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: rgba(14,165,164,0.35); }
.promo-card-head { display: flex; align-items: flex-start; gap: 10px; }
.promo-card-icon {
    width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #ccfbf1, #f0fdfa);
    color: var(--primary-dark); font-size: 16px;
}
.promo-card-title { flex: 1; min-width: 0; }
.promo-card-title strong { display: block; font-size: 15px; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.promo-card-title span { display: block; margin-top: 3px; font-size: 12px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.promo-card-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 12px 0 10px; font-size: 12px; color: var(--text-secondary); }
.promo-card-meta i { color: var(--primary); margin-right: 4px; }
.promo-card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.promo-type-tag {
    padding: 3px 9px; border-radius: 999px;
    background: var(--primary-bg); color: var(--primary-dark);
    font-size: 11px; font-weight: 600;
}
.promo-card-thumbs { display: flex; gap: 8px; height: 84px; margin-bottom: 14px; }
.promo-thumb {
    width: 64px; height: 84px; object-fit: cover; border-radius: 8px;
    border: 1px solid var(--border); cursor: pointer; transition: var(--transition);
}
.promo-thumb:hover { transform: scale(1.04); }
.promo-no-thumb {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
    border: 1px dashed var(--border); border-radius: 10px;
    color: var(--text-muted); font-size: 12px; background: var(--bg-light);
}
.promo-card-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.promo-card-actions .btn { flex: 1; justify-content: center; }

.promo-create { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 16px; align-items: start; }
.promo-form-card, .promo-preview-card {
    background: #fff; border: 1px solid var(--border); border-radius: 16px;
    padding: 20px; box-shadow: var(--shadow-sm);
}
.promo-form-head, .promo-preview-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.promo-form-head h3, .promo-preview-head h3 { font-size: 15px; display: flex; align-items: center; gap: 8px; color: var(--text-primary); }
.promo-form-head h3 i, .promo-preview-head h3 i { color: var(--primary); }
.promo-preview-head span { font-size: 12px; color: var(--text-muted); }
.promo-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.promo-form-grid .form-group { margin-bottom: 0; }
.promo-form-grid label em { color: var(--danger); font-style: normal; margin-left: 2px; }
.promo-span2 { grid-column: span 2; }
.promo-hint { display: block; margin-top: 5px; font-size: 11px; color: var(--text-muted); }
.promo-type-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.promo-type-chip {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 14px; border-radius: 10px; cursor: pointer;
    border: 1px solid var(--border); background: var(--bg-light);
    font-size: 12px; color: var(--text-secondary); transition: var(--transition);
}
.promo-type-chip input { accent-color: var(--primary); }
.promo-type-chip.active {
    border-color: var(--primary); color: var(--primary-dark);
    background: var(--primary-bg); font-weight: 600;
    box-shadow: 0 4px 10px -6px rgba(14, 165, 164, 0.7);
}
.promo-form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.promo-generate-btn {
    background: linear-gradient(135deg, #0d9488, #14b8a6 55%, #22d3ee);
    border: none; box-shadow: 0 10px 22px -12px rgba(13, 148, 136, 0.9);
}
.promo-generate-btn:hover { filter: brightness(1.05); }
.promo-generate-btn:disabled { opacity: 0.7; cursor: not-allowed; }
.promo-progress { margin-top: 16px; }
.promo-progress-bar { height: 6px; border-radius: 999px; background: #e2e8f0; overflow: hidden; }
.promo-progress-bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #0d9488, #22d3ee); transition: width 0.4s ease; }
.promo-progress p { margin-top: 8px; font-size: 12px; color: var(--text-secondary); }
.promo-warnings { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.promo-warnings span {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 7px 10px; border-radius: 8px; font-size: 12px;
    background: #fffbeb; color: #b45309; border: 1px solid #fde68a;
}
.promo-warnings span.warn { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.promo-preview-empty {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 10px; min-height: 320px; text-align: center;
    border: 1px dashed var(--border); border-radius: 14px;
    color: var(--text-muted); background: var(--bg-light);
}
.promo-preview-empty i { font-size: 34px; color: #cbd5e1; }
.promo-preview-empty p { font-size: 12px; line-height: 1.8; }
.promo-preview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.promo-shot { margin: 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--bg-light); }
.promo-shot img { display: block; width: 100%; max-height: 260px; object-fit: contain; background: #fff; }
.promo-shot figcaption {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 8px 10px; font-size: 11px; color: var(--text-secondary);
}
.promo-shot figcaption a { color: var(--primary-dark); font-size: 13px; }
.promo-shot-ops { display: inline-flex; align-items: center; gap: 10px; }
.promo-asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.promo-asset {
    background: #fff; border: 1px solid var(--border); border-radius: 14px;
    overflow: hidden; transition: var(--transition);
}
.promo-asset:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.promo-asset > img { display: block; width: 100%; height: 170px; object-fit: cover; cursor: zoom-in; background: var(--bg-light); }
.promo-asset-body { padding: 12px 14px 6px; }
.promo-asset-body strong { display: block; font-size: 13px; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.promo-asset-body span { display: block; margin-top: 4px; font-size: 11px; color: var(--primary-dark); }
.promo-asset-body small { display: block; margin-top: 3px; font-size: 11px; color: var(--text-muted); }
.promo-asset-actions { display: flex; gap: 8px; padding: 10px 14px 14px; }
.promo-asset-actions .btn { flex: 1; justify-content: center; }
.promo-modal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; max-height: 64vh; overflow: auto; }
.promo-preview-meta { display: flex; gap: 16px; justify-content: center; margin-top: 12px; font-size: 12px; color: var(--text-muted); }

@media (max-width: 1200px) {
    .promo-create { grid-template-columns: 1fr; }
    .promo-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
    .promo-hero { padding: 20px 16px; }
    .promo-hero-top { flex-direction: column; }
    .promo-form-grid { grid-template-columns: 1fr; }
    .promo-span2 { grid-column: auto; }
    .promo-card-grid, .promo-asset-grid { grid-template-columns: 1fr; }
}

/* ===== 病历三段式：电子病历 / 划价 / 收费 ===== */
.rec-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.rec-tab { border: 0; background: transparent; padding: 10px 18px; font-size: 14px; color: var(--text-secondary); cursor: pointer; border-bottom: 2px solid transparent; display: inline-flex; align-items: center; gap: 6px; }
.rec-tab:hover { color: var(--primary); }
.rec-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.pricing-summary { background: var(--primary-bg); border-radius: 12px; padding: 14px 16px; }
.pricing-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px 18px; }
.pricing-meta span { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 2px; }
.pricing-meta b { font-size: 15px; color: var(--text-primary); }
.pricing-amounts { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--border); color: var(--text-secondary); }
.pricing-row { display: grid; grid-template-columns: 1fr 80px 120px 110px 34px; gap: 8px; align-items: center; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px; background: var(--card-bg, #fff); }
.pricing-row .p-name { font-size: 14px; }
.pricing-row input { width: 100%; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; }
.pricing-row .p-line { text-align: right; font-weight: 600; color: var(--primary); }
@media (max-width: 720px) {
  .pricing-row { grid-template-columns: 1fr 1fr; }
}

/* ===== 用户权限矩阵 / 必填项设置 ===== */
.perm-matrix { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.perm-group { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--bg, #fafbfc); }
.perm-mod { display: flex; align-items: center; gap: 6px; font-size: 14px; margin-bottom: 8px; cursor: pointer; }
.perm-acts { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.perm-act { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--text-secondary); cursor: pointer; }
.perm-note { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }

/* 权限矩阵：可展开树状结构 */
.perm-tree-root { display: flex; flex-direction: column; gap: 8px; }
.perm-tree-root .perm-group.perm-tree { padding: 0; background: #fff; overflow: hidden; }
.perm-tree-summary {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; font-weight: 600; font-size: 14px;
  cursor: pointer; list-style: none; user-select: none;
  background: var(--bg, #f8fafc);
  border-left: 3px solid var(--primary);
}
.perm-tree-summary::-webkit-details-marker { display: none; }
.perm-tree-summary::before {
  content: '\f105'; font-family: 'Font Awesome 6 Free'; font-weight: 900;
  font-size: 12px; color: var(--text-muted); transition: transform .15s;
}
.perm-tree[open] > .perm-tree-summary::before { transform: rotate(90deg); }
.perm-tree-summary .perm-cb { margin-left: auto; }
.perm-tree-summary .perm-mod { margin-bottom: 0; font-size: 14px; }
.perm-tree .perm-acts {
  padding: 10px 14px 12px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 10px;
}
.perm-tree .perm-acts .perm-act {
  display: flex; align-items: center; justify-content: flex-start; gap: 8px;
  width: auto; min-width: 0; padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px;
  background: #fff; font-size: 13px; white-space: nowrap;
}
.perm-tree .perm-acts .perm-act:hover { border-color: var(--primary); background: var(--primary-bg); }
/* 避免全局 .form-group input{width:100%} 把复选框撑满整行 */
.perm-tree .perm-acts .perm-act input[type="checkbox"],
.perm-act input[type="checkbox"],
.perm-mod input[type="checkbox"] {
  width: 16px !important; height: 16px !important; min-width: 16px; flex: 0 0 auto;
  padding: 0; margin: 0; border: none; box-shadow: none; accent-color: var(--primary);
}
.perm-tree summary .perm-cb { pointer-events: auto; }

/* 患者列表：诊所缩略显示 + 操作双行 */
.clinic-chip {
  display: inline-block; max-width: 84px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; vertical-align: middle; cursor: default;
}
.actions-2row { display: grid; grid-template-columns: repeat(2, max-content); gap: 4px 6px; align-items: center; }

/* 病历管理：待完善病历气泡提示 */
.pending-record-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; margin-bottom: 4px;
  background: linear-gradient(90deg, #fff7ed 0%, #fffbf5 100%);
  border-bottom: 1px solid #fed7aa;
}
.pending-record-title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: #9a3412; white-space: nowrap; }
.pending-bubble {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px;
  background: #f97316; color: #fff; font-size: 12px; font-weight: 700;
  box-shadow: 0 0 0 0 rgba(249, 115, 22, .6); animation: pendingPulse 1.8s infinite;
}
@keyframes pendingPulse {
  0% { box-shadow: 0 0 0 0 rgba(249, 115, 22, .55); }
  70% { box-shadow: 0 0 0 8px rgba(249, 115, 22, 0); }
  100% { box-shadow: 0 0 0 0 rgba(249, 115, 22, 0); }
}
.pending-record-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pending-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border: 1px solid #fdba74; border-radius: 16px;
  background: #fff; color: #9a3412; font-size: 12px; cursor: pointer;
  transition: all .15s;
}
.pending-chip:hover { background: #f97316; border-color: #f97316; color: #fff; transform: translateY(-1px); }

/* 就诊管理：挂号布局 */
.visit-register-grid { display: grid; grid-template-columns: minmax(320px, 420px) 1fr; gap: 16px; align-items: start; }
.visit-register-grid > .card { margin: 0; box-shadow: none; }
@media (max-width: 1100px) { .visit-register-grid { grid-template-columns: 1fr; } }

/* 就诊记录：全流程时间线可视化 */
.vr-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 4px 4px 16px; }
.vr-head-title { font-size: 20px; font-weight: 700; color: var(--text-primary); display: flex; align-items: center; gap: 8px; }
.vr-head-title i { color: var(--primary); }
.vr-head-sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.vr-head-badge {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600;
  color: var(--primary); background: var(--primary-bg); border: 1px solid rgba(0,0,0,.04);
}
.vr-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px 4px; }
.vr-filters select, .vr-filters input {
  height: 36px; padding: 0 12px; border: 1px solid var(--border); border-radius: 8px;
  background: #fff; font-size: 13px; color: var(--text-secondary); min-width: 130px;
}
.vr-filters .search-input { flex: 1; min-width: 200px; }
.vr-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; padding: 4px 4px 16px; }
.vr-stat {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  border: 1px solid var(--border); border-radius: 12px; background: #fff;
}
.vr-stat-ico { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 16px; }
.vr-stat-ico.blue { background: linear-gradient(135deg, #60a5fa, #3b82f6); }
.vr-stat-ico.green { background: linear-gradient(135deg, #34d399, #10b981); }
.vr-stat-ico.orange { background: linear-gradient(135deg, #fbbf24, #f59e0b); }
.vr-stat-ico.purple { background: linear-gradient(135deg, #a78bfa, #8b5cf6); }
.vr-stat b { display: block; font-size: 18px; color: var(--text-primary); line-height: 1.2; }
.vr-stat span { font-size: 12px; color: var(--text-muted); }
.vr-group { border: 1px solid var(--border); border-radius: 14px; margin-bottom: 16px; background: #fff; overflow: hidden; }
.vr-patient {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 18px; background: linear-gradient(90deg, #f8fafc, #fff);
  border-bottom: 1px solid var(--border);
}
.vr-avatar {
  width: 42px; height: 42px; border-radius: 50%; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary), #60a5fa); color: #fff; font-size: 17px; font-weight: 700;
}
.vr-pname { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.vr-pmeta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.vr-flow { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.vr-flow-chip {
  padding: 4px 12px; border-radius: 14px; font-size: 12px; font-weight: 600;
  background: var(--bg, #f1f5f9); color: var(--text-secondary);
}
.vr-flow-chip.money { background: #ecfdf5; color: #047857; }
.vr-timeline { position: relative; padding: 18px 18px 18px 46px; }
.vr-timeline::before {
  content: ''; position: absolute; left: 25px; top: 22px; bottom: 22px; width: 2px;
  background: linear-gradient(180deg, var(--primary), #c7d2fe 60%, transparent);
}
.vr-event { position: relative; padding: 0 0 16px; }
.vr-event:last-child { padding-bottom: 0; }
.vr-dot {
  position: absolute; left: -32px; top: 0; width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 12px;
  color: #fff; background: var(--primary); box-shadow: 0 0 0 4px #fff;
  z-index: 1;
}
.vr-event.vr-create .vr-dot { background: #0ea5e9; }
.vr-event.vr-register .vr-dot { background: #3b82f6; }
.vr-event.vr-clinical .vr-dot { background: #8b5cf6; }
.vr-event.vr-pricing .vr-dot { background: #f59e0b; }
.vr-event.vr-charge .vr-dot { background: #10b981; }
.vr-event.vr-record .vr-dot { background: #64748b; }
.vr-card {
  border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px;
  background: #fff; transition: box-shadow .15s, transform .15s;
}
.vr-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.06); transform: translateX(2px); }
.vr-card-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.vr-date { font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.vr-tag {
  font-size: 11px; font-weight: 600; padding: 2px 10px; border-radius: 10px;
  background: var(--primary-bg); color: var(--primary);
}
.vr-desc { font-size: 13px; color: var(--text-secondary); margin-top: 6px; line-height: 1.6; }
.vr-meta { font-size: 12px; color: var(--text-muted); margin-top: 6px; display: flex; gap: 14px; flex-wrap: wrap; }
@media (max-width: 768px) {
  .vr-flow { margin-left: 0; width: 100%; }
  .vr-head { flex-direction: column; }
}

/* ===== 诊疗项目：项目大类分组（技术费用 / 耗材费用） ===== */
.ti-group { border: 1px solid var(--border); border-radius: 10px; background: #fff; margin-bottom: 14px; overflow: hidden; }
.ti-group-head {
  display: flex; align-items: center; gap: 10px; padding: 11px 16px;
  cursor: pointer; list-style: none; user-select: none;
  background: linear-gradient(90deg, var(--primary-bg, #eef6fb) 0%, #fff 100%);
  border-left: 3px solid var(--primary);
  font-size: 14px;
}
.ti-group-head::-webkit-details-marker { display: none; }
.ti-group-head::before {
  content: '\f105'; font-family: 'Font Awesome 6 Free'; font-weight: 900;
  font-size: 12px; color: var(--text-muted); transition: transform .15s;
}
.ti-group[open] > .ti-group-head::before { transform: rotate(90deg); }
.ti-group-head b { font-size: 14px; }
.ti-group-count { font-size: 12px; color: var(--text-muted); }
.ti-group-total { margin-left: auto; font-size: 12px; color: var(--text-secondary); }
.ti-group .table-container { border: none; border-radius: 0; }

/* ===== 诊费管理：窄屏缩略 / 悬停气泡 / 横向滚动 ===== */
.fees-scroll { overflow-x: auto; }
.fee-table { min-width: 1410px; table-layout: fixed; }
.fee-table th, .fee-table td { white-space: nowrap; }
.fee-table th, .fee-table td { vertical-align: middle; }
.fee-ellipsis {
  display: inline-block; max-width: 96px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; vertical-align: middle; cursor: default;
}
/* td 上的省略样式必须保持 table-cell，否则会破坏列宽导致分隔线错位 */
.fee-table td.fee-ellipsis {
  display: table-cell; max-width: none; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; vertical-align: middle;
}
.fee-items-text {
  display: inline-block; max-width: 220px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; vertical-align: middle; cursor: default;
}
.fee-table td.fee-wrap { max-width: 240px; white-space: normal; }
.fee-table .fee-group-row td {
  border-bottom: 1px solid var(--border);
  background: #e3f2ee;
}
.fee-table .fee-cycle-row td:first-child { box-shadow: inset 3px 0 0 var(--primary-light); }

/* 主条目 / 子条目底色区分：主行白底，明细行浅青，子项行更浅，均带左侧色条 */
.fee-table tbody tr[data-cycle-group] > td { background: #ffffff; }
.fee-table tr.fee-detail-row > td { background: #eaf5f1; }
.fee-table tr.fee-detail-sub-row > td { background: #f4faf7; }
.fee-table tr.tail-row > td { background: #eefaf3; }
.fee-table tr.fee-detail-row > td.fee-item-name,
.fee-table tr.fee-detail-sub-row > td.fee-item-name { box-shadow: inset 3px 0 0 var(--primary-light); }
.fee-table tr.fee-detail-sub-row > td.fee-item-name { box-shadow: inset 3px 0 0 #99d6cc; }

/* 会员优惠联动（收费表单） */
.fee-benefits { display: flex; flex-direction: column; gap: 6px; padding: 2px 0; }
.fee-benefit {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 7px 12px; border: 1px solid var(--border); border-radius: 8px;
  background: #fff; font-size: 13px; cursor: pointer;
}
.fee-benefit:hover { border-color: var(--primary); background: var(--primary-bg); }
.fee-benefit.is-disabled { opacity: .55; cursor: not-allowed; }
.fee-benefit-tag {
  font-size: 11px; padding: 1px 8px; border-radius: 10px;
  background: var(--primary-bg); color: var(--primary);
}
.fee-benefit-amt { color: #dc2626; font-weight: 600; margin-left: auto; }
.fee-benefit-gift { font-size: 12px; color: #b45309; }

/* ===== 患者列表自适应：窄屏横向滚动，条目保持单行 ===== */
.patients-scroll { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }
.patients-table { min-width: 1180px; table-layout: auto; }
.patients-table th, .patients-table td { white-space: nowrap; }
.patient-name-cell { display: table-cell; white-space: nowrap; }
.patient-name-cell strong { margin-right: 6px; }
.patient-name-cell .tag { vertical-align: middle; }

/* 会员优惠复选框左对齐，避免被通用 input 宽度拉伸 */
.fee-benefit input[type="checkbox"] {
  width: 16px; height: 16px; min-width: 16px; flex: 0 0 16px; margin: 0; padding: 0;
}

/* 账单展开下级条目：统一整行分隔线，避免阶梯状 */
.fee-table tr.fee-detail-row > td,
.fee-table tr.fee-detail-sub-row > td,
.fee-table tr.tail-row > td {
  border-top: none;
  border-bottom: 1px solid var(--border);
  box-shadow: none;
}

/* ===== 报表图表增强 ===== */
.trend-svg-wrap { width: 100%; overflow-x: auto; }
.trend-svg { width: 100%; height: auto; display: block; min-width: 420px; }
.trend-bar-rect { transition: opacity .15s ease; cursor: pointer; }
.trend-bar-rect:hover { opacity: 1 !important; }
.trend-dot { transition: r .15s ease; }
.trend-dot:hover { r: 5; }
.trend-foot { display:flex; justify-content:space-between; font-size:11px;color:var(--text-muted);padding:6px 4px 0;flex-wrap:wrap;gap:6px; }
.pie-wrap-lg { width: 100%; display: flex; justify-content: center; }
.pie-svg-lg { width: 100%; max-width: 420px; height: auto; display: block; overflow: visible; }
.pie-slice { transition: transform .18s ease, filter .18s ease; transform-origin: 165px 116px; cursor: pointer; }
.pie-slice:hover { transform: scale(1.045); filter: drop-shadow(0 3px 6px rgba(0,0,0,.18)); }
.pie-leader { pointer-events: none; }

/* 病历修改法律提醒 */
.legal-notice {
  font-size: 13px; line-height: 1.9; color: var(--text-secondary);
  background: #fff8f0; border: 1px solid #f5d9b8; border-left: 4px solid var(--warning);
  border-radius: 8px; padding: 14px 16px;
}
.legal-notice p { margin: 0 0 10px; }
.legal-notice p:last-child { margin-bottom: 0; }
.legal-notice .fa-triangle-exclamation { color: var(--warning); margin-right: 4px; }

/* 病历：主条目（周期头）与子条目底色区分 */
.rec-group-row > td { background: #e3f2ee !important; }
.rec-child-row > td { background: #f3faf8; }
.rec-child-row > td:nth-child(2) { box-shadow: inset 3px 0 0 #99d6cc; }
.rec-child-row:hover > td { background: #eaf6f3; }

/* ===== 账单打印预览 ===== */
.bill-print-preview { display: flex; gap: 14px; align-items: flex-start; min-height: 420px; }
.bill-preview-side { width: 230px; flex: 0 0 230px; border-right: 1px solid var(--border); padding-right: 12px; }
.bp-side-title { font-weight: 600; font-size: 13px; margin-bottom: 8px; color: var(--text); }
.bp-check-list { max-height: 220px; overflow: auto; }
.bp-check { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 4px 0; cursor: pointer; }
.bp-check input[type="checkbox"] { width: 15px; height: 15px; flex: 0 0 15px; }
.bp-check span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bp-check i { font-style: normal; color: var(--text-muted); font-size: 12px; }
.bp-hint { margin-top: 10px; font-size: 12px; color: var(--text-muted); line-height: 1.6; }
.bill-preview-paper { flex: 1; min-width: 0; background: #f1f5f9; border-radius: 8px; padding: 14px; max-height: 62vh; overflow: auto; }
.bill-preview-paper .bill { background: #fff; max-width: 720px; margin: 0 auto 14px; padding: 22px; box-shadow: 0 1px 4px rgba(0,0,0,.08); font-size: 12px; color: #222; }
.bill-preview-paper .bill:last-child { margin-bottom: 0; }
.bill-preview-paper .bill-head { display: flex; justify-content: space-between; border-bottom: 2px solid #2c6e8f; padding-bottom: 8px; margin-bottom: 10px; }
.bill-preview-paper .bill-head h1 { font-size: 18px; margin: 0 0 4px; color: #2c6e8f; }
.bill-preview-paper .bill-sub { font-size: 12px; color: #666; }
.bill-preview-paper .bill-no { font-size: 11px; color: #555; text-align: right; line-height: 1.7; }
.bill-preview-paper table { width: 100%; border-collapse: collapse; }
.bill-preview-paper .meta td { padding: 4px 6px; font-size: 12px; }
.bill-preview-paper .items th, .bill-preview-paper .items td { border: 1px solid #ddd; padding: 5px 7px; font-size: 12px; }
.bill-preview-paper .items th { background: #f1f5f9; text-align: left; }
.bill-preview-paper .items tr.sub td { background: #fafafa; color: #555; }
.bill-preview-paper .bill-benefit { font-size: 12px; color: #8a5a00; background: #fff8e6; border: 1px solid #f3d9a4; border-radius: 6px; padding: 6px 9px; margin: 0 0 9px; }
.bill-preview-paper .c { text-align: center; } .bill-preview-paper .r { text-align: right; } .bill-preview-paper .red { color: #c0392b; font-weight: 700; }
.bill-preview-paper .totals { margin-top: 9px; }
.bill-preview-paper .totals td { border: 1px solid #ddd; padding: 5px 7px; font-size: 12px; }
.bill-preview-paper .totals td:nth-child(odd) { background: #f8fafc; width: 86px; color: #555; }
.bill-preview-paper .bill-foot { display: flex; justify-content: space-between; margin-top: 22px; font-size: 12px; color: #555; }

/* ===== 就诊记录：按患者折叠 ===== */
.vr-patient { cursor: pointer; }
.vr-caret { color: var(--text-muted); font-size: 12px; margin-right: 2px; transition: transform .18s ease; }
.vr-group.collapsed .vr-caret { transform: rotate(-90deg); }
.vr-group.collapsed .vr-timeline { display: none; }
.vr-group.collapsed .vr-patient { border-bottom: none; }

/* ===== 就诊记录：同一患者按就诊编号分子组，组分界 + 可折叠 ===== */
.vr-cycle { margin-bottom: 12px; }
.vr-cycle:last-child { margin-bottom: 0; }
.vr-cycle-head {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 7px 12px; margin: 2px 0 8px;
  background: linear-gradient(90deg, #f0fdfa, #ffffff);
  border: 1px solid #ccfbf1; border-left: 3px solid var(--primary);
  border-radius: 8px; cursor: pointer; user-select: none; transition: background .15s, box-shadow .15s;
}
.vr-cycle-head:hover { background: #ecfdf5; box-shadow: 0 2px 8px rgba(14, 165, 164, .08); }
.vr-cycle-caret { color: var(--primary); font-size: 11px; transition: transform .18s ease; }
.vr-cycle.collapsed .vr-cycle-caret { transform: rotate(-90deg); }
.vr-cycle.collapsed .vr-cycle-body { display: none; }
.vr-cycle-label { font-size: 12px; color: var(--text-muted); }
.vr-cycle-no { font-family: ui-monospace, "SFMono-Regular", monospace; font-weight: 700; color: var(--primary-dark); font-size: 13px; letter-spacing: .3px; }
.vr-cycle-meta { margin-left: auto; font-size: 12px; color: var(--text-muted); white-space: nowrap; }

/* ===== 报表 同比/环比 与图例 ===== */
.compare-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; }
.compare-title { font-weight: 600; font-size: 13px; color: var(--text); display: inline-flex; align-items: center; gap: 6px; }
.compare-metric { display: inline-flex; align-items: center; gap: 8px; padding-left: 14px; border-left: 1px dashed var(--border); }
.compare-metric em { font-style: normal; font-size: 12px; color: var(--text-muted); }
.cmp-item { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; cursor: pointer; border-radius: 8px; padding: 1px 4px; transition: background .15s ease; }
.cmp-item:hover { background: var(--primary-bg); }
.cmp-item b { font-weight: 500; color: var(--text-muted); }
.cmp-val { font-weight: 700; font-size: 12px; padding: 1px 6px; border-radius: 10px; }
.cmp-val.up { color: #047857; background: #ecfdf5; }
.cmp-val.down { color: #b91c1c; background: #fef2f2; }
.cmp-val.flat { color: #64748b; background: #f1f5f9; }
.compare-note { font-size: 11px; color: var(--text-muted); margin-left: auto; }
.pie-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.pie-detail-head { background: var(--primary-bg); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; font-size: 13px; color: var(--text-secondary); }
.pie-detail-head b { color: var(--primary-dark); }
.trend-legend { display: inline-flex; align-items: center; gap: 4px; }
.trend-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; vertical-align: middle; }
