/* 管理后台样式（基于 styles.css 的变量与基础组件） */
[hidden] { display: none !important; }

.admin-body { background: #f4f5f7; }

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { width: 100%; max-width: 340px; padding: 26px 22px; }
.login-card h2 { margin: 0 0 4px; font-size: 19px; }
.login-card p { margin: 0 0 10px; }

.admin-layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 210px; flex: none; background: #fff; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.logo { padding: 20px 18px; font-weight: 600; font-size: 15px; border-bottom: 1px solid var(--line); }
.sidebar nav { padding: 10px 8px; flex: 1; }
.nav-item {
  display: block; padding: 10px 12px; border-radius: 8px; color: #555a63; font-size: 14px; margin-bottom: 2px;
}
.nav-item:hover { background: #f6f7f8; }
.nav-item.active { background: rgba(7,193,96,.1); color: var(--green-dark); font-weight: 500; }
.sidebar-foot { padding: 14px 16px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; font-size: 13px; }
.sidebar-foot a { color: var(--muted); }

.admin-main { flex: 1; padding: 22px 26px 40px; min-width: 0; }
.pane-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.pane-head h2 { margin: 0; font-size: 18px; }
.pane-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.select, .input, .textarea {
  height: 34px; border: 1px solid #e3e5e9; border-radius: 8px; padding: 0 10px;
  font-size: 13px; background: #fff; font-family: inherit; color: var(--text);
}
.select:focus, .input:focus, .textarea:focus { outline: none; border-color: var(--green); }
.select.block { width: 100%; height: 42px; font-size: 14px; }
.textarea { width: 100%; height: auto; padding: 8px 10px; font-size: 14px; resize: vertical; }
.input { min-width: 180px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.stat {
  background: #fff; border-radius: 12px; padding: 16px 18px; box-shadow: var(--shadow);
}
.stat .k { font-size: 12px; color: var(--muted); }
.stat .v { font-size: 24px; font-weight: 700; margin-top: 4px; }
.stat .v small { font-size: 13px; font-weight: 500; color: var(--muted); }

.table-card { padding: 4px 0; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th, .table td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { color: var(--muted); font-weight: 500; font-size: 12.5px; background: #fbfbfc; white-space: nowrap; }
.table tr:last-child td { border-bottom: none; }
.table td.ellipsis { max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table .row-actions { display: flex; gap: 6px; }

.tag { display: inline-block; font-size: 12px; padding: 1px 7px; border-radius: 5px; background: #f1f2f4; color: #555a63; }
.tag.green { background: rgba(7,193,96,.1); color: var(--green-dark); }
.tag.gray { background: #f1f2f4; color: var(--muted); }
.tag.red { background: rgba(250,81,81,.1); color: var(--danger); }
.tag.orange { background: rgba(250,157,59,.14); color: #c77700; }

.summary-line { margin-top: 10px; font-size: 13px; }

.rule-form { max-width: 720px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.check-line { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: #555a63; margin: 6px 0; }
.rule-form .check-line { margin: 12px 0; }
.form-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.switch-line { font-size: 13.5px; color: #555a63; display: flex; align-items: center; gap: 6px; }
.small { font-size: 12px; }

.sheet.wide { max-width: 560px; max-height: 86vh; overflow-y: auto; }
.opt-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.opt-row .opt-key {
  width: 26px; height: 26px; flex: none; border-radius: 6px; background: #f2f3f5;
  display: flex; align-items: center; justify-content: center; font-size: 12px; color: #555a63;
}
.opt-row input[type="text"] { flex: 1; height: 34px; border: 1px solid #e3e5e9; border-radius: 8px; padding: 0 10px; font-size: 13px; font-family: inherit; }
.opt-row input[type="text"]:focus { outline: none; border-color: var(--green); }
.opt-row .del { border: none; background: none; color: var(--danger); cursor: pointer; font-size: 13px; }
.opt-row .pick { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); white-space: nowrap; }

.detail-body { font-size: 13.5px; }
.detail-q { padding: 10px 0; border-bottom: 1px dashed var(--line); }
.detail-q:last-child { border-bottom: none; }
.detail-q .t { font-weight: 500; margin-bottom: 4px; }
.detail-q .a { color: #33363b; }
.detail-q .ans { color: var(--muted); font-size: 12.5px; }

@media (max-width: 820px) {
  .admin-layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: row; align-items: center; flex-wrap: wrap; }
  .sidebar nav { display: flex; overflow-x: auto; padding: 6px; flex: 1; }
  .nav-item { white-space: nowrap; margin: 0 4px 0 0; }
  .logo { border: none; padding: 12px 14px; }
  .sidebar-foot { border: none; padding: 8px 12px; }
  .admin-main { padding: 16px; }
  .grid2 { grid-template-columns: 1fr; }
}
