/* V2BoardBot 管理后台样式 */
:root { --primary: #00d4aa; --bg-dark: #0a0f1a; --bg-card: #111827; --bg-input: #1f2937; --text-primary: #f9fafb; --text-secondary: #9ca3af; --text-muted: #6b7280; --border: #374151; --radius: 8px; --danger: #ef4444; }
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, sans-serif; background: var(--bg-dark); min-height: 100vh; color: var(--text-primary); }

/* 登录页 */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card { background: var(--bg-card); padding: 40px; border-radius: 12px; width: 380px; border: 1px solid var(--border); }
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo .icon { font-size: 44px; margin-bottom: 10px; }
.login-logo h1 { font-size: 20px; color: var(--primary); }
.login-logo p { color: var(--text-muted); margin-top: 6px; font-size: 12px; }

/* 表单 */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 12px; color: var(--text-secondary); margin-bottom: 5px; }
.form-input { width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; background: var(--bg-input); color: var(--text-primary); }
.form-input:focus { outline: none; border-color: var(--primary); }
.form-input::placeholder { color: var(--text-muted); }
.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }

/* 按钮 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 9px 18px; border-radius: var(--radius); font-size: 13px; font-weight: 600; cursor: pointer; border: none; }
.btn-primary { background: var(--primary); color: #000; }
.btn-ghost { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); }
.btn-danger { background: var(--danger); color: white; }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 11px; }

/* 开关 */
.switch { position: relative; width: 40px; height: 22px; flex-shrink: 0; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider { position: absolute; cursor: pointer; inset: 0; background: var(--border); border-radius: 22px; transition: 0.3s; }
.switch-slider:before { content: ""; position: absolute; height: 16px; width: 16px; left: 3px; bottom: 3px; background: white; border-radius: 50%; transition: 0.3s; }
.switch input:checked + .switch-slider { background: var(--primary); }
.switch input:checked + .switch-slider:before { transform: translateX(18px); }
.switch.switch-sm { width: 32px; height: 18px; }
.switch.switch-sm .switch-slider { border-radius: 18px; }
.switch.switch-sm .switch-slider:before { height: 12px; width: 12px; left: 3px; bottom: 3px; }
.switch.switch-sm input:checked + .switch-slider:before { transform: translateX(14px); }
.switch-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.switch-row:last-child { border-bottom: none; }
.switch-info { flex: 1; }
.switch-title { font-weight: 500; font-size: 13px; }
.switch-desc { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* 标签页 */
.tab-group { display: flex; gap: 6px; margin-bottom: 14px; }
.tab-btn { padding: 7px 14px; border-radius: var(--radius); font-size: 12px; font-weight: 500; cursor: pointer; border: 1px solid var(--border); background: transparent; color: var(--text-secondary); }
.tab-btn.active { background: var(--primary); color: #000; border-color: var(--primary); }

/* 布局 */
.app { display: none; }
.sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 200px; background: var(--bg-card); padding: 16px 10px; border-right: 1px solid var(--border); }
.sidebar-logo { display: flex; align-items: center; gap: 8px; padding: 6px 10px; margin-bottom: 20px; }
.sidebar-logo .icon { font-size: 22px; }
.sidebar-logo span { font-size: 14px; font-weight: 700; color: var(--primary); }
.sidebar-nav a { display: flex; align-items: center; gap: 8px; padding: 9px 12px; color: var(--text-secondary); text-decoration: none; border-radius: var(--radius); margin-bottom: 2px; font-size: 12px; }
.sidebar-nav a:hover { background: var(--bg-input); color: var(--text-primary); }
.sidebar-nav a.active { background: var(--primary); color: #000; }
.main { margin-left: 200px; min-height: 100vh; }
.header { background: var(--bg-card); border-bottom: 1px solid var(--border); padding: 12px 20px; display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 100; }
.header h1 { font-size: 15px; }
.content { padding: 16px 20px; }
.page { display: none; }
.page.active { display: block; }

/* 头像菜单 */
.avatar { width: 30px; height: 30px; background: var(--primary); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #000; font-weight: 600; cursor: pointer; font-size: 12px; position: relative; }
.avatar-menu { position: absolute; top: 100%; right: 0; margin-top: 6px; background: var(--bg-card); border-radius: var(--radius); border: 1px solid var(--border); min-width: 140px; opacity: 0; visibility: hidden; transform: translateY(-8px); transition: all 0.2s; z-index: 200; }
.avatar-menu.show { opacity: 1; visibility: visible; transform: translateY(0); }
.avatar-menu a { display: flex; align-items: center; gap: 6px; padding: 9px 12px; color: var(--text-secondary); text-decoration: none; font-size: 12px; }
.avatar-menu a:hover { background: var(--bg-input); }
.avatar-menu a:last-child { color: var(--danger); }

/* 卡片 */
.card { background: var(--bg-card); border-radius: var(--radius); border: 1px solid var(--border); margin-bottom: 16px; }
.card-header { padding: 12px 14px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.card-title { font-size: 13px; font-weight: 600; }
.card-body { padding: 14px; }

/* 统计卡片 */
.stats-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 16px; }
.stat-card { background: var(--bg-card); border-radius: var(--radius); padding: 14px; border: 1px solid var(--border); }
.stat-card .label { font-size: 11px; color: var(--text-muted); margin-bottom: 5px; }
.stat-card .value { font-size: 22px; font-weight: 700; color: var(--primary); }
.stat-card .status { display: inline-flex; font-size: 10px; margin-top: 5px; padding: 2px 6px; border-radius: 10px; }
.stat-card .status.online { background: rgba(16,185,129,0.2); color: #10b981; }
.stat-card .status.offline { background: rgba(239,68,68,0.2); color: #ef4444; }

/* 关键词列表 */
.keyword-list { border: 1px solid var(--border); border-radius: var(--radius); margin-top: 10px; }
.keyword-item { display: flex; align-items: center; padding: 9px 10px; border-bottom: 1px solid var(--border); gap: 10px; }
.keyword-item:last-child { border-bottom: none; }
.keyword-item .kw { background: var(--primary); color: #000; padding: 3px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.keyword-item .reply { flex: 1; color: var(--text-secondary); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.keyword-empty { padding: 24px; text-align: center; color: var(--text-muted); font-size: 12px; }

/* 菜单预览 */
.menu-preview { background: var(--bg-input); border-radius: var(--radius); padding: 16px; border: 1px solid var(--border); }
.menu-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.menu-btn { background: rgba(0,212,170,0.1); color: var(--primary); padding: 10px; border-radius: var(--radius); text-align: center; border: 1px solid rgba(0,212,170,0.2); cursor: grab; transition: transform 0.2s, box-shadow 0.2s; user-select: none; }
.menu-btn:active { cursor: grabbing; }
.menu-btn.dragging { opacity: 0.5; transform: scale(1.05); box-shadow: 0 4px 12px rgba(0,212,170,0.3); }
.menu-btn.drag-over { border: 2px dashed var(--primary); background: rgba(0,212,170,0.2); }
.menu-btn .emoji { font-size: 18px; margin-bottom: 3px; }
.menu-btn .text { font-size: 11px; }
.drag-hint { text-align: center; color: var(--text-muted); font-size: 11px; margin-top: 10px; }

/* 菜单列表 */
.menu-list { border: 1px solid var(--border); border-radius: var(--radius); }
.menu-item { display: flex; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.menu-item:last-child { border-bottom: none; }
.menu-item .icon { font-size: 18px; width: 32px; height: 32px; background: var(--bg-input); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.menu-item .info { flex: 1; min-width: 0; margin: 0 10px; }
.menu-item .name { font-size: 12px; font-weight: 500; }
.menu-item .desc { font-size: 10px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-item .menu-switch { width: 50px; text-align: center; flex-shrink: 0; }
.menu-item .menu-actions { width: 100px; display: flex; gap: 4px; justify-content: flex-end; flex-shrink: 0; }
.menu-list-header { display: flex; padding: 8px 12px; border-bottom: 1px solid var(--border); font-size: 11px; color: var(--text-muted); align-items: center; }
.menu-list-header span { text-align: center; }
.menu-list-header .col-name { flex: 1; text-align: left; padding-left: 42px; }
.menu-list-header .col-switch { width: 50px; }
.menu-list-header .col-actions { width: 100px; text-align: right; }

/* 游戏卡片 */
.game-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.game-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.game-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.game-card-title { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.game-card-title .emoji { font-size: 18px; }
.game-card-body { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.game-card-body .form-group { margin-bottom: 0; }
.game-card-body .form-input { padding: 7px 9px; font-size: 12px; }

/* 模态框 */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center; z-index: 1000; opacity: 0; visibility: hidden; transition: all 0.3s; }
.modal-overlay#confirmModal { z-index: 2000; }
.modal-overlay.show { opacity: 1; visibility: visible; }
.modal { background: var(--bg-card); border-radius: 10px; width: 380px; max-width: 90vw; border: 1px solid var(--border); transform: scale(0.9); transition: all 0.3s; }
.modal-overlay.show .modal { transform: scale(1); }
.modal-header { padding: 14px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 { font-size: 14px; }
.modal-close { width: 26px; height: 26px; border-radius: 50%; border: none; background: var(--bg-input); cursor: pointer; font-size: 14px; color: var(--text-muted); }
.modal-body { padding: 14px; max-height: 55vh; overflow-y: auto; }
.modal-footer { padding: 10px 14px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

/* Toast 提示 */
.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 2000; display: flex; flex-direction: column-reverse; gap: 6px; }
.toast { background: var(--bg-card); padding: 10px 14px; border-radius: var(--radius); border: 1px solid var(--border); display: flex; align-items: center; gap: 8px; min-width: 240px; animation: toastIn 0.3s ease; }
.toast.hide { animation: toastOut 0.3s ease forwards; }
.toast-icon { font-size: 16px; }
.toast-content { flex: 1; }
.toast-title { font-weight: 600; font-size: 12px; }
.toast-message { font-size: 11px; color: var(--text-muted); }
@keyframes toastIn { from { transform: translateY(100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes toastOut { from { transform: translateY(0); opacity: 1; } to { transform: translateY(100%); opacity: 0; } }

/* 表格 */
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th, td { padding: 10px; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--text-muted); font-weight: 500; }
td { color: var(--text-secondary); }
.table-empty { padding: 40px; text-align: center; color: var(--text-muted); }

/* 表情选择器 */
.emoji-btn { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; font-size: 18px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 6px; cursor: pointer; transition: all 0.2s; }
.emoji-btn:hover { background: var(--primary); transform: scale(1.1); }


/* 通用工具类 */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-end { display: flex; justify-content: flex-end; }
.flex-col { display: flex; flex-direction: column; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.gap-6 { gap: 6px; }
.gap-8 { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }
.mt-10 { margin-top: 10px; }
.mt-12 { margin-top: 12px; }
.mt-14 { margin-top: 14px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-10 { margin-bottom: 10px; }
.mb-12 { margin-bottom: 12px; }
.mb-14 { margin-bottom: 14px; }
.pt-0 { padding-top: 0; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-sm { font-size: 11px; }
.text-xs { font-size: 10px; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.w-full { width: 100%; }
.cursor-pointer { cursor: pointer; }
.border-t { border-top: 1px solid var(--border); }
.rounded { border-radius: var(--radius); }
.bg-input { background: var(--bg-input); padding: 10px; border-radius: var(--radius); }

.pt-12 { padding-top: 12px; }
.pt-16 { padding-top: 16px; }

/* 日历选择器 - 模态框版本 */
.cleanup-calendar { background: var(--bg-input); border-radius: var(--radius); padding: 12px; }
.calendar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.calendar-header .month-year { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.calendar-header button { background: var(--bg-card); border: 1px solid var(--border); color: var(--text-secondary); cursor: pointer; padding: 4px 10px; font-size: 14px; border-radius: 4px; transition: all 0.2s; }
.calendar-header button:hover { color: var(--primary); border-color: var(--primary); }
.calendar-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-bottom: 6px; }
.calendar-weekdays span { text-align: center; font-size: 11px; color: var(--text-muted); padding: 4px 0; font-weight: 500; }
.calendar-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.calendar-day { text-align: center; padding: 8px 2px; font-size: 12px; border-radius: 4px; cursor: pointer; color: var(--text-secondary); position: relative; transition: all 0.15s; border: 1px solid transparent; }
.calendar-day:hover { background: var(--bg-card); border-color: var(--border); }
.calendar-day.other-month { color: var(--text-muted); opacity: 0.4; cursor: default; }
.calendar-day.other-month:hover { background: transparent; border-color: transparent; }
.calendar-day.today { border: 1px solid var(--primary); color: var(--primary); }
.calendar-day.selected { background: var(--primary); color: #000 !important; font-weight: 600; border-color: var(--primary); }
.calendar-day.has-data { color: var(--primary); font-weight: 600; }
.calendar-day.selected.has-data { color: #000 !important; }
.calendar-day.has-data::after { content: ""; position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%); width: 4px; height: 4px; background: var(--primary); border-radius: 50%; z-index: 1; }
.calendar-day.selected.has-data::after { background: #000; }
.calendar-footer { display: flex; justify-content: center; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.calendar-footer button { background: var(--bg-card); border: 1px solid var(--border); color: var(--text-secondary); cursor: pointer; font-size: 11px; padding: 5px 12px; border-radius: 4px; transition: all 0.2s; }
.calendar-footer button:hover { color: var(--primary); border-color: var(--primary); }

/* 清理模态框底部 */
.cleanup-modal-footer { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.cleanup-modal-info { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text-primary); }
.cleanup-modal-info .cleanup-count { color: var(--primary); font-weight: 700; }
.cleanup-modal-info .cleanup-records { font-size: 12px; color: var(--text-secondary); }
.cleanup-modal-info .cleanup-records .count { color: var(--danger); font-weight: 600; }
.cleanup-modal-footer .btn { padding: 10px 20px; }

/* 日历文字颜色修复 */
.cleanup-calendar .form-hint { color: var(--text-secondary); }
