/* ===== 全局变量与重置 ===== */
:root {
    /* 科技风格配色 */
    --bg-primary: #0a1628;
    --bg-secondary: #0f1e3a;
    --bg-card: rgba(15, 30, 58, 0.8);
    --bg-card-hover: rgba(22, 42, 77, 0.9);
    --bg-input: rgba(10, 22, 40, 0.9);
    --border-color: rgba(64, 169, 255, 0.15);
    --border-active: rgba(64, 169, 255, 0.5);
    --text-primary: #e8f0ff;
    --text-secondary: #8fa8c8;
    --text-muted: #5a7090;
    --accent-primary: #40a9ff;
    --accent-cyan: #00d4ff;
    --accent-purple: #722ed1;
    --accent-green: #52c41a;
    --accent-orange: #fa8c16;
    --accent-red: #ff4d4f;
    --accent-yellow: #faad14;
    --gradient-primary: linear-gradient(135deg, #40a9ff 0%, #00d4ff 100%);
    --gradient-purple: linear-gradient(135deg, #722ed1 0%, #40a9ff 100%);
    --gradient-success: linear-gradient(135deg, #52c41a 0%, #00d4ff 100%);
    --gradient-danger: linear-gradient(135deg, #ff4d4f 0%, #fa8c16 100%);
    --shadow-glow: 0 0 24px rgba(64, 169, 255, 0.25);
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.3);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --header-height: 64px;
    --bottom-nav-height: 60px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    /* 微信内置浏览器：禁用长按弹出系统菜单（复制/转发/在浏览器打开） */
    -webkit-touch-callout: none;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    /* 微信/安卓：禁止文字自动调整大小 */
    text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    /* 字体抗锯齿：微信内置浏览器渲染更清晰 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* UI元素禁止选中文字（输入框/textarea单独放开） */
    -webkit-user-select: none;
    user-select: none;
    background-image:
        radial-gradient(circle at 15% 50%, rgba(64, 169, 255, 0.06) 0%, transparent 30%),
        radial-gradient(circle at 85% 30%, rgba(114, 46, 209, 0.05) 0%, transparent 30%);
    background-attachment: fixed;
}

/* 输入框/文本域允许选中（覆盖body的user-select:none） */
input, textarea, select, [contenteditable] {
    -webkit-user-select: text;
    user-select: text;
    -webkit-touch-callout: default;
}

#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== 顶部导航 ===== */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    /* fallback: 安卓微信X5内核不支持backdrop-filter，用纯色兜底 */
    background: rgba(10, 22, 40, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    /* 刘海屏适配：顶部安全区 */
    padding-top: env(safe-area-inset-top, 0);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    height: var(--header-height);
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    flex-shrink: 0;
}

.logo-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: var(--shadow-glow);
}

.logo-icon svg {
    width: 20px;
    height: 20px;
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

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

.logo-sub {
    font-size: 10px;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.header-nav {
    display: flex;
    gap: 4px;
    flex: 1;
    margin-left: 20px;
}

.header-nav a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}

.header-nav a:hover {
    color: var(--text-primary);
    background: rgba(64, 169, 255, 0.08);
}

.header-nav a.active {
    color: var(--accent-cyan);
    background: rgba(64, 169, 255, 0.12);
}

.header-nav .nav-icon {
    display: flex;
    width: 16px;
    height: 16px;
}

.header-nav .nav-icon svg {
    width: 100%;
    height: 100%;
}

.header-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.icon-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(64, 169, 255, 0.1);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.2s;
    -webkit-user-select: none;
    user-select: none;
}

.icon-btn:hover {
    background: rgba(64, 169, 255, 0.2);
    color: var(--accent-cyan);
}

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

.ai-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--accent-red);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* ===== 主内容区 ===== */
.app-main {
    flex: 1;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 24px 20px 40px;
}

.app-main.mobile {
    padding: 16px 12px calc(var(--bottom-nav-height) + 20px);
}

.view {
    animation: fadeIn 0.3s ease;
}

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

/* ===== 通用组件 ===== */
.page-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 24px;
}

.card {
    background: #0f1e3a;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.2s;
}

.card:hover {
    border-color: var(--border-active);
    box-shadow: var(--shadow-card);
}

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

.card-title {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-actions {
    display: flex;
    gap: 8px;
}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 44px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    border: none;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    font-family: inherit;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

.btn-primary {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(64, 169, 255, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 4px 16px rgba(64, 169, 255, 0.5);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(64, 169, 255, 0.1);
    color: var(--accent-cyan);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(64, 169, 255, 0.2);
}

.btn-danger {
    background: rgba(255, 77, 79, 0.15);
    color: var(--accent-red);
    border: 1px solid rgba(255, 77, 79, 0.3);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-ghost:hover {
    color: var(--text-primary);
    border-color: var(--border-active);
}

.btn-sm {
    min-height: 36px;
    padding: 6px 12px;
    font-size: 13px;
}

.btn-block {
    width: 100%;
}

.btn svg {
    width: 16px;
    height: 16px;
}

/* 表单 */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 500;
}

.form-label .required {
    color: var(--accent-red);
    margin-left: 2px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    min-height: 44px;
    padding: 12px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    transition: all 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--border-active);
    box-shadow: 0 0 0 3px rgba(64, 169, 255, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 96px;
    padding-top: 12px;
}

.form-select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238fa8c8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

/* 标签 */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.tag-primary { background: rgba(64, 169, 255, 0.15); color: var(--accent-primary); }
.tag-success { background: rgba(82, 196, 26, 0.15); color: var(--accent-green); }
.tag-warning { background: rgba(250, 173, 20, 0.15); color: var(--accent-yellow); }
.tag-danger { background: rgba(255, 77, 79, 0.15); color: var(--accent-red); }
.tag-purple { background: rgba(114, 46, 209, 0.15); color: var(--accent-purple); }
.tag-cyan { background: rgba(0, 212, 255, 0.15); color: var(--accent-cyan); }
.tag-orange { background: rgba(250, 140, 22, 0.15); color: var(--accent-orange); }
.tag-info { background: rgba(19, 194, 194, 0.15); color: #13c2c2; }
.tag-muted { background: rgba(255, 255, 255, 0.08); color: var(--text-muted, #999); }

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

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
}

.stat-card.success::before { background: var(--gradient-success); }
.stat-card.danger::before { background: var(--gradient-danger); }
.stat-card.purple::before { background: var(--gradient-purple); }

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-active);
    box-shadow: var(--shadow-card);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.stat-icon svg { width: 22px; height: 22px; }
.stat-icon.blue { background: rgba(64, 169, 255, 0.15); color: var(--accent-primary); }
.stat-icon.green { background: rgba(82, 196, 26, 0.15); color: var(--accent-green); }
.stat-icon.orange { background: rgba(250, 140, 22, 0.15); color: var(--accent-orange); }
.stat-icon.purple { background: rgba(114, 46, 209, 0.15); color: var(--accent-purple); }
.stat-icon.red { background: rgba(255, 77, 79, 0.15); color: var(--accent-red); }

.stat-value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
}

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

.stat-trend {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    margin-top: 8px;
}

.stat-trend.up { color: var(--accent-green); }
.stat-trend.down { color: var(--accent-red); }

/* ===== 网格布局 ===== */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

/* ===== 列表项 ===== */
.list-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    border-radius: var(--radius-md);
    background: rgba(10, 22, 40, 0.4);
    margin-bottom: 8px;
    border: 1px solid transparent;
    transition: all 0.2s;
    cursor: pointer;
}

.list-item:hover {
    background: rgba(64, 169, 255, 0.06);
    border-color: var(--border-color);
}

.list-item-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.list-item-icon svg { width: 20px; height: 20px; }

.list-item-content {
    flex: 1;
    min-width: 0;
}

.list-item-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.list-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
}

.list-item-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* ===== 底部导航 ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0));
    background: rgba(10, 22, 40, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-color);
    display: flex;
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav a {
    flex: 1;
    min-height: var(--bottom-nav-height);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 4px 8px;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

.bottom-nav a.active {
    color: var(--accent-cyan);
}

.bottom-nav .nav-icon {
    display: flex;
    width: 22px;
    height: 22px;
}

.bottom-nav .nav-icon svg {
    width: 100%;
    height: 100%;
}

.bottom-nav .nav-label {
    font-size: 10px;
    font-weight: 500;
}

/* ===== 模态框 ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 5vh 16px;
    overflow-y: auto;
    animation: fadeIn 0.2s ease;
}

.modal-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
}

.modal-container.large { max-width: 800px; }

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

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

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(255, 77, 79, 0.15);
    color: var(--accent-red);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

/* ===== Toast ===== */
.toast {
    position: fixed;
    top: calc(80px + env(safe-area-inset-top, 0));
    left: 50%;
    transform: translateX(-50%);
    max-width: calc(100vw - 32px);
    padding: 14px 22px;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.5;
    z-index: 2000;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--shadow-card);
    word-break: break-word;
}

.toast.success { background: rgba(82, 196, 26, 0.9); color: #fff; }
.toast.error { background: rgba(255, 77, 79, 0.9); color: #fff; }
.toast.info { background: rgba(64, 169, 255, 0.9); color: #fff; }

.toast-enter-active, .toast-leave-active {
    transition: all 0.3s ease;
}

.toast-enter-from, .toast-leave-to {
    opacity: 0;
    transform: translateX(-50%) translateY(-10px);
}

/* ===== AI 抽屉 ===== */
.ai-drawer {
    position: fixed;
    inset: 0;
    z-index: 999;
}

.ai-drawer-mask {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.2s ease;
}

.ai-drawer-content {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 480px;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    overflow-y: auto;
    animation: slideInRight 0.3s ease;
}

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

/* ===== 图表容器 ===== */
.chart-container {
    position: relative;
    height: 240px;
    width: 100%;
}

.chart-container.tall { height: 320px; }

/* ===== 时间线 ===== */
.timeline {
    position: relative;
    padding-left: 28px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: linear-gradient(to bottom, var(--accent-primary), transparent);
}

.timeline-item {
    position: relative;
    padding-bottom: 24px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -24px;
    top: 4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 3px solid var(--accent-primary);
    z-index: 1;
}

.timeline-item.success .timeline-dot { border-color: var(--accent-green); }
.timeline-item.warning .timeline-dot { border-color: var(--accent-yellow); }
.timeline-item.danger .timeline-dot { border-color: var(--accent-red); }
.timeline-item.purple .timeline-dot { border-color: var(--accent-purple); }

.timeline-date {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.timeline-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
}

.timeline-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

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

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

.empty-state svg {
    width: 56px;
    height: 56px;
    margin-bottom: 14px;
    opacity: 0.3;
}

.empty-state-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-secondary);
}

.empty-state-desc {
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 18px;
}

/* ===== 患者信息卡 ===== */
.patient-banner {
    background: linear-gradient(135deg, rgba(64, 169, 255, 0.1) 0%, rgba(114, 46, 209, 0.1) 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 24px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.patient-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.patient-info {
    flex: 1;
    min-width: 200px;
}

.patient-name {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}

.patient-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
    color: var(--text-secondary);
}

/* ===== AI 建议卡片 ===== */
.ai-suggestion {
    background: linear-gradient(135deg, rgba(114, 46, 209, 0.1) 0%, rgba(64, 169, 255, 0.05) 100%);
    border: 1px solid rgba(114, 46, 209, 0.2);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
}

.ai-suggestion::before {
    content: 'AI';
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 8px;
    background: var(--gradient-purple);
    color: #fff;
    letter-spacing: 1px;
}

.ai-suggestion-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding-right: 40px;
}

.ai-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gradient-purple);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ai-icon svg { width: 20px; height: 20px; color: #fff; }

.ai-suggestion-title {
    font-size: 16px;
    font-weight: 600;
}

.ai-suggestion-body {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 12px;
}

.ai-suggestion-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.priority-bar {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
}

.priority-bar span {
    height: 4px;
    flex: 1;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.1);
}

.priority-bar span.active.high { background: var(--accent-red); }
.priority-bar span.active.medium { background: var(--accent-orange); }
.priority-bar span.active.low { background: var(--accent-green); }

/* ===== 治疗方案卡 ===== */
.plan-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
}

.plan-card.active {
    border-color: var(--accent-green);
    box-shadow: 0 0 0 1px var(--accent-green), 0 0 20px rgba(82, 196, 26, 0.1);
}

.plan-line {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 12px;
}

.plan-line.first { background: rgba(82, 196, 26, 0.15); color: var(--accent-green); }
.plan-line.second { background: rgba(250, 140, 22, 0.15); color: var(--accent-orange); }
.plan-line.third { background: rgba(255, 77, 79, 0.15); color: var(--accent-red); }
.plan-line.fourth { background: rgba(114, 46, 209, 0.15); color: var(--accent-purple); }

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

.plan-name {
    font-size: 17px;
    font-weight: 700;
}

.plan-dates {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.plan-drugs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.drug-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 12px;
    background: rgba(64, 169, 255, 0.1);
    color: var(--accent-primary);
    border: 1px solid var(--border-color);
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    html { font-size: 15px; }

    .header-content {
        padding: 0 12px;
        gap: 12px;
    }

    .logo-sub { display: none; }

    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }

    .form-row, .form-row-3 {
        grid-template-columns: 1fr;
    }

    .stat-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .stat-card {
        padding: 14px;
    }

    .stat-value {
        font-size: 22px;
    }

    .stat-icon {
        width: 36px;
        height: 36px;
    }

    .stat-icon svg { width: 18px; height: 18px; }

    .card {
        padding: 16px;
    }

    .patient-banner {
        padding: 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .patient-avatar {
        width: 52px;
        height: 52px;
        font-size: 20px;
    }

    .modal-container {
        max-width: 100%;
    }

    .modal-header, .modal-body {
        padding: 16px;
    }

    .page-title {
        font-size: 19px;
        flex-wrap: wrap;
    }

    .page-subtitle {
        font-size: 13px;
        margin-bottom: 16px;
    }

    /* 标题行：标题与按钮自动换行 */
    .app-main .flex.justify-between.items-center {
        flex-wrap: wrap;
        gap: 12px;
    }

    /* 卡片头部允许换行 */
    .card-header {
        flex-wrap: wrap;
        gap: 8px;
    }

    /* 横向多列表单行（肿瘤标志物/基因突变）强制纵向 */
    .form-multi-row {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    .form-multi-row .form-group {
        width: 100% !important;
        margin-bottom: 8px !important;
    }
    .form-multi-row .btn {
        margin-bottom: 12px !important;
        margin-left: 0 !important;
    }

    /* 数据行手机端纵向布局 */
    .data-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    .data-value {
        text-align: left;
        width: 100%;
    }

    /* 底部导航项缩小间距 */
    .bottom-nav .nav-label {
        font-size: 10px;
    }

    .bottom-nav .nav-icon {
        width: 22px;
        height: 22px;
    }

    /* ========== 手机端关键修复 ========== */

    /* ① iOS输入框防缩放：所有原生输入控件最小16px字号 */
    .form-input,
    .form-select,
    .form-textarea,
    .modal-header input,
    .card-body input,
    .card-body select,
    .card-body textarea {
        font-size: 16px !important;
    }

    /* ② 手机端主区域更紧凑：底部留出安全区+bottom-nav */
    .app-main.mobile {
        padding: 14px 12px calc(var(--bottom-nav-height) + 20px + env(safe-area-inset-bottom, 0));
    }

    /* ③ 模态框手机端：贴边显示，增加垂直可用空间 */
    .modal-overlay {
        padding: 3vh 10px 0;
        align-items: flex-start;
    }
    .modal-container {
        border-radius: 16px 16px 12px 12px;
        margin: 0;
        max-height: 94vh;
    }

    /* ④ 图表容器手机端高度略降，适配一屏显示更多 */
    .chart-container {
        height: 220px;
    }

    /* ⑤ 空状态压缩，适配短屏 */
    .empty-state {
        padding: 28px 14px;
    }
    .empty-state svg {
        width: 48px;
        height: 48px;
        margin-bottom: 10px;
    }
    .empty-state-title {
        font-size: 15px;
    }
    .empty-state-desc {
        font-size: 12.5px;
        margin-bottom: 14px;
    }

    /* ⑥ 时间线手机端：左侧宽度压缩，更紧凑 */
    .timeline {
        padding-left: 22px;
    }
    .timeline::before {
        left: 8px;
        top: 6px;
        bottom: 6px;
    }
    .timeline-item {
        padding-bottom: 18px;
    }
    .timeline-dot {
        left: -20px;
        top: 2px;
        width: 14px;
        height: 14px;
        border-width: 2px;
    }

    /* ⑦ 列表项卡片更小间距，一屏显示更多条目 */
    .list-item {
        padding: 12px 14px;
    }
    .mb-24 { margin-bottom: 16px; }
    .mt-24 { margin-top: 16px; }
}

/* ========== 600px 断点：大屏手机（iPhone 14/13/12、Pixel 7等）进一步优化 ========== */
@media (max-width: 600px) {
    html { font-size: 15px; }

    .card {
        padding: 14px;
        border-radius: 14px;
    }

    .page-title {
        font-size: 18px;
    }

    .patient-banner {
        padding: 14px;
        border-radius: 16px;
    }

    .stat-card {
        padding: 12px;
        border-radius: 14px;
    }
    .stat-label {
        font-size: 12px;
    }
    .stat-value {
        font-size: 20px;
    }
    .stat-change {
        font-size: 11px;
    }

    .btn {
        min-height: 42px;
        padding: 9px 15px;
        font-size: 14.5px;
    }
    .icon-btn {
        width: 42px;
        height: 42px;
    }

    .form-input,
    .form-select {
        min-height: 42px;
        padding: 10px 12px;
    }

    .plan-drugs {
        gap: 5px;
    }
    .drug-tag {
        font-size: 11.5px;
        padding: 3px 8px;
    }

    /* AI抽屉手机端最大宽度改为全屏 */
    .ai-drawer-content {
        max-width: 100% !important;
        width: 100% !important;
    }

    .chart-container {
        height: 210px;
    }
}

@media (max-width: 480px) {
    html { font-size: 14.5px; }

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

    .patient-meta {
        gap: 8px;
        font-size: 12px;
    }

    .card-actions {
        flex-wrap: wrap;
    }

    .page-title {
        font-size: 17px;
    }

    /* 极限小屏更紧凑 */
    .app-main.mobile {
        padding: 12px 10px calc(var(--bottom-nav-height) + 16px + env(safe-area-inset-bottom, 0));
    }

    .card {
        padding: 12px;
        border-radius: 12px;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
    }

    .patient-banner {
        padding: 12px;
        border-radius: 14px;
        gap: 10px;
    }
    .patient-avatar {
        width: 48px;
        height: 48px;
        font-size: 18px;
    }
    .patient-name {
        font-size: 18px !important;
    }

    .header-content {
        min-height: 56px;
        padding: 8px 10px;
    }
    .logo {
        font-size: 16px;
    }
    .icon-btn {
        width: 40px;
        height: 40px;
    }

    .page-title {
        font-size: 16.5px;
    }

    .chart-container {
        height: 200px;
    }

    .stat-card {
        padding: 10px 12px;
    }
    .stat-value {
        font-size: 19px;
    }

    /* 小屏下筛选按钮更紧凑 */
    .btn-sm {
        min-height: 32px;
        padding: 4px 10px;
        font-size: 12px;
    }

    /* 小屏趋势表格缩小内边距 */
    .trend-table th,
    .trend-table td { padding: 8px 8px; font-size: 13px; }

    .list-item {
        padding: 10px 12px;
    }

    .modal-header, .modal-body {
        padding: 14px 12px;
    }
    .modal-title {
        font-size: 16px;
    }

    .bottom-nav {
        --bottom-nav-height: 58px;
    }
    .bottom-nav a {
        padding: 5px 3px 7px;
    }
    .bottom-nav .nav-label {
        font-size: 9px;
        line-height: 1.2;
        max-width: 100%;
        text-overflow: ellipsis;
        white-space: nowrap;
        overflow: hidden;
    }
    .bottom-nav .nav-icon {
        width: 20px;
        height: 20px;
    }

    /* 极限小屏空状态进一步压缩 */
    .empty-state {
        padding: 22px 10px;
    }
    .empty-state svg {
        width: 40px;
        height: 40px;
    }

    /* toast不溢出 */
    .toast {
        padding: 12px 16px !important;
        font-size: 14px !important;
    }
    .toast.success, .toast.error, .toast.info {
        font-size: 14px !important;
    }

    /* 小屏下药物/标签tag更紧凑 */
    .tag {
        font-size: 11px;
        padding: 3px 8px;
    }
    .drug-tag {
        font-size: 11px;
        padding: 2px 8px;
        border-radius: 6px;
    }
    .plan-drugs {
        gap: 4px;
        margin-bottom: 8px;
    }

    .plan-name {
        font-size: 15.5px;
    }
    .plan-dates {
        font-size: 12px;
        margin-bottom: 8px;
    }
    .plan-line {
        font-size: 11.5px;
        padding: 3px 8px;
    }
}

/* ===== 强制移动模式：用于桌面浏览器模拟手机布局（截图/预览用） =====
   真实手机依赖 @media 查询，下面这部分仅当 body 被加上 .force-mobile class 时生效
   重要：此部分必须与 @media (max-width:768/600/480) 三个断点的最新规则保持同步镜像 */
body.force-mobile {
    max-width: 400px !important;
    margin: 0 auto !important;
}
body.force-mobile,
body.force-mobile .app-shell {
    width: 100% !important;
    max-width: 400px !important;
    overflow-x: hidden !important;
}
/* --- 以下严格镜像 @media (max-width:768px) 的全部规则 --- */
body.force-mobile { font-size: 15px; }
body.force-mobile .header-content { padding: 0 12px; gap: 12px; }
body.force-mobile .logo-sub { display: none; }
body.force-mobile .grid-2,
body.force-mobile .grid-3 { grid-template-columns: 1fr; }
body.force-mobile .form-row,
body.force-mobile .form-row-3 { grid-template-columns: 1fr; }
body.force-mobile .stat-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
body.force-mobile .stat-card { padding: 14px; }
body.force-mobile .stat-value { font-size: 22px; }
body.force-mobile .stat-icon { width: 36px; height: 36px; }
body.force-mobile .stat-icon svg { width: 18px; height: 18px; }
body.force-mobile .card { padding: 16px; }
body.force-mobile .patient-banner { padding: 16px; flex-direction: column; align-items: flex-start; gap: 12px; }
body.force-mobile .patient-avatar { width: 52px; height: 52px; font-size: 20px; }
body.force-mobile .modal-container { max-width: 100%; }
body.force-mobile .modal-header,
body.force-mobile .modal-body { padding: 16px; }
body.force-mobile .page-title { font-size: 19px; flex-wrap: wrap; }
body.force-mobile .page-subtitle { font-size: 13px; margin-bottom: 16px; }
body.force-mobile .app-main .flex.justify-between.items-center { flex-wrap: wrap; gap: 12px; }
body.force-mobile .card-header { flex-wrap: wrap; gap: 8px; }
body.force-mobile .form-multi-row { flex-direction: column !important; align-items: stretch !important; }
body.force-mobile .form-multi-row .form-group { width: 100% !important; margin-bottom: 8px !important; }
body.force-mobile .form-multi-row .btn { margin-bottom: 12px !important; margin-left: 0 !important; }
body.force-mobile .data-row { flex-direction: column; align-items: flex-start; gap: 4px; }
body.force-mobile .data-value { text-align: left; width: 100%; }
/* 移动端趋势表格缩小内边距 */
body.force-mobile .trend-table th,
body.force-mobile .trend-table td { padding: 8px 8px; font-size: 13px; }
body.force-mobile .bottom-nav .nav-label { font-size: 10px; }
body.force-mobile .bottom-nav .nav-icon { width: 22px; height: 22px; }
/* ① iOS防缩放：输入框最小16px */
body.force-mobile .form-input,
body.force-mobile .form-select,
body.force-mobile .form-textarea,
body.force-mobile .modal-header input,
body.force-mobile .card-body input,
body.force-mobile .card-body select,
body.force-mobile .card-body textarea { font-size: 16px !important; }
/* ② 主区域移动端内边距（含安全区） */
body.force-mobile .app-main,
body.force-mobile .app-main.mobile {
    padding: 14px 12px calc(var(--bottom-nav-height) + 20px + env(safe-area-inset-bottom, 0)) !important;
}
/* ③ 模态框贴边 */
body.force-mobile .modal-overlay { padding: 3vh 10px 0 !important; align-items: flex-start !important; }
body.force-mobile .modal-container {
    border-radius: 16px 16px 12px 12px !important;
    margin: 0 !important;
    max-height: 94vh !important;
}
/* ④ 图表容器高度降 */
body.force-mobile .chart-container { height: 220px; }
/* ⑤ 空状态压缩 */
body.force-mobile .empty-state { padding: 28px 14px; }
body.force-mobile .empty-state svg { width: 48px; height: 48px; margin-bottom: 10px; }
body.force-mobile .empty-state-title { font-size: 15px; }
body.force-mobile .empty-state-desc { font-size: 12.5px; margin-bottom: 14px; }
/* ⑥ 时间线紧凑 */
body.force-mobile .timeline { padding-left: 22px; }
body.force-mobile .timeline::before { left: 8px; top: 6px; bottom: 6px; }
body.force-mobile .timeline-item { padding-bottom: 18px; }
body.force-mobile .timeline-dot { left: -20px; top: 2px; width: 14px; height: 14px; border-width: 2px; }
/* ⑦ 列表项 + 间距压缩 */
body.force-mobile .list-item { padding: 12px 14px; }
body.force-mobile .mb-24 { margin-bottom: 16px !important; }
body.force-mobile .mt-24 { margin-top: 16px !important; }

/* --- 600px级别大屏安卓/iPhone 镜像 --- */
body.force-mobile .card { padding: 14px; border-radius: 14px; }
body.force-mobile .page-title { font-size: 18px; }
body.force-mobile .patient-banner { padding: 14px; border-radius: 16px; }
body.force-mobile .stat-card { padding: 12px; border-radius: 14px; }
body.force-mobile .stat-label { font-size: 12px; }
body.force-mobile .stat-value { font-size: 20px; }
body.force-mobile .stat-change { font-size: 11px; }
body.force-mobile .btn { min-height: 42px; padding: 9px 15px; font-size: 14.5px; }
body.force-mobile .icon-btn { width: 42px; height: 42px; }
body.force-mobile .form-input,
body.force-mobile .form-select { min-height: 42px; padding: 10px 12px; }
body.force-mobile .plan-drugs { gap: 5px; }
body.force-mobile .drug-tag { font-size: 11.5px; padding: 3px 8px; }
body.force-mobile .ai-drawer-content { max-width: 100% !important; width: 100% !important; }
body.force-mobile .chart-container { height: 210px; }

/* --- 480px级别（iPhone SE 类小屏） --- */
body.force-mobile.force-mobile-sm { font-size: 14.5px; }
body.force-mobile.force-mobile-sm .stat-grid { grid-template-columns: 1fr; }
body.force-mobile.force-mobile-sm .patient-meta { gap: 8px; font-size: 12px; }
body.force-mobile.force-mobile-sm .card-actions { flex-wrap: wrap; }
body.force-mobile.force-mobile-sm .page-title { font-size: 16.5px; }
body.force-mobile.force-mobile-sm .app-main,
body.force-mobile.force-mobile-sm .app-main.mobile {
    padding: 12px 10px calc(var(--bottom-nav-height) + 16px + env(safe-area-inset-bottom, 0)) !important;
}
body.force-mobile.force-mobile-sm .card { padding: 12px; border-radius: 12px; box-shadow: 0 2px 12px rgba(0,0,0,0.25); }
body.force-mobile.force-mobile-sm .patient-banner { padding: 12px; border-radius: 14px; gap: 10px; }
body.force-mobile.force-mobile-sm .patient-avatar { width: 48px; height: 48px; font-size: 18px; }

/* ===== 文件上传组件 ===== */
.file-uploader {
    margin-top: 12px;
}

.file-uploader-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: rgba(10, 22, 40, 0.5);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.file-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: 1px solid var(--border-color);
    flex-shrink: 0;
}

.file-pdf-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    padding: 6px;
    background: rgba(255, 77, 79, 0.1);
    border: 1px solid rgba(255, 77, 79, 0.3);
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--accent-red);
    flex-shrink: 0;
}

.file-pdf-name {
    font-size: 9px;
    margin-top: 2px;
    text-align: center;
    word-break: break-all;
    line-height: 1.2;
}

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

.file-uploader-input {
    padding: 8px 0;
}

/* 进度条 */
.progress-bar {
    position: relative;
    height: 22px;
    margin-top: 8px;
    background: rgba(10, 22, 40, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 11px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    transition: width 0.2s ease;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 11px;
    color: var(--text-primary);
    font-weight: 600;
}

.upload-error {
    margin-top: 6px;
    padding: 6px 10px;
    background: rgba(255, 77, 79, 0.1);
    border: 1px solid rgba(255, 77, 79, 0.3);
    border-radius: var(--radius-sm);
    color: var(--accent-red);
    font-size: 12px;
}

/* 图片预览大图 */
.image-preview-wrapper {
    min-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
    /* 兼容 Android WeChat X5：backdrop-filter 可能不支持时的不透明背景兜底 */
    background: #0f1d34;
    background: rgba(15, 29, 52, 0.92);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-radius: 12px;
    padding: 16px;
}
.image-preview-container {
    text-align: center;
    width: 100%;
    min-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* PDF 逐页预览容器与页图 */
.pdf-preview {
    width: 100%;
}
.pdf-canvas-wrap {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.pdf-page-canvas {
    width: 100%;
    max-width: 820px;
    height: auto;
    margin-bottom: 12px;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
    background: #fff;
}

.image-preview-large {
    max-width: 100%;
    max-height: 70vh;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    /* 避免微信长按弹出图片菜单（但此场景为预览，保留；同时设置显示属性以防容器塌陷） */
    display: block;
    margin: 0 auto;
    object-fit: contain;
}

/* 图片加载失败兜底 */
.image-fallback {
    width: 100%;
    min-height: 260px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-secondary);
    padding: 16px 8px;
    position: relative;
}
.fallback-icon {
    width: 56px; height: 56px; min-width: 44px; min-height: 44px;
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255, 77, 79, 0.12);
    color: var(--accent-red);
    margin-bottom: 16px;
}
.fallback-icon svg { width: 30px; height: 30px; }
.fallback-title {
    font-size: 16px; font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}
.fallback-sub {
    font-size: 13px;
    color: var(--text-secondary);
    max-width: 360px;
    line-height: 1.6;
    margin-bottom: 20px;
}
.fallback-actions {
    display: flex; gap: 10px; flex-wrap: wrap;
    align-items: center; justify-content: center;
}
.fallback-actions .btn { min-height: 44px; padding: 0 20px; font-size: 14px; }
.fallback-toast {
    position: absolute; bottom: 8px;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12px;
}

/* 图片加载中 spinner */
.image-loading {
    width: 100%;
    min-height: 260px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.spinner {
    width: 40px; height: 40px;
    border-radius: 50%;
    border: 3px solid rgba(64, 169, 255, 0.2);
    border-top-color: #40a9ff;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.mt-12 { margin-top: 12px !important; }

/* ===== OCR 识别建议弹窗样式 ===== */
.ocr-suggestion .suggestion-section-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 8px;
}

.ocr-suggestion .suggestion-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 4px;
    border-bottom: 1px dashed rgba(255,255,255,0.05);
}

.ocr-suggestion .suggestion-check {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    min-width: 140px;
    padding-top: 2px;
    cursor: pointer;
}

.ocr-suggestion .suggestion-check input[type=checkbox] {
    margin-top: 4px;
    min-width: 18px;
    min-height: 18px;
}

.ocr-suggestion .suggestion-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.ocr-suggestion .suggestion-value {
    flex: 1;
    font-size: 13px;
    color: var(--text-primary);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    word-break: break-word;
}

.ocr-suggestion .confidence {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.ocr-suggestion .confidence.c5 { background: rgba(82,196,26,0.18); color: #52c41a; }
.ocr-suggestion .confidence.c4 { background: rgba(82,196,26,0.12); color: #73d13d; }
.ocr-suggestion .confidence.c3 { background: rgba(250,173,20,0.15); color: #faad14; }
.ocr-suggestion .confidence.c2,
.ocr-suggestion .confidence.c1,
.ocr-suggestion .confidence.c0 { background: rgba(255,77,79,0.12); color: #fa8c16; }

.ocr-suggestion .raw-preview-text {
    background: rgba(10,22,40,0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-secondary);
    max-height: 200px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    margin-top: 6px;
}

.ocr-suggestion .table-wrap {
    overflow-x: auto;
}

.ocr-suggestion .data-table.compact th,
.ocr-suggestion .data-table.compact td {
    padding: 6px 8px;
    font-size: 12px;
}

@media (max-width: 600px) {
    .ocr-suggestion .suggestion-row {
        flex-direction: column;
        gap: 4px;
    }
    .ocr-suggestion .suggestion-check {
        min-width: auto;
    }
}

/* 卡片标题里的附件按钮间距 */
.card-title .btn.btn-sm {
    margin-left: 8px;
    padding: 2px 8px;
    vertical-align: middle;
}
body.force-mobile.force-mobile-sm .patient-name { font-size: 18px !important; }
body.force-mobile.force-mobile-sm .header-content { min-height: 56px; padding: 8px 10px; }
body.force-mobile.force-mobile-sm .logo { font-size: 16px; }
body.force-mobile.force-mobile-sm .icon-btn { width: 40px; height: 40px; }
body.force-mobile.force-mobile-sm .chart-container { height: 200px; }
body.force-mobile.force-mobile-sm .stat-card { padding: 10px 12px; }
body.force-mobile.force-mobile-sm .stat-value { font-size: 19px; }
body.force-mobile.force-mobile-sm .btn-sm { min-height: 32px; padding: 4px 10px; font-size: 12px; }
body.force-mobile.force-mobile-sm .list-item { padding: 10px 12px; }
body.force-mobile.force-mobile-sm .modal-header,
body.force-mobile.force-mobile-sm .modal-body { padding: 14px 12px; }
body.force-mobile.force-mobile-sm .modal-title { font-size: 16px; }
body.force-mobile.force-mobile-sm .bottom-nav { --bottom-nav-height: 58px; }
body.force-mobile.force-mobile-sm .bottom-nav a { padding: 5px 3px 7px; }
body.force-mobile.force-mobile-sm .bottom-nav .nav-label {
    font-size: 9px;
    line-height: 1.2;
    max-width: 100%;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}
body.force-mobile.force-mobile-sm .bottom-nav .nav-icon { width: 20px; height: 20px; }
body.force-mobile.force-mobile-sm .empty-state { padding: 22px 10px; }
body.force-mobile.force-mobile-sm .empty-state svg { width: 40px; height: 40px; }
body.force-mobile.force-mobile-sm .toast { padding: 12px 16px !important; font-size: 14px !important; }
body.force-mobile.force-mobile-sm .tag { font-size: 11px; padding: 3px 8px; }
body.force-mobile.force-mobile-sm .drug-tag { font-size: 11px; padding: 2px 8px; border-radius: 6px; }
body.force-mobile.force-mobile-sm .plan-drugs { gap: 4px; margin-bottom: 8px; }
body.force-mobile.force-mobile-sm .plan-name { font-size: 15.5px; }
body.force-mobile.force-mobile-sm .plan-dates { font-size: 12px; margin-bottom: 8px; }
body.force-mobile.force-mobile-sm .plan-line { font-size: 11.5px; padding: 3px 8px; }

/* 手机预览：强制限制 app-shell 宽度，产生手机屏观感 */
body.force-mobile .app-shell {
    max-width: 400px !important;
    margin: 0 auto !important;
    box-shadow: 0 0 0 1px rgba(64, 169, 255, 0.2), 0 0 60px rgba(0,0,0,0.5);
    min-height: 100vh;
    position: relative;
}
body.force-mobile {
    background: #0a0f1e !important;
}

/* ===== 滚动条 ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: rgba(64, 169, 255, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(64, 169, 255, 0.5);
}

/* ===== 工具类 ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.text-sm { font-size: 13px; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.font-bold { font-weight: 700; }
.full-width { width: 100%; }

/* 数据展示 */
.data-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(64, 169, 255, 0.06);
}

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

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

/* ===== 血检指标：整齐的2列卡片网格 ===== */
.blood-marker-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 16px;
    margin-bottom: 8px;
}
.blood-marker-row {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1.1fr;
    gap: 6px;
    padding: 8px 10px;
    background: rgba(64, 169, 255, 0.03);
    border: 1px solid rgba(64, 169, 255, 0.08);
    border-radius: 6px;
    font-size: 13px;
    align-items: center;
}
.blood-marker-row.abnormal {
    background: rgba(255, 77, 79, 0.06);
    border-color: rgba(255, 77, 79, 0.25);
}
.bm-name {
    display: flex;
    align-items: baseline;
    gap: 4px;
    min-width: 0;
}
.bm-code {
    color: var(--accent-blue);
    font-weight: 600;
    font-size: 12px;
    font-family: 'SF Mono', Consolas, monospace;
    flex-shrink: 0;
}
.bm-title {
    color: var(--text-primary);
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.bm-val {
    font-weight: 600;
    color: #1677ff;
    text-align: right;
    padding-right: 4px;
    white-space: nowrap;
}
.bm-val.val-high {
    color: #e53935;
}
/* 异常（无论偏高/偏低）统一用红色标识 */
.bm-val.val-low {
    color: #e53935;
}
.blood-marker-row:has(.val-low) {
    background: rgba(255, 77, 79, 0.06);
    border-color: rgba(255, 77, 79, 0.25);
}
.bm-unit {
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 400;
    margin-left: 2px;
}
.bm-flag {
    color: #e53935;
    margin-left: 3px;
    font-weight: 700;
}
.bm-flag.bm-flag-high { color: #e53935; }
.bm-flag.bm-flag-low  { color: #e53935; }
.bm-ref {
    text-align: right;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    width: 100%;
}
.bm-warn {
    display: inline-block;
    color: #f59e0b;
    font-weight: 700;
    font-size: 12px;
    padding: 0 4px;
    border: 1px dashed #f59e0b;
    border-radius: 3px;
    line-height: 16px;
    cursor: help;
    flex-shrink: 0;
}
.bm-manual-tag {
    display: inline-block;
    color: var(--accent-cyan);
    background: rgba(20, 184, 166, 0.12);
    border: 1px solid rgba(20, 184, 166, 0.45);
    border-radius: 3px;
    padding: 0 5px;
    font-size: 11px;
    line-height: 16px;
    font-weight: 600;
    cursor: help;
    margin-left: 4px;
    flex-shrink: 0;
}
/* 编辑页里的手动标签位置（label 内） */
.form-label .bm-warn,
.form-label .bm-manual-tag {
    vertical-align: middle;
    margin-left: 4px;
}
@media (max-width: 640px) {
    .blood-marker-grid { grid-template-columns: 1fr; gap: 6px; }
    .blood-marker-row { grid-template-columns: 1.1fr 0.9fr 1fr; padding: 6px 8px; font-size: 12px; }
}

.data-value {
    font-weight: 500;
    text-align: right;
}

/* 趋势箭头 */
.trend-arrow {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 12px;
}

.trend-arrow.up { color: var(--accent-red); }
.trend-arrow.down { color: var(--accent-green); }
.trend-arrow.stable { color: var(--text-muted); }

/* 检验指标趋势表格 */
.marker-tag-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    max-height: 180px;
    max-width: 100%;
    overflow-y: auto;
    padding: 2px;
    /* Android X5/wk 内核兼容：
       窄屏下若 flex-wrap 失效，让整行横向滚动而不是溢出屏幕 */
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
/* flex gap 在部分 X5 内核不支持，用 margin 兜底，避免按钮挤在一起 */
.marker-tag-bar .btn {
    flex: 0 0 auto;
}
.marker-tag-bar .btn + .btn {
    margin-left: 8px;
}
/* 含异常指标的标签标红：未选中 → 红字/红边/淡红底 */
.marker-tag-bar .btn.is-abnormal:not(.btn-primary) {
    color: var(--accent-red);
    border-color: rgba(255, 77, 79, 0.45);
    background: rgba(255, 77, 79, 0.08);
}
.marker-tag-bar .btn.is-abnormal:not(.btn-primary):hover {
    color: var(--accent-red);
    border-color: rgba(255, 77, 79, 0.7);
    background: rgba(255, 77, 79, 0.14);
}
/* 含异常指标且被选中的标签 → 红底白字 */
.marker-tag-bar .btn.btn-primary.is-abnormal {
    background: var(--accent-red);
    box-shadow: 0 2px 8px rgba(255, 77, 79, 0.3);
}
.marker-tag-bar .btn.btn-primary.is-abnormal:hover {
    box-shadow: 0 4px 16px rgba(255, 77, 79, 0.5);
    transform: translateY(-1px);
}
.trend-count {
    display: inline-block;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    margin-left: 4px;
    padding: 0 4px;
    border-radius: 999px;
    font-size: 11px;
    background: rgba(64, 169, 255, 0.25);
    color: var(--accent-blue, #40a9ff);
}
.btn-primary .trend-count {
    background: rgba(255, 255, 255, 0.3);
    color: #fff;
}
.trend-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.trend-table th {
    text-align: left;
    padding: 10px 12px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 12px;
    border-bottom: 1px solid rgba(64, 169, 255, 0.12);
    white-space: nowrap;
}
.trend-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(64, 169, 255, 0.06);
    white-space: nowrap;
}
.trend-table tr:last-child td {
    border-bottom: none;
}

/* ===== 登录/注册页面 ===== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(160deg, #0a1628 0%, #0d2444 50%, #0a1628 100%);
}
.auth-card {
    width: 100%;
    max-width: 380px;
    background: var(--bg-card);
    border-radius: 20px;
    padding: 32px 28px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(64, 169, 255, 0.1);
}
.auth-logo {
    text-align: center;
    margin-bottom: 24px;
}
.auth-logo .logo-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 12px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}
.auth-logo .logo-icon svg { width: 28px; height: 28px; }
.auth-logo h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.auth-subtitle {
    font-size: 13px;
    color: var(--text-muted);
}
.auth-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    background: var(--bg-secondary);
    border-radius: 10px;
    padding: 3px;
}
.auth-tabs button {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}
.auth-tabs button.active {
    background: var(--accent-blue);
    color: #fff;
}
.auth-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 16px;
    line-height: 1.5;
}
.auth-error {
    color: var(--accent-red);
    font-size: 13px;
    text-align: center;
    margin-top: 12px;
}
.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    color: var(--text-muted);
}
.auth-footer a {
    color: var(--accent-blue);
    cursor: pointer;
    font-weight: 500;
}
.btn-block {
    width: 100%;
}

/* ===== 复查提醒横幅（Dashboard + FollowUps） ===== */
.reminder-banner {
    border: 1px solid rgba(250, 140, 22, 0.3);
    background: rgba(250, 140, 22, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: transform 0.2s, box-shadow 0.2s;
}
.reminder-banner:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.08); }
.reminder-banner.reminder-overdue {
    border-color: rgba(255, 77, 79, 0.35);
    background: rgba(255, 77, 79, 0.1);
}
.reminder-banner.reminder-today {
    border-color: rgba(255, 77, 79, 0.3);
    background: rgba(255, 159, 67, 0.1);
}
.reminder-banner.reminder-soon {
    border-color: rgba(64, 169, 255, 0.3);
    background: rgba(64, 169, 255, 0.08);
}
.reminder-icon {
    width: 44px; height: 44px; min-width: 44px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(250, 140, 22, 0.15);
    color: var(--accent-orange);
}
.reminder-icon svg { width: 22px; height: 22px; }
.reminder-overdue .reminder-icon { background: rgba(255,77,79,0.18); color: var(--accent-red); }
.reminder-today .reminder-icon   { background: rgba(255,159,67,0.18); color: var(--accent-orange); }
.reminder-soon .reminder-icon    { background: rgba(64,169,255,0.18); color: var(--accent-primary); }
.reminder-title {
    font-size: 15px; font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}
.reminder-sub, .reminder-more {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.7;
}
.reminder-more { margin-top: 4px; color: var(--text-muted); font-style: italic; }
.reminder-action {
    font-size: 13px;
    font-weight: 500;
    color: var(--accent-primary);
    white-space: nowrap;
    padding: 6px 12px;
    border-radius: 8px;
    background: rgba(64, 169, 255, 0.1);
}
.reminder-overdue .reminder-action { color: var(--accent-red); background: rgba(255,77,79,0.1); }
.reminder-today .reminder-action   { color: var(--accent-orange); background: rgba(250,140,22,0.12); }

/* ===== 手机端登录/注册页面适配 ===== */
@media (max-width: 600px) {
    .auth-page {
        padding: 16px 12px;
        align-items: flex-start;
        padding-top: calc(40px + env(safe-area-inset-top, 0));
        padding-bottom: calc(20px + env(safe-area-inset-bottom, 0));
    }
    .auth-card {
        max-width: 100%;
        width: 100%;
        padding: 28px 20px 24px;
        border-radius: 16px;
        box-shadow: 0 6px 30px rgba(0, 0, 0, 0.35);
    }
    .auth-logo {
        margin-bottom: 20px;
    }
    .auth-logo .logo-icon {
        width: 52px;
        height: 52px;
        border-radius: 14px;
        margin-bottom: 10px;
    }
    .auth-logo .logo-icon svg { width: 26px; height: 26px; }
    .auth-logo h1 {
        font-size: 20px;
        margin-bottom: 3px;
    }
    .auth-subtitle {
        font-size: 12.5px;
    }
    .auth-tabs {
        margin-bottom: 20px;
        border-radius: 9px;
        padding: 3px;
    }
    .auth-tabs button {
        padding: 11px 8px;
        font-size: 15px;
        min-height: 42px;
        border-radius: 7px;
    }

    /* 关键：登录/注册表单元素放大，方便触屏操作 */
    .auth-card .form-group {
        margin-bottom: 18px;
    }
    .auth-card .form-label {
        font-size: 14px;
        margin-bottom: 8px;
    }
    .auth-card .form-input,
    .auth-card .form-select,
    .auth-card .form-textarea {
        min-height: 50px;           /* 手机端输入框高度放大到50px */
        padding: 13px 16px;          /* 内边距更宽 */
        font-size: 16px;             /* 防止iOS自动缩放 */
        border-radius: 10px;
    }
    .auth-card input::placeholder {
        font-size: 15px;
    }

    /* 提示文字略大，方便阅读 */
    .auth-hint {
        font-size: 12.5px;
        line-height: 1.6;
        margin-bottom: 14px;
    }

    /* 提交按钮也放大 */
    .auth-card .btn-block,
    .auth-card form button[type="submit"] {
        min-height: 50px;
        font-size: 16px;
        padding: 13px 16px;
        border-radius: 10px;
        font-weight: 600;
    }

    .auth-footer {
        margin-top: 22px;
        font-size: 13.5px;
    }
    .auth-error {
        margin-top: 14px;
        font-size: 13px;
    }
}

/* 极限小屏（480px及以下） */
@media (max-width: 480px) {
    .auth-card {
        padding: 24px 16px 20px;
        border-radius: 14px;
    }
    .auth-card .form-input,
    .auth-card .form-select {
        min-height: 48px;
        padding: 12px 14px;
        font-size: 16px;
    }
    .auth-card form button[type="submit"],
    .auth-card .btn-block {
        min-height: 48px;
        font-size: 16px;
    }
    .auth-tabs button {
        font-size: 14.5px;
        min-height: 40px;
    }
}

/* force-mobile 镜像（调试时桌面端模拟手机显示）*/
body.force-mobile .auth-page { padding: 16px 12px; align-items: flex-start; padding-top: calc(40px + env(safe-area-inset-top, 0)); padding-bottom: calc(20px + env(safe-area-inset-bottom, 0)); }
body.force-mobile .auth-card { max-width: 100%; width: 100%; padding: 28px 20px 24px; border-radius: 16px; }
body.force-mobile .auth-card .form-group { margin-bottom: 18px; }
body.force-mobile .auth-card .form-label { font-size: 14px; margin-bottom: 8px; }
body.force-mobile .auth-card .form-input,
body.force-mobile .auth-card .form-select,
body.force-mobile .auth-card .form-textarea { min-height: 50px !important; padding: 13px 16px !important; font-size: 16px !important; border-radius: 10px; }
body.force-mobile .auth-card input::placeholder { font-size: 15px; }
body.force-mobile .auth-card .btn-block,
body.force-mobile .auth-card form button[type="submit"] { min-height: 50px; font-size: 16px; padding: 13px 16px; border-radius: 10px; font-weight: 600; }
body.force-mobile .auth-tabs button { padding: 11px 8px; font-size: 15px; min-height: 42px; border-radius: 7px; }

/* ===== 管理员页面：激活码管理 ===== */
.admin-page { max-width: 960px; margin: 0 auto; padding: 8px 0 32px; }
.admin-page .page-header { margin-bottom: 20px; }
.admin-page .page-header h2 { font-size: 20px; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; }
.admin-page .page-sub { font-size: 13px; color: var(--text-muted); line-height: 1.5; }
.admin-page .card { margin-bottom: 20px; }
.admin-page .card-title { margin-bottom: 16px; }
.admin-form { display: flex; flex-direction: column; gap: 14px; }
.card-title-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-title-row .card-title { margin-bottom: 0; }
.gen-result { margin-top: 18px; padding: 14px; background: var(--bg-secondary); border-radius: 10px; border: 1px dashed rgba(64,169,255,0.3); }
.gen-result-title { font-size: 13px; color: var(--accent-cyan); margin-bottom: 10px; }
.code-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.code-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--bg-card); border: 1px solid rgba(64,169,255,0.3); color: var(--accent-blue); font-family: 'Courier New', monospace; font-size: 15px; font-weight: 700; letter-spacing: 1px; padding: 8px 12px; border-radius: 8px; cursor: pointer; }
.code-chip:hover { background: rgba(64,169,255,0.1); }
.copied-tag { font-size: 11px; color: var(--accent-green); font-weight: 400; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 640px; }
.data-table th { text-align: left; padding: 10px 8px; color: var(--text-muted); font-weight: 500; border-bottom: 1px solid rgba(255,255,255,0.08); white-space: nowrap; }
.data-table td { padding: 10px 8px; border-bottom: 1px solid rgba(255,255,255,0.05); color: var(--text-primary); vertical-align: middle; }
.data-table tr:hover td { background: rgba(255,255,255,0.02); }
.code-cell { font-family: 'Courier New', monospace; font-weight: 700; color: var(--accent-blue); letter-spacing: 1px; cursor: pointer; }
.time-cell { color: var(--text-muted); white-space: nowrap; }
.action-cell { white-space: nowrap; }
.action-cell .btn + .btn { margin-left: 4px; }
.empty-row { text-align: center; color: var(--text-muted); padding: 24px 8px; }
@media (max-width: 768px) {
  .admin-page .form-row { flex-direction: column; }
  .admin-page { padding: 4px 0 20px; }
  .data-table { font-size: 12px; }
}

/* ===== 管理员专属登录页（橙色调，与用户登录页区分）===== */
.admin-auth { background: linear-gradient(160deg, #0a1628 0%, #2a1a08 50%, #0a1628 100%); }
.admin-auth-card { border-color: rgba(250, 140, 22, 0.3); box-shadow: 0 8px 40px rgba(250, 140, 22, 0.12); }
.admin-logo-icon { background: linear-gradient(135deg, #fa8c16, #faad14); }
.admin-auth-card h1 { color: #ffd591; }
.admin-auth-card .auth-subtitle { color: #d4884e; }
.admin-auth-card .btn-primary { background: linear-gradient(135deg, #fa8c16, #faad14); }
.admin-auth-card .btn-primary:hover { filter: brightness(1.08); }
.admin-auth-card .auth-footer a { color: #faad14; }

/* ===== 管理员 Tab 切换 ===== */
.admin-tabs { display: flex; gap: 4px; margin-bottom: 20px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.admin-tab { padding: 10px 20px; font-size: 14px; color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; transition: all 0.2s; }
.admin-tab:hover { color: var(--text-primary); }
.admin-tab.active { color: var(--accent-blue); border-bottom-color: var(--accent-blue); font-weight: 600; }
.admin-tab-content { min-height: 200px; }

/* ===== 统计卡片 ===== */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat-card { background: var(--bg-card); border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; padding: 20px 16px; text-align: center; }
.stat-num { font-size: 28px; font-weight: 700; color: var(--text-primary); }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.stat-card.stat-accent .stat-num { color: var(--accent-cyan); }
.stat-card.stat-code .stat-num { color: var(--accent-orange, #fa8c16); }
.stat-card.stat-code-active .stat-num { color: var(--accent-green); }

/* ===== 用户列表 ===== */
.user-cell { display: flex; flex-direction: column; gap: 2px; }
.user-email { font-weight: 600; color: var(--text-primary); }
.user-name { font-size: 12px; color: var(--text-muted); }

/* ===== 标签颜色 ===== */
.tag-warning { background: rgba(250,140,22,0.15); color: #fa8c16; }
.tag-info { background: rgba(64,169,255,0.15); color: var(--accent-blue); }
.btn-danger { background: #ff4d4f; color: #fff; }
.btn-success { background: #52c41a; color: #fff; }

/* ===== 用户详情弹窗 ===== */
.modal-wide { max-width: 880px; max-height: 90vh; }
.detail-section { margin-bottom: 24px; }
.detail-title { font-size: 15px; font-weight: 600; color: var(--text-primary); margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,0.08); display: flex; align-items: center; gap: 8px; }
.sensitive-tag { font-size: 11px; background: rgba(250,140,22,0.15); color: #fa8c16; padding: 2px 8px; border-radius: 4px; font-weight: 400; }
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 20px; font-size: 13px; }
.detail-grid > div { display: flex; flex-direction: column; gap: 2px; }
.detail-full { grid-column: 1 / -1; }
.detail-label { font-size: 11px; color: var(--text-muted); }
.sensitive-data { color: var(--accent-orange, #fa8c16); font-family: 'Courier New', monospace; font-weight: 600; }
.detail-list { display: flex; flex-direction: column; gap: 10px; }
.detail-item { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06); border-radius: 8px; padding: 12px 14px; }
.detail-item-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.detail-item-title { font-weight: 600; color: var(--text-primary); }
.detail-item-date { color: var(--text-muted); font-size: 12px; margin-left: auto; }
.detail-item-body { font-size: 13px; color: var(--text-secondary); margin-bottom: 4px; line-height: 1.5; }
.detail-item-meta { font-size: 12px; color: var(--text-muted); }
.empty-hint { text-align: center; color: var(--text-muted); padding: 16px; font-size: 13px; }
.loading-tip { text-align: center; padding: 40px; color: var(--text-muted); }

/* ===== 管理员头部（简化版） ===== */
.admin-header { background: linear-gradient(135deg, #0a1628 0%, #1a2a4a 100%); border-bottom: 2px solid rgba(64,169,255,0.3); }
.admin-header .logo-title { color: #faad14; font-weight: 700; }
.admin-logo-icon { background: rgba(250,173,20,0.15); color: #faad14; }

/* ===== 用户详情页 ===== */
.detail-page { padding: 20px 24px; }
.detail-page-header { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.detail-page-title { font-size: 16px; font-weight: 600; color: var(--text-primary); flex: 1; margin: 0; }
.detail-page-actions { display: flex; gap: 8px; }
.btn-back { display: inline-flex; align-items: center; gap: 4px; background: rgba(255,255,255,0.08); color: var(--text-primary); border: 1px solid rgba(255,255,255,0.12); }
.btn-back:hover { background: rgba(255,255,255,0.12); }
.detail-page-content { padding-top: 4px; }

/* ===== 分享功能样式 ===== */
.share-new { border: 1px solid rgba(82,196,26,0.3); background: rgba(82,196,26,0.08); }
.share-new-header { display: flex; align-items: center; gap: 8px; color: #52c41a; font-weight: 600; margin-bottom: 12px; }
.share-url-row { display: flex; gap: 8px; align-items: center; background: rgba(0,0,0,0.3); border-radius: 6px; padding: 8px 12px; margin-bottom: 8px; }
.share-url-row.small { padding: 6px 10px; }
.share-url { flex: 1; font-size: 13px; color: var(--accent-cyan); word-break: break-all; background: none; }
.share-meta { font-size: 13px; color: var(--text-secondary); }
.share-list { display: flex; flex-direction: column; gap: 10px; }
.share-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; background: rgba(255,255,255,0.04); border-radius: 8px; border: 1px solid rgba(255,255,255,0.06); }
.share-item.expired { opacity: 0.55; }
.share-item-info { flex: 1; min-width: 0; }
.share-item-meta { display: flex; gap: 12px; align-items: center; margin-top: 6px; font-size: 13px; color: var(--text-secondary); }
.share-tip { display: flex; gap: 8px; align-items: flex-start; padding: 12px; background: rgba(250,173,20,0.08); border: 1px solid rgba(250,173,20,0.25); border-radius: 8px; color: var(--text-secondary); font-size: 13px; margin-top: 8px; }

/* 公开分享查看页 */
.share-view { min-height: 100vh; background: var(--bg-primary); }
.share-content { max-width: 900px; margin: 0 auto; padding: 24px 20px 60px; }
.share-header { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.share-badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; background: rgba(64,169,255,0.15); color: var(--accent-cyan); border-radius: 12px; font-size: 13px; }
.share-expire { font-size: 13px; color: var(--text-secondary); }
.share-info-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 16px; margin-top: 12px; }
.share-info-grid > div { display: flex; gap: 8px; font-size: 13px; }
.share-info-grid > div.col-2 { grid-column: span 2; }
.share-info-grid span:first-child { color: var(--text-secondary); min-width: 80px; }
.share-item-block { padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.04); }
.share-item-block:last-child { border-bottom: none; }
.share-item-title { display: flex; gap: 8px; align-items: center; font-weight: 500; margin-bottom: 4px; }
.share-item-desc { font-size: 13px; color: var(--text-secondary); }
.share-indicators { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.indicator-tag { padding: 3px 8px; background: rgba(64,169,255,0.1); color: var(--accent-cyan); border-radius: 4px; font-size: 12px; }
.share-footer { text-align: center; padding-top: 24px; font-size: 12px; color: var(--text-muted); }
.share-error { text-align: center; padding: 80px 20px; }
.share-error h3 { margin: 16px 0 8px; color: var(--text-primary); }
.share-error p { color: var(--text-secondary); margin-bottom: 16px; }
.loading-state { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 300px; gap: 16px; color: var(--text-secondary); }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-grid { grid-template-columns: 1fr; }
  .admin-tab { padding: 8px 14px; font-size: 13px; }
  .modal-wide { max-height: 94vh; }
  .detail-page-header { flex-wrap: wrap; gap: 10px; }
  .detail-page-title { flex-basis: 100%; }
  .share-info-grid { grid-template-columns: 1fr; }
  .share-info-grid > div.col-2 { grid-column: span 1; }
  .share-item { flex-direction: column; align-items: stretch; }
}
