/* ========== 全局 & 主题变量 ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root, :root[data-theme="light"] {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #818cf8;
    --accent: #0ea5e9;
    --accent2: #ec4899;
    --bg-body: #f8fafc;
    --bg-panel: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-card-hover: #f1f5f9;
    --bg-input: #f8fafc;
    --bg-input-focus: #ffffff;
    --text: #334155;
    --text-dim: #64748b;
    --text-bright: #0f172a;
    --border: rgba(0, 0, 0, 0.08);
    --danger: #ef4444;
    --danger-bg: #fef2f2;
    --danger-border: #fca5a5;
    --success: #10b981;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --radius: 12px;
    --radius-sm: 8px;
    --blob-1: rgba(99, 102, 241, 0.15);
    --blob-2: rgba(236, 72, 153, 0.15);
    --blob-3: rgba(14, 165, 233, 0.15);
    --sl-track: #94a3b8;
    --sl-bg: #f1f5f9;
    --sl-fill: #e0e7ff;
    --item-active-bg: linear-gradient(135deg, #e0e7ff, #f3f4f6);
    --item-active-border: #c7d2fe;
    --btn-copy-bg: #f0f9ff;
    --btn-copy-border: #bae6fd;
    --record-content-bg: #f8fafc;
    --grid-color: #cbd5e1;
    --modal-overlay: rgba(0, 0, 0, 0.4);
    --glass-border: rgba(0, 0, 0, 0.05);
}

:root[data-theme="dark"] {
    --primary: #6c5ce7;
    --primary-dark: #5a4bd1;
    --primary-light: #a29bfe;
    --accent: #00cec9;
    --accent2: #fd79a8;
    --bg-body: #0c0c1d;
    --bg-panel: rgba(15, 15, 35, 0.95);
    --bg-card: rgba(20, 20, 50, 0.8);
    --bg-card-hover: rgba(30, 30, 60, 0.9);
    --bg-input: rgba(255, 255, 255, 0.06);
    --bg-input-focus: rgba(108, 92, 231, 0.08);
    --text: #e0e0e0;
    --text-dim: #888888;
    --text-bright: #ffffff;
    --border: rgba(255, 255, 255, 0.08);
    --danger: #e74c3c;
    --danger-bg: rgba(231, 76, 60, 0.15);
    --danger-border: rgba(231, 76, 60, 0.3);
    --success: #00b894;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5);
    --radius: 16px;
    --radius-sm: 8px;
    --blob-1: rgba(108, 92, 231, 0.15);
    --blob-2: rgba(253, 121, 168, 0.1);
    --blob-3: rgba(0, 206, 201, 0.1);
    --sl-track: rgba(255,255,255,0.25);
    --sl-bg: rgba(255,255,255,0.06);
    --sl-fill: linear-gradient(90deg, rgba(108,92,231,0.3), rgba(108,92,231,0.15));
    --item-active-bg: rgba(108, 92, 231, 0.15);
    --item-active-border: rgba(108, 92, 231, 0.3);
    --btn-copy-bg: rgba(0, 206, 201, 0.1);
    --btn-copy-border: rgba(0, 206, 201, 0.2);
    --record-content-bg: rgba(0, 0, 0, 0.3);
    --grid-color: rgba(255, 255, 255, 0.03);
    --modal-overlay: rgba(0, 0, 0, 0.6);
    --glass-border: rgba(108, 92, 231, 0.2);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    color: var(--text);
    overflow-x: hidden;
    background-color: var(--bg-body);
    transition: background-color 0.4s ease, color 0.4s ease;
}
.admin-body { overflow: hidden; }

/* ========== 丰富背景元素 ========== */
.bg-blobs {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    overflow: hidden; z-index: 0; pointer-events: none;
}
.blob {
    position: absolute; filter: blur(80px); border-radius: 50%;
    animation: float 20s infinite ease-in-out alternate; opacity: 0.8;
}
.blob-1 { background: var(--blob-1); width: 45vw; height: 45vw; top: -15vh; left: -15vw; }
.blob-2 { background: var(--blob-2); width: 35vw; height: 35vw; bottom: -10vh; right: -10vw; animation-delay: -5s; }
.blob-3 { background: var(--blob-3); width: 55vw; height: 55vw; top: 40%; left: 50%; transform: translate(-50%, -50%); animation-delay: -10s; }

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -50px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
    100% { transform: translate(0, 0) scale(1); }
}

.grid-bg {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-image: radial-gradient(var(--grid-color) 1px, transparent 1px);
    background-size: 24px 24px; z-index: 0; pointer-events: none;
}

#particles {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 0; pointer-events: none; display: none; opacity: 0.6;
}
[data-theme="dark"] #particles { display: block; }

/* ========== 主题切换按钮 ========== */
.theme-toggle-btn {
    position: fixed; top: 24px; right: 24px;
    width: 44px; height: 44px; border-radius: 50%;
    background: var(--bg-panel); border: 1px solid var(--border);
    color: var(--text-bright); display: flex; align-items: center; justify-content: center;
    cursor: pointer; z-index: 1000; box-shadow: var(--shadow);
    transition: all 0.3s;
}
.theme-toggle-btn:hover { transform: scale(1.1) rotate(15deg); box-shadow: var(--shadow-lg); }

/* ========== 登录页：双列布局 ========== */
.login-body {
    min-height: 100vh; position: relative;
}

.login-layout {
    position: relative; z-index: 1;
    display: grid; grid-template-columns: 1fr 1fr;
    min-height: 100vh; gap: 0;
}

/* ---------- 左侧角色面板 ---------- */
.characters-panel {
    position: relative; overflow: hidden;
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 50%, #4b5563 100%);
    color: #fff;
    display: flex; flex-direction: column;
    justify-content: space-between;
    padding: 48px;
}
[data-theme="dark"] .characters-panel {
    background: linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.8) 50%, rgba(255,255,255,0.7) 100%);
    color: #111827;
}

/* 装饰：网格背景 + 两个模糊圆环 */
.characters-panel::before {
    content: ''; position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
}
.panel-blob-1, .panel-blob-2 {
    position: absolute; border-radius: 50%;
    pointer-events: none; filter: blur(60px);
}
.panel-blob-1 {
    width: 256px; height: 256px;
    top: 25%; right: 25%;
    background: rgba(156, 163, 175, 0.2);
}
.panel-blob-2 {
    width: 384px; height: 384px;
    bottom: 25%; left: 25%;
    background: rgba(209, 213, 219, 0.2);
}
[data-theme="dark"] .panel-blob-1 { background: rgba(209, 213, 219, 0.3); }
[data-theme="dark"] .panel-blob-2 { background: rgba(229, 231, 235, 0.2); }

/* 品牌顶部 */
.brand-top {
    position: relative; z-index: 20;
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 18px; font-weight: 600;
    color: inherit;
    align-self: flex-start;
    background: none; border: none; padding: 0;
}
.brand-top-icon {
    width: 32px; height: 32px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    color: inherit;
}

/* 角色包装层 - 500px 高度，flex items-end justify-center（对齐 21st.dev 原始布局）*/
.characters-wrapper {
    position: relative; z-index: 20;
    height: 500px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

/* 角色舌台 - 550x400 固定尺寸，在包装层中底部居中 */
.characters-stage {
    position: relative;
    width: 550px; height: 400px;
}

.character {
    position: absolute; bottom: 0;
    transform-origin: bottom center;
    transition: transform 0.3s ease-out, height 0.3s ease-out;
}

/* 紫色 - 后排 */
.char-purple {
    left: 70px;
    width: 180px; height: 400px;
    background: #6C3FF5;
    border-radius: 10px 10px 0 0;
    z-index: 1;
}
/* 黑色 - 中间 */
.char-black {
    left: 240px;
    width: 120px; height: 310px;
    background: #2D2D2D;
    border-radius: 8px 8px 0 0;
    z-index: 2;
}
/* 橙色 - 前排左，半圆圆顶 */
.char-orange {
    left: 0;
    width: 240px; height: 200px;
    background: #FF9B6B;
    border-radius: 120px 120px 0 0;
    z-index: 3;
}
/* 黄色 - 前排右，圆顶高柱 */
.char-yellow {
    left: 310px;
    width: 140px; height: 230px;
    background: #E8D754;
    border-radius: 70px 70px 0 0;
    z-index: 4;
}

/* 眼睛组（位置由 JS 设置 left/top） */
.eyes {
    position: absolute;
    display: flex;
    transition: left 0.15s ease-out, top 0.15s ease-out;
}
.char-purple .eyes { gap: 32px; }
.char-black .eyes { gap: 24px; }
.char-orange .eyes { gap: 32px; }
.char-yellow .eyes { gap: 24px; }

.eye {
    border-radius: 50%;
    background: #fff;
    overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    transition: height 0.15s ease;
}
.eye-purple { width: 18px; height: 18px; }
.eye-black { width: 16px; height: 16px; }
.eye.blink { height: 2px !important; }
.eye .pupil { transition: transform 0.05s linear; }
.eye.blink .pupil { display: none; }

.pupil {
    border-radius: 50%;
    background: #2D2D2D;
    transition: transform 0.05s linear;
}
.eye-purple .pupil { width: 7px; height: 7px; }
.eye-black .pupil { width: 6px; height: 6px; }
.pupil-bare { width: 12px; height: 12px; }

/* 黄色角色的嘴巴 */
.char-yellow .mouth {
    position: absolute;
    width: 80px; height: 4px;
    background: #2D2D2D;
    border-radius: 9999px;
    transition: left 0.2s ease-out, top 0.2s ease-out;
}

/* 面板底部占位符：代替原 Footer 链接，高度对齐 21st.dev 原 Footer 文本高 (~22px) */
.brand-bottom-spacer {
    height: 22px;
    flex-shrink: 0;
    pointer-events: none;
}

/* ---------- 右侧登录卡 ---------- */
.login-container {
    position: relative; z-index: 1; padding: 40px;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-body);
}

.login-card {
    width: 100%; max-width: 380px;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    animation: cardIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.form-header { text-align: center; margin-bottom: 32px; }
.form-header h1 {
    font-size: 30px; font-weight: 800; color: var(--text-bright);
    letter-spacing: -0.5px; margin-bottom: 8px;
}
.form-header .subtitle { font-size: 14px; color: var(--text-dim); }

/* 密码输入框 + 眼睛切换 */
.password-wrapper { position: relative; }
.password-wrapper input { padding-right: 44px !important; }
.pwd-toggle {
    position: absolute; right: 12px; top: 50%;
    transform: translateY(-50%);
    background: none; border: none; cursor: pointer;
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-dim);
    border-radius: 6px;
    transition: all 0.2s;
}
.pwd-toggle:hover { color: var(--text-bright); background: var(--bg-card-hover); }

/* 记住我 + 忘记密码 */
.form-row {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 20px;
}
.checkbox {
    display: inline-flex; align-items: center; gap: 8px;
    cursor: pointer; user-select: none;
}
.checkbox input { position: absolute; opacity: 0; pointer-events: none; }
.check-box {
    width: 16px; height: 16px;
    border: 1.5px solid var(--border);
    border-radius: 4px;
    background: var(--bg-input);
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s;
    flex-shrink: 0;
}
.checkbox input:checked + .check-box {
    background: var(--text-bright);
    border-color: var(--text-bright);
}
.checkbox input:checked + .check-box::after {
    content: '';
    width: 4px; height: 8px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) translate(-1px, -1px);
}
.check-text { font-size: 13px; color: var(--text); }
.forgot-link { font-size: 13px; color: var(--text-bright); text-decoration: none; font-weight: 600; }
.forgot-link:hover { text-decoration: underline; }

/* 主登录按钮 - 黑色 */
.login-btn-main {
    width: 100%; padding: 12px;
    background: var(--text-bright);
    color: var(--bg-body);
    border: none; border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 600;
    cursor: pointer; transition: all 0.2s;
    letter-spacing: 1px;
    box-shadow: none;
}
.login-btn-main:hover { opacity: 0.85; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.login-btn-main:active { transform: translateY(0); }
.login-btn-main:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
[data-theme="dark"] .login-btn-main { background: #fff; color: #0c0c1d; }
[data-theme="dark"] .login-btn-main:hover { box-shadow: 0 4px 16px rgba(255,255,255,0.15); }

/* Google 登录按钮 */
.login-btn-google {
    width: 100%; padding: 11px;
    background: var(--bg-panel);
    color: var(--text-bright);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 600;
    cursor: pointer; transition: all 0.2s;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    margin-top: 12px;
}
.login-btn-google:hover { background: var(--bg-card-hover); border-color: var(--text-dim); }

.signup-text {
    text-align: center; font-size: 13px;
    color: var(--text-dim); margin-top: 24px;
}
.signup-text a { color: var(--text-bright); font-weight: 700; text-decoration: none; }
.signup-text a:hover { text-decoration: underline; }

/* 表单输入框调整 - 医院主题适配 */
.login-card .input-group { margin-bottom: 18px; }
.login-card .input-group label {
    font-size: 13px; font-weight: 600;
    color: var(--text-bright);
    margin-bottom: 6px;
}
.login-card .input-group input {
    width: 100%; padding: 11px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-bright);
    font-size: 14px; transition: all 0.2s; outline: none;
}
.login-card .input-group input:focus {
    border-color: var(--text-bright);
    background: var(--bg-input-focus);
    box-shadow: 0 0 0 3px rgba(0,0,0,0.04);
}
[data-theme="dark"] .login-card .input-group input:focus {
    box-shadow: 0 0 0 3px rgba(255,255,255,0.1);
}

/* 响应式 */
@media (max-width: 960px) {
    .login-layout { grid-template-columns: 1fr; }
    .characters-panel { display: none; }
    .login-container { padding: 24px; min-height: 100vh; }
}
@media (max-width: 480px) {
    .login-container { padding: 16px; }
}

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

.login-header { text-align: center; margin-bottom: 32px; }

.logo-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 64px; height: 64px; border-radius: 18px;
    background: linear-gradient(135deg, var(--primary), var(--accent2));
    color: white; margin-bottom: 16px;
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.25);
    transform: rotate(-5deg); transition: transform 0.3s;
}
.login-card:hover .logo-icon { transform: rotate(0deg) scale(1.05); }
[data-theme="dark"] .logo-icon { box-shadow: 0 4px 20px rgba(108, 92, 231, 0.4); background: linear-gradient(135deg, var(--primary), var(--accent)); }

.login-header h1 {
    font-size: 26px; font-weight: 800; color: var(--text-bright);
    letter-spacing: 0.5px;
}
[data-theme="light"] .login-header h1 {
    background: linear-gradient(135deg, #1e293b, #4f46e5);
    background-clip: text; -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

.subtitle { color: var(--text-dim); font-size: 14px; margin-top: 4px; }

.input-group { margin-bottom: 20px; }
.input-group label { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 6px; font-weight: 500; }

.input-wrapper { position: relative; display: flex; align-items: center; }
.input-icon { position: absolute; left: 14px; color: var(--text-dim); pointer-events: none; }

.input-wrapper input, .input-group input {
    width: 100%; padding: 12px 14px 12px 42px;
    background: var(--bg-input); border: 1px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text-bright);
    font-size: 14px; transition: all 0.3s; outline: none;
}
.input-group > input { padding-left: 14px; }
.input-wrapper input:focus, .input-group input:focus {
    border-color: var(--primary); background: var(--bg-input-focus);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}
.input-wrapper input::placeholder { color: var(--text-dim); opacity: 0.5; }

.error-msg {
    background: var(--danger-bg); border: 1px solid var(--danger-border);
    color: var(--danger); padding: 10px 14px; border-radius: var(--radius-sm);
    font-size: 13px; margin-bottom: 16px; animation: shake 0.4s ease;
}
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

.login-btn {
    width: 100%; padding: 13px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white; border: none; border-radius: var(--radius-sm);
    font-size: 15px; font-weight: 600; cursor: pointer; transition: all 0.3s;
    letter-spacing: 2px; position: relative; overflow: hidden;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}
.login-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35); }
[data-theme="dark"] .login-btn { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); box-shadow: none; }
[data-theme="dark"] .login-btn:hover { box-shadow: 0 6px 20px rgba(108, 92, 231, 0.4); transform: translateY(-1px); }
.login-btn:active { transform: translateY(0); }
.login-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* ========== 管理页布局 ========== */
.admin-body { height: 100vh; }
.admin-layout { display: flex; height: 100vh; position: relative; z-index: 1; }

/* ========== 侧边栏 ========== */
.sidebar {
    width: 300px; min-width: 300px;
    background: var(--bg-panel); backdrop-filter: blur(20px);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column; overflow: hidden;
}
.sidebar-header { display: flex; align-items: center; gap: 10px; padding: 20px; border-bottom: 1px solid var(--border); }

.sidebar-title { font-size: 18px; font-weight: 700; color: var(--text-bright); }
.sidebar-search { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.sidebar-search input {
    width: 100%; padding: 10px 14px; background: var(--bg-input);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    color: var(--text-bright); font-size: 13px; outline: none; transition: all 0.3s;
}
.sidebar-search input:focus { border-color: var(--primary); background: var(--bg-input-focus); box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1); }
.sidebar-search input::placeholder { color: var(--text-dim); opacity: 0.5; }

.kami-stats { padding: 10px 16px; font-size: 12px; color: var(--text-dim); border-bottom: 1px solid var(--border); }
.kami-stats strong { color: var(--primary); }

.kami-list { flex: 1; overflow-y: auto; padding: 8px; }
.kami-list::-webkit-scrollbar { width: 4px; }
.kami-list::-webkit-scrollbar-track { background: transparent; }
.kami-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.kami-item {
    padding: 12px 14px; margin-bottom: 4px; border-radius: var(--radius-sm);
    cursor: pointer; transition: all 0.2s; border: 1px solid transparent;
}
.kami-item:hover { background: var(--bg-card-hover); border-color: var(--border); }
.kami-item.active { background: var(--item-active-bg); border-color: var(--item-active-border); box-shadow: 0 2px 6px rgba(79, 70, 229, 0.08); }
[data-theme="dark"] .kami-item.active { box-shadow: none; }

.kami-item .kami-text { font-size: 13px; color: var(--text-bright); font-family: 'Consolas', 'Monaco', monospace; word-break: break-all; line-height: 1.4; }
.kami-item .kami-meta { display: flex; justify-content: space-between; margin-top: 6px; font-size: 11px; color: var(--text-dim); }
.kami-item .kami-badge { background: var(--primary); color: white; padding: 1px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; }
[data-theme="dark"] .kami-item .kami-badge { background: linear-gradient(135deg, var(--primary), var(--accent)); }

.sidebar-footer { padding: 12px 16px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }
.btn-icon { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: var(--radius-sm); background: var(--bg-card); border: 1px solid var(--border); color: var(--text-dim); cursor: pointer; transition: all 0.2s; }
.btn-icon:hover { background: var(--bg-card-hover); color: var(--text-bright); border-color: var(--primary); }
.loading-placeholder { text-align: center; padding: 30px; color: var(--text-dim); font-size: 13px; }

/* ========== 主内容区 ========== */
.main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; position: relative; z-index: 1; }
.content-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 28px; border-bottom: 1px solid var(--border); background: var(--bg-panel); backdrop-filter: blur(10px); }
.content-header h2 { font-size: 18px; font-weight: 600; color: var(--text-bright); }

.content-body { flex: 1; overflow-y: auto; padding: 24px 28px; }
.content-body::-webkit-scrollbar { width: 6px; }
.content-body::-webkit-scrollbar-track { background: transparent; }
.content-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; color: var(--text-dim); gap: 16px; }
.empty-state svg { opacity: 0.3; }
.empty-state p { font-size: 15px; }

/* ========== 记录卡片 ========== */
.record-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-left: 4px solid var(--primary-light);
    border-radius: var(--radius); padding: 20px; margin-bottom: 16px;
    transition: all 0.3s; animation: fadeIn 0.3s ease; position: relative;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.record-card:hover { border-color: var(--border); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); }
[data-theme="dark"] .record-card:hover { border-color: rgba(108, 92, 231, 0.2); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2); }

.record-time { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--accent); margin-bottom: 12px; font-weight: 500; }
.record-time svg { opacity: 0.7; }
.record-content {
    background: var(--record-content-bg); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 14px; font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px; line-height: 1.6; color: var(--text-bright); word-break: break-all; white-space: pre-wrap;
}
.record-actions { display: flex; gap: 8px; margin-top: 12px; justify-content: flex-end; }

/* ========== 按钮 ========== */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; border: 1px solid transparent; cursor: pointer; transition: all 0.2s; }
.btn-sm { padding: 6px 12px; font-size: 12px; }

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25); }
[data-theme="dark"] .btn-primary:hover { box-shadow: 0 2px 10px rgba(108, 92, 231, 0.3); }

.btn-secondary { background: var(--bg-panel); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg-card-hover); color: var(--text-bright); }

.btn-danger { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }
.btn-danger:hover { background: var(--danger); color: white; }

.btn-copy { background: var(--btn-copy-bg); color: var(--accent); border-color: var(--btn-copy-border); }
.btn-copy:hover { background: var(--accent); color: white; }
.btn-copy.copied { background: var(--success); color: white; border-color: var(--success); }

/* ========== 弹窗 ========== */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: var(--modal-overlay); backdrop-filter: blur(4px); z-index: 1000; display: flex; align-items: center; justify-content: center; animation: fadeIn 0.2s ease; }
.modal { background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; width: 90%; max-width: 420px; box-shadow: var(--shadow-lg); animation: modalIn 0.3s ease; }
.modal-sm { max-width: 380px; }
@keyframes modalIn { from { opacity: 0; transform: scale(0.95) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }

.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-header h3 { font-size: 18px; color: var(--text-bright); }
.modal-close { background: none; border: none; color: var(--text-dim); font-size: 24px; cursor: pointer; transition: color 0.2s; line-height: 1; }
.modal-close:hover { color: var(--text-bright); }
.confirm-text { color: var(--text); font-size: 14px; line-height: 1.6; margin-bottom: 20px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ========== 提示消息 ========== */
.toast { position: fixed; top: 20px; right: 20px; padding: 12px 20px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; z-index: 2000; animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards; box-shadow: var(--shadow-lg); }
.toast-success { background: var(--success); color: white; }
.toast-error { background: var(--danger); color: white; }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateY(-10px); } }

/* ========== 点选文字验证码 ========== */
.captcha-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: var(--modal-overlay); backdrop-filter: blur(4px); z-index: 2000; display: flex; align-items: center; justify-content: center; animation: fadeIn 0.2s ease; }
.captcha-modal { background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius); width: 360px; box-shadow: var(--shadow-lg); animation: modalIn 0.3s ease; overflow: hidden; }
.captcha-header { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 16px 18px 12px; border-bottom: 1px solid var(--border); position: relative; }
.captcha-title { font-size: 15px; font-weight: 600; color: var(--text-bright); }
.captcha-hint { font-size: 13px; color: var(--text-dim); flex: 1; text-align: right; padding-right: 24px; }
.captcha-hint em { font-style: normal; font-weight: 700; font-size: 16px; margin: 0 2px; color: var(--primary); }
[data-theme="dark"] .captcha-hint em { text-shadow: 0 0 8px currentColor; }
.captcha-close { position: absolute; top: 12px; right: 14px; background: none; border: none; color: var(--text-dim); font-size: 20px; cursor: pointer; line-height: 1; transition: color 0.2s; }
.captcha-close:hover { color: var(--text-bright); }

.captcha-marker { position: absolute; width: 24px; height: 24px; margin-left: -12px; margin-top: -12px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; border: 2px solid rgba(255, 255, 255, 0.8); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4); animation: markerPop 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275); z-index: 10; }
@keyframes markerPop { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.captcha-marker.correct { background: var(--success); border-color: rgba(255, 255, 255, 0.9); }
.captcha-marker.fail { background: var(--danger); border-color: rgba(255, 255, 255, 0.7); animation: markerPop 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), shake 0.4s ease; }

.captcha-footer { display: flex; align-items: center; justify-content: space-between; padding: 10px 18px 14px; }
.captcha-refresh { display: flex; align-items: center; gap: 5px; background: none; border: none; color: var(--primary-light); font-size: 12px; cursor: pointer; transition: color 0.2s; padding: 4px 0; }
.captcha-refresh:hover { color: var(--text-bright); }
.captcha-status { font-size: 12px; font-weight: 600; }

/* -- 点选验证 canvas -- */
.captcha-body canvas { display: block; width: 100%; height: auto; border-radius: 10px; }
.captcha-body { position: relative; margin: 12px 18px; border-radius: 10px; overflow: hidden; cursor: crosshair; }
.captcha-clicks { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; }

/* -- 滑块拼图 -- */
.slider-captcha-wrap { position: relative; width: 100%; border-radius: 10px; overflow: hidden; cursor: default; }
.slider-captcha-wrap canvas:first-child { display: block; width: 100%; height: auto; }
.sl-block { position: absolute; top: 0; left: 0; width: 100%; height: auto; pointer-events: none; }

/* -- 共用滑动条 -- */
.sl-bar { position: relative; height: 44px; background: var(--sl-bg); border: 1px solid var(--border); border-radius: 22px; margin: 12px 0 0; overflow: hidden; user-select: none; -webkit-user-select: none; }
.sl-track { position: absolute; width: 100%; text-align: center; line-height: 44px; font-size: 13px; color: var(--sl-track); pointer-events: none; }
.sl-fill { position: absolute; left: 0; top: 0; height: 100%; width: 0; background: var(--sl-fill); border-radius: 22px 0 0 22px; pointer-events: none; }
.sl-handle { position: absolute; left: 0; top: 0; width: 44px; height: 44px; background: var(--bg-panel); border: 1px solid var(--border); border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: grab; box-shadow: 0 2px 4px rgba(0,0,0,0.1); z-index: 10; touch-action: none; }
[data-theme="dark"] .sl-handle { top: 2px; width: 40px; height: 40px; background: linear-gradient(135deg, var(--primary), var(--accent)); box-shadow: 0 2px 12px rgba(108,92,231,0.5); }
.sl-handle svg { stroke: var(--primary); }
[data-theme="dark"] .sl-handle svg { stroke: #fff; }
.sl-handle:active { cursor: grabbing; background: var(--bg-card-hover); }
[data-theme="dark"] .sl-handle:active { transform: scale(1.08); }

/* -- 旋转验证 -- */
.rotate-captcha-wrap { display: flex; flex-direction: column; align-items: center; padding: 10px 0 0; cursor: default; }
.rotate-outer { width: 200px; height: 200px; border-radius: 50%; overflow: hidden; box-shadow: 0 4px 12px rgba(0,0,0,0.15); border: 2px solid var(--border); }
.rotate-outer canvas { display: block; width: 100%; height: 100%; }

/* ========== 记录状态：徽章 / 卡片配色 / 修改按钮 / 弹窗选项 ========== */
:root, :root[data-theme="light"] {
    --status-pending: #f59e0b;
    --status-pending-bg: #fef3c7;
    --status-pending-border: #fde68a;
    --status-checked: #10b981;
    --status-checked-bg: #d1fae5;
    --status-checked-border: #a7f3d0;
    --status-taken: #8b5cf6;
    --status-taken-bg: #ede9fe;
    --status-taken-border: #ddd6fe;
}
:root[data-theme="dark"] {
    --status-pending: #fbbf24;
    --status-pending-bg: rgba(251, 191, 36, 0.12);
    --status-pending-border: rgba(251, 191, 36, 0.3);
    --status-checked: #34d399;
    --status-checked-bg: rgba(52, 211, 153, 0.12);
    --status-checked-border: rgba(52, 211, 153, 0.3);
    --status-taken: #a78bfa;
    --status-taken-bg: rgba(167, 139, 250, 0.12);
    --status-taken-border: rgba(167, 139, 250, 0.35);
}

/* 卡片头部行：时间靠左、徽章靠右 */
.record-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 12px; flex-wrap: wrap; }
.record-header .record-time { margin-bottom: 0; }

/* 状态徽章（在卡片右上角与按钮弹窗里复用） */
.status-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px; border-radius: 999px;
    font-size: 12px; font-weight: 600; line-height: 1;
    border: 1px solid transparent; white-space: nowrap;
}
.status-badge .status-dot {
    width: 6px; height: 6px; border-radius: 50%; background: currentColor;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}
.status-badge.status-pending { color: var(--status-pending); background: var(--status-pending-bg); border-color: var(--status-pending-border); }
.status-badge.status-checked { color: var(--status-checked); background: var(--status-checked-bg); border-color: var(--status-checked-border); }
.status-badge.status-taken   { color: var(--status-taken);   background: var(--status-taken-bg);   border-color: var(--status-taken-border); }

/* 按状态调整卡片左侧色条，让卡片整体也能一眼看出状态 */
.record-card.status-card-pending { border-left-color: var(--status-pending); }
.record-card.status-card-checked { border-left-color: var(--status-checked); }
.record-card.status-card-taken   { border-left-color: var(--status-taken); }

/* 「修改状态」按钮：紫色风格区别于其他按钮 */
.btn-status { background: var(--status-taken-bg); color: var(--status-taken); border-color: var(--status-taken-border); }
.btn-status:hover { background: var(--status-taken); color: white; border-color: var(--status-taken); }

/* 弹窗里的三个大状态选项 */
.status-options { display: flex; flex-direction: column; gap: 10px; padding: 8px 0 4px; }
.status-option {
    display: flex; align-items: center; gap: 10px;
    width: 100%; padding: 12px 14px; border-radius: var(--radius-sm);
    background: var(--bg-card); border: 1.5px solid var(--border);
    color: var(--text-bright); font-size: 14px; font-weight: 500; text-align: left;
    cursor: pointer; transition: all 0.2s;
}
.status-option .status-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.status-option:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); }
.status-option.status-pending .status-dot { background: var(--status-pending); }
.status-option.status-checked .status-dot { background: var(--status-checked); }
.status-option.status-taken   .status-dot { background: var(--status-taken); }

.status-option.status-pending:hover { border-color: var(--status-pending); background: var(--status-pending-bg); color: var(--status-pending); }
.status-option.status-checked:hover { border-color: var(--status-checked); background: var(--status-checked-bg); color: var(--status-checked); }
.status-option.status-taken:hover   { border-color: var(--status-taken);   background: var(--status-taken-bg);   color: var(--status-taken); }

/* 当前已选中的状态：边框变粗 + 背景着色 */
.status-option.active.status-pending { border-color: var(--status-pending); background: var(--status-pending-bg); color: var(--status-pending); }
.status-option.active.status-checked { border-color: var(--status-checked); background: var(--status-checked-bg); color: var(--status-checked); }
.status-option.active.status-taken   { border-color: var(--status-taken);   background: var(--status-taken-bg);   color: var(--status-taken); }
.status-option.active::after { content: '✓ 当前'; margin-left: auto; font-size: 11px; opacity: 0.8; }
