/* tiku 题库系统 v2.0 - PC 管理后台样式（无 CDN，内网可用） */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: "Microsoft YaHei", "PingFang SC", sans-serif; background: #f2f4f8; color: #333; font-size: 14px; }
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }

.topbar { background: #1e3a5f; color: #fff; }
.topbar-in { display: flex; align-items: center; gap: 24px; height: 52px; }
.brand { color: #fff; font-size: 17px; font-weight: bold; }
.brand:hover { text-decoration: none; }
.nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.nav a { color: #cbd5e1; padding: 6px 12px; border-radius: 6px; }
.nav a:hover { color: #fff; background: rgba(255,255,255,.12); text-decoration: none; }
.nav a.on { color: #fff; background: #2563eb; }
.userbox { color: #cbd5e1; font-size: 13px; }
.userbox a { color: #cbd5e1; margin-left: 10px; }
.userbox a:hover { color: #fff; }

main.wrap { padding-top: 20px; padding-bottom: 40px; min-height: 70vh; }
.foot { color: #94a3b8; font-size: 12px; padding: 18px 16px; border-top: 1px solid #e2e8f0; }

.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; }
.flash-ok  { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.flash-bad { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }

.card { background: #fff; border-radius: 10px; padding: 18px; box-shadow: 0 1px 3px rgba(0,0,0,.07); margin-bottom: 16px; }
.card h2 { font-size: 16px; margin-bottom: 14px; }
.card h2 .hint { font-size: 13px; font-weight: normal; color: #94a3b8; margin-left: 8px; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { padding: 9px 10px; border-bottom: 1px solid #eef1f5; text-align: left; vertical-align: top; }
th { background: #f8fafc; font-weight: 600; color: #475569; white-space: nowrap; }
tr:hover td { background: #fafcff; }

.tag { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 12px; }
.tag-blue { background: #dbeafe; color: #1d4ed8; }
.tag-green { background: #dcfce7; color: #15803d; }
.tag-orange { background: #ffedd5; color: #c2410c; }
.tag-red { background: #fee2e2; color: #b91c1c; }
.tag-gray { background: #f1f5f9; color: #64748b; }

.btn { display: inline-block; padding: 6px 14px; border-radius: 6px; border: 1px solid transparent;
       background: #2563eb; color: #fff; font-size: 13px; cursor: pointer; }
.btn:hover { background: #1d4ed8; text-decoration: none; }
.btn-gray { background: #f1f5f9; color: #334155; border-color: #e2e8f0; }
.btn-gray:hover { background: #e2e8f0; }
.btn-red { background: #dc2626; }
.btn-red:hover { background: #b91c1c; }
.btn-green { background: #16a34a; }
.btn-green:hover { background: #15803d; }
.btn-blue { background: #0891b2; }
.btn-blue:hover { background: #0e7490; }
.btn-sm { padding: 3px 9px; font-size: 12px; }
.btn-line { background: #fff; color: #2563eb; border-color: #bfdbfe; }
.btn-line:hover { background: #eff6ff; }

.form-row { margin-bottom: 14px; }
.form-row label { display: block; margin-bottom: 5px; color: #475569; font-weight: 600; }
.form-row .hint { color: #94a3b8; font-size: 12px; font-weight: normal; margin-left: 8px; }
input[type=text], input[type=password], input[type=number], input[type=datetime-local], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 14px;
  font-family: inherit; background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid #bfdbfe; border-color: #2563eb; }
textarea { resize: vertical; }
.form-inline { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.form-inline input, .form-inline select { width: auto; }

.filterbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.filterbar select, .filterbar input { width: auto; }

.pager { margin-top: 14px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pager a, .pager span.cur { padding: 5px 11px; border: 1px solid #e2e8f0; border-radius: 6px; background: #fff; }
.pager span.cur { background: #2563eb; color: #fff; border-color: #2563eb; }
.pager .info { color: #64748b; font-size: 13px; }

.q-block { border: 1px solid #e2e8f0; border-radius: 8px; padding: 14px; margin-bottom: 14px; background: #fff; }
.q-head { margin-bottom: 8px; }
.q-stem { font-size: 14.5px; line-height: 1.7; margin-bottom: 8px; white-space: pre-wrap; }
.q-opt { margin: 4px 0; }
.q-ans { margin-top: 8px; padding: 8px 10px; background: #f8fafc; border-radius: 6px; font-size: 13px; }
.q-ans.ok { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.q-ans.bad { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.q-ans .ref { color: #334155; }

.login-wrap { max-width: 380px; margin: 90px auto; background: #fff; border-radius: 12px;
  padding: 30px; box-shadow: 0 4px 20px rgba(0,0,0,.08); }
.login-wrap h1 { font-size: 20px; text-align: center; margin-bottom: 6px; }
.login-wrap .sub { text-align: center; color: #94a3b8; font-size: 13px; margin-bottom: 22px; }
.login-wrap .form-row label { font-weight: normal; }

.num-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.num-cell { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 10px; }
.num-cell label { font-weight: 600; display: block; margin-bottom: 6px; }
.num-cell input { text-align: center; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: #fff; border-radius: 10px; padding: 14px; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,.07); }
.stat .num { font-size: 24px; font-weight: bold; color: #1e3a5f; }
.stat .lbl { color: #64748b; font-size: 13px; margin-top: 4px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }

.muted { color: #94a3b8; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
code { background: #f1f5f9; padding: 1px 5px; border-radius: 4px; font-size: 12px; }

/* 富文本编辑器 */
.rich-editor-box { border: 1px solid #cbd5e1; border-radius: 6px; overflow: hidden; background: #fff; }
.rich-toolbar { display: flex; gap: 4px; padding: 6px 8px; background: #f8fafc; border-bottom: 1px solid #e2e8f0; }
.rich-toolbar button { padding: 4px 10px; border: 1px solid #e2e8f0; border-radius: 4px; background: #fff; cursor: pointer; font-size: 13px; }
.rich-toolbar button:hover { background: #eff6ff; }
.rich-editor { min-height: 90px; padding: 10px 12px; outline: none; line-height: 1.7; }
.rich-editor:focus { box-shadow: inset 0 0 0 2px #bfdbfe; }
.rich-editor table, .rich-content table { border-collapse: collapse; margin: 6px 0; }
.rich-editor td, .rich-editor th, .rich-content td, .rich-content th { border: 1px solid #cbd5e1; padding: 4px 8px; }
.rich-content { line-height: 1.7; }
.rich-content table { max-width: 100%; }
