/* ===== 卡密证件管理后台 - 样式 ===== */
* { margin:0; padding:0; box-sizing:border-box; }
html, body { min-height:100vh; font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Helvetica Neue","Microsoft YaHei",sans-serif; font-size:14px; color:#1f2937; background:#f3f4f6; -webkit-font-smoothing:antialiased; }
#app { min-height:100vh; }

/* ===== 登录页 ===== */
.login-page { min-height:100vh; display:flex; align-items:center; justify-content:center; background:linear-gradient(135deg,#1e3a5f 0%,#2563eb 100%); padding:20px; }
.login-box { background:#fff; border-radius:16px; box-shadow:0 20px 60px rgba(0,0,0,0.25); width:100%; max-width:420px; padding:40px 36px; }
.login-header { text-align:center; margin-bottom:28px; }
.login-icon { font-size:52px; margin-bottom:10px; }
.login-header h2 { font-size:22px; color:#1f2937; margin-bottom:6px; }
.login-header p { color:#6b7280; font-size:14px; }
.login-form .form-group { margin-bottom:20px; }
.login-form label { display:block; font-size:14px; color:#374151; margin-bottom:8px; font-weight:600; }
.login-form input { width:100%; height:46px; padding:0 14px; border:1.5px solid #d1d5db; border-radius:10px; font-size:16px; outline:none; transition:border-color .2s; }
.login-form input:focus { border-color:#2563eb; box-shadow:0 0 0 3px rgba(37,99,235,0.12); }
.btn-primary { width:100%; height:46px; background:linear-gradient(135deg,#2563eb 0%,#1d4ed8 100%); color:#fff; border:none; border-radius:10px; font-size:16px; font-weight:600; cursor:pointer; transition:opacity .2s; }
.btn-primary:hover { opacity:0.92; }
.btn-primary:disabled { opacity:0.6; cursor:not-allowed; }
.btn-block { width:100%; }
.login-tip { margin-top:16px; text-align:center; font-size:14px; min-height:20px; }

/* ===== 顶部导航 ===== */
.nav-bar { background:linear-gradient(135deg,#1e3a5f 0%,#2563eb 100%); color:#fff; padding:14px 24px; display:flex; align-items:center; justify-content:space-between; position:sticky; top:0; z-index:100; box-shadow:0 2px 10px rgba(0,0,0,0.15); }
.nav-bar .title { font-size:18px; font-weight:700; letter-spacing:1px; }
.nav-right { display:flex; align-items:center; gap:8px; }
.nav-right-btn { font-size:13px; cursor:pointer; padding:7px 14px; background:rgba(255,255,255,0.18); border-radius:8px; white-space:nowrap; transition:background .2s; }
.nav-right-btn:hover { background:rgba(255,255,255,0.3); }
.nav-right-btn-disabled { cursor:not-allowed; opacity:0.55; }
.nav-right-btn-disabled:hover { background:rgba(255,255,255,0.18); }
.limit-tip { font-size:11px; }
.nav-user { font-size:13px; padding:7px 12px; background:rgba(255,255,255,0.12); border-radius:8px; font-family:monospace; letter-spacing:1px; }
.nav-logout { font-size:13px; cursor:pointer; padding:7px 14px; background:rgba(255,255,255,0.18); border-radius:8px; white-space:nowrap; }
.nav-logout:hover { background:#ef4444; }

/* ===== 页面容器 ===== */
.page-container { max-width:1280px; margin:24px auto; padding:0 24px; }

/* ===== 工具栏 ===== */
.toolbar { display:flex; gap:10px; align-items:center; background:#fff; padding:14px 16px; border-radius:10px; box-shadow:0 1px 4px rgba(0,0,0,0.06); margin-bottom:16px; flex-wrap:wrap; }
.toolbar input { flex:1; min-width:220px; height:38px; padding:0 12px; border:1px solid #d1d5db; border-radius:8px; font-size:14px; outline:none; }
.toolbar input:focus { border-color:#2563eb; }
.toolbar select { height:38px; padding:0 10px; border:1px solid #d1d5db; border-radius:8px; font-size:14px; outline:none; background:#fff; }
.toolbar .btn-primary { width:auto; height:38px; padding:0 22px; font-size:14px; letter-spacing:0; border-radius:8px; }
.btn-outline { display:inline-block; padding:9px 18px; background:#fff; color:#2563eb; border:1px solid #2563eb; border-radius:8px; font-size:13px; cursor:pointer; transition:background .2s; }
.btn-outline:hover { background:#eff6ff; }

/* ===== 表格 ===== */
.table-wrap { background:#fff; border-radius:10px; box-shadow:0 1px 4px rgba(0,0,0,0.06); overflow:auto; }
.cert-table { width:100%; border-collapse:collapse; min-width:900px; }
.cert-table thead th { background:#f8fafc; color:#475569; font-size:13px; font-weight:600; text-align:left; padding:12px 14px; border-bottom:1px solid #e5e7eb; white-space:nowrap; }
.cert-table tbody td { padding:11px 14px; border-bottom:1px solid #f1f5f9; font-size:14px; vertical-align:middle; }
.cert-table tbody tr:hover { background:#f8fafc; }
.cell-name { display:flex; align-items:center; gap:10px; }
.cell-avatar { width:38px; height:38px; border-radius:8px; object-fit:cover; background:#f1f5f9; display:flex; align-items:center; justify-content:center; font-size:18px; }
.cell-avatar.placeholder { color:#94a3b8; }
.mono { font-family:ui-monospace,SFMono-Regular,Consolas,monospace; font-size:13px; }
.badge { display:inline-block; padding:3px 10px; border-radius:20px; font-size:12px; font-weight:600; }
.badge.valid { background:#dcfce7; color:#16a34a; }
.badge.expired { background:#fef3c7; color:#d97706; }
.badge.revoked { background:#fee2e2; color:#dc2626; }
.badge.active { background:#dcfce7; color:#16a34a; }
.badge.disabled { background:#e5e7eb; color:#6b7280; }
.ops { white-space:nowrap; }
.btn-mini { padding:5px 12px; border:1px solid #d1d5db; background:#fff; color:#374151; border-radius:6px; font-size:12px; cursor:pointer; margin-right:4px; transition:all .15s; }
.btn-mini:hover { border-color:#2563eb; color:#2563eb; }
.btn-mini.danger:hover { border-color:#dc2626; color:#dc2626; }
.btn-mini:disabled { opacity:0.5; cursor:not-allowed; }
.btn-mini.disabled-btn { background:#f3f4f6; color:#9ca3af; border-color:#e5e7eb; }
.empty-state { text-align:center; padding:60px 0; color:#9ca3af; }

/* ===== 分页 ===== */
.pager { display:flex; align-items:center; justify-content:flex-end; gap:12px; margin-top:14px; color:#6b7280; font-size:13px; }

/* ===== 弹窗 ===== */
.modal-overlay { position:fixed; top:0; left:0; right:0; bottom:0; background:rgba(17,24,39,0.55); z-index:200; display:flex; align-items:center; justify-content:center; padding:20px; }
.modal-content { background:#fff; border-radius:14px; box-shadow:0 24px 64px rgba(0,0,0,0.25); width:100%; max-width:480px; max-height:90vh; display:flex; flex-direction:column; }
.modal-content.wide { max-width:720px; }
.modal-header { display:flex; align-items:center; justify-content:space-between; padding:18px 24px; border-bottom:1px solid #e5e7eb; }
.modal-header h3 { font-size:17px; color:#1f2937; }
.modal-close { font-size:26px; color:#9ca3af; cursor:pointer; line-height:1; }
.modal-close:hover { color:#374151; }
.modal-body { padding:20px 24px; overflow-y:auto; }
.modal-footer { display:flex; align-items:center; justify-content:flex-end; gap:10px; padding:16px 24px; border-top:1px solid #e5e7eb; }
.modal-footer .btn-primary { width:auto; height:38px; padding:0 22px; font-size:14px; letter-spacing:0; }

/* ===== 表单 ===== */
.form-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:14px; }
.form-group label { display:block; font-size:13px; color:#374151; margin-bottom:6px; font-weight:600; }
.form-group input, .form-group select { width:100%; height:38px; padding:0 12px; border:1px solid #d1d5db; border-radius:8px; font-size:14px; outline:none; transition:border-color .2s; background:#fff; }
.form-group input:focus, .form-group select:focus { border-color:#2563eb; box-shadow:0 0 0 3px rgba(37,99,235,0.1); }
.form-group.span-2 { grid-column:span 2; }
.form-group .tip { margin-top:4px; font-size:12px; color:#9ca3af; }
.form-group.inline { display:inline-flex; align-items:center; gap:8px; margin-right:14px; }
.form-group.inline label { margin-bottom:0; white-space:nowrap; }
.exam-items-checks { display:flex; flex-wrap:wrap; gap:10px; }
.exam-item-check { display:inline-flex; align-items:center; gap:6px; background:#f8fafc; border:1px solid #e2e8f0; border-radius:8px; padding:8px 12px; cursor:pointer; font-size:14px; color:#334155; transition:all .15s; user-select:none; }
.exam-item-check:hover { border-color:#2563eb; }
.exam-item-check input { accent-color:#2563eb; width:16px; height:16px; margin:0; }

/* ===== 上传 ===== */
.upload-row { display:flex; gap:16px; align-items:center; }
.upload-preview { width:80px; height:100px; border-radius:8px; object-fit:cover; background:#f1f5f9; border:1px solid #e5e7eb; }
.upload-preview.empty { display:flex; align-items:center; justify-content:center; color:#94a3b8; font-size:12px; }

/* ===== 详情 ===== */
.detail-head { display:flex; gap:16px; align-items:center; margin-bottom:20px; }
.detail-photo { width:90px; height:110px; border-radius:10px; object-fit:cover; background:#f1f5f9; }
.detail-photo.empty { display:flex; align-items:center; justify-content:center; font-size:34px; color:#cbd5e1; }
.detail-head h2 { font-size:20px; margin-bottom:4px; }
.detail-head p { color:#6b7280; font-size:14px; }
.detail-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:12px; }
.detail-item { background:#f8fafc; border-radius:8px; padding:10px 12px; }
.detail-item .label { font-size:12px; color:#9ca3af; margin-bottom:3px; }
.detail-item .value { font-size:14px; color:#1f2937; word-break:break-all; }
.detail-qr { display:flex; justify-content:center; margin-top:20px; }
.qr-box { text-align:center; padding:14px; border:1px solid #e2e8f0; border-radius:12px; background:#fff; }
.qr-img { width:150px; height:150px; display:block; }
.qr-tip { font-size:12px; color:#64748b; margin-top:8px; }

/* ===== 卡密管理 ===== */
.gen-row { display:flex; align-items:flex-end; gap:10px; margin-bottom:16px; flex-wrap:wrap; }
.gen-row .btn-primary { width:auto; height:38px; padding:0 22px; font-size:14px; letter-spacing:0; }
.codes-box { background:#f0fdf4; border:1px solid #bbf7d0; border-radius:10px; padding:14px; margin-bottom:16px; }
.codes-title { font-size:13px; color:#166534; font-weight:600; margin-bottom:10px; }
.codes-list { display:flex; flex-wrap:wrap; gap:8px; }
.code-chip { background:#fff; border:1px solid #86efac; color:#166534; font-family:monospace; font-size:13px; padding:6px 10px; border-radius:6px; cursor:pointer; transition:background .15s; }
.code-chip:hover { background:#dcfce7; }

/* ===== 设置 ===== */
.info-box { background:#eff6ff; border:1px solid #bfdbfe; border-radius:10px; padding:14px 16px; margin-top:16px; }
.info-box strong { color:#1e40af; font-size:14px; display:block; margin-bottom:8px; }
.info-box p { color:#1e40af; font-size:13px; line-height:1.8; }

/* ===== 提示 / 加载 ===== */
.toast { position:fixed; top:20px; left:50%; transform:translateX(-50%); z-index:400; padding:12px 24px; border-radius:10px; color:#fff; font-size:14px; box-shadow:0 8px 24px rgba(0,0,0,0.2); }
.toast.success { background:#16a34a; }
.toast.error { background:#dc2626; }
.toast.info { background:#2563eb; }
.loading-mask { position:fixed; top:0; left:0; right:0; bottom:0; background:rgba(255,255,255,0.7); z-index:300; display:flex; align-items:center; justify-content:center; }
.loading-box { text-align:center; color:#6b7280; }
.spinner { width:36px; height:36px; border:3px solid #e5e7eb; border-top-color:#2563eb; border-radius:50%; animation:spin 0.8s linear infinite; margin:0 auto 10px; }
@keyframes spin { to { transform:rotate(360deg); } }
