/* 管理后台 */
.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 30% 20%, #dceaff, transparent 45%), linear-gradient(135deg, #f2f6fc, #e7eef8); }
.login-card { width: 100%; max-width: 400px; padding: 34px 30px 24px; text-align: center; }
.login-logo { width: 58px; height: 58px; margin: 0 auto 14px; border-radius: 15px; background: linear-gradient(135deg, #1976d2, #0d47a1); color: #fff; display: grid; place-items: center; font-size: 28px; font-weight: 800; box-shadow: 0 8px 22px rgba(21,101,192,.3); }
.login-card h1 { margin: 0 0 4px; font-size: 22px; }
.login-card > p { margin: 0 0 22px; font-size: 13px; }
.login-card form { text-align: left; }
.login-error { padding: 8px 11px; border-radius: 8px; background: var(--danger-soft); color: var(--danger); font-size: 13px; margin-bottom: 12px; }
.login-foot { margin-top: 18px; font-size: 13px; }

.sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 226px; background: #13233c; color: #dbe7f7; display: flex; flex-direction: column; z-index: 200; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 22px; font-size: 16px; font-weight: 800; border-bottom: 1px solid rgba(255,255,255,.08); }
.side-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: #1976d2; color: #fff; font-size: 17px; }
.side-brand small { display: block; font-size: 11px; color: #8fa8c8; font-weight: 500; margin-top: 2px; }
.side-nav { padding: 14px 10px; flex: 1; }
.side-item { display: flex; align-items: center; gap: 11px; width: 100%; padding: 11px 13px; margin-bottom: 4px; border: 0; border-radius: 9px; background: transparent; color: #b9cce4; font-size: 14px; font-weight: 600; cursor: pointer; text-align: left; transition: .15s; }
.side-item i { font-style: normal; width: 18px; text-align: center; color: #7f9dc0; }
.side-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.side-item.active { background: #1976d2; color: #fff; box-shadow: 0 4px 14px rgba(25,118,210,.35); }
.side-item.active i { color: #fff; }
.side-foot { padding: 14px; border-top: 1px solid rgba(255,255,255,.08); }
.admin-info { font-size: 12px; color: #8fa8c8; margin-bottom: 9px; padding-left: 2px; }
.side-foot .btn { background: rgba(255,255,255,.1); color: #dbe7f7; border-color: rgba(255,255,255,.15); }
.side-foot .btn:hover { background: rgba(255,255,255,.18); }

.app-main { margin-left: 226px; min-height: 100vh; }
.app-header { position: sticky; top: 0; z-index: 90; height: 60px; display: flex; align-items: center; gap: 12px; padding: 0 22px; background: rgba(255,255,255,.94); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.app-header h2 { font-size: 17px; margin: 0; }
.nav-toggle { display: none; border: 0; background: transparent; font-size: 21px; cursor: pointer; }
.app-content { padding: 22px; max-width: 1600px; margin: 0 auto; }
.view { animation: viewIn .2s ease both; }
@keyframes viewIn { from { opacity: .4; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.side-mask { position: fixed; inset: 0; background: rgba(10,20,35,.5); z-index: 190; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.stat { padding: 18px 20px; }
.stat span { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.stat b { font-size: 30px; line-height: 1.1; }
.ok-text { color: var(--success); font-size: 24px; }
.panel { padding: 20px; margin-top: 16px; }
.panel > h3 { margin: 0 0 16px; font-size: 16px; }
.panel.narrow { max-width: 520px; }
.quick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.quick { padding: 18px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); text-align: left; cursor: pointer; transition: .18s; }
.quick:hover { border-color: var(--brand); background: var(--brand-soft); transform: translateY(-2px); }
.quick span { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: #fff; color: var(--brand); font-size: 18px; margin-bottom: 10px; box-shadow: var(--shadow); }
.quick b { display: block; font-size: 14px; }
.quick small { color: var(--text-2); font-size: 12px; }
.tips { margin: 0; padding-left: 20px; color: var(--text-2); font-size: 13px; line-height: 2; }
code { padding: 2px 6px; background: #eef2f7; border-radius: 5px; font-family: Consolas, monospace; font-size: 12px; }

.view-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; min-width: 700px; font-size: 13px; }
.table th { text-align: left; padding: 12px 14px; background: var(--surface-2); color: var(--text-2); font-weight: 700; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid #eef1f5; vertical-align: middle; }
.table tbody tr:hover { background: #f8fbff; }
.table .ops { display: flex; gap: 6px; flex-wrap: wrap; }
.data-summary { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); margin: 0 0 12px 2px; }
.data-summary b { color: var(--text); font-size: 15px; }
.pager { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 16px; }

/* ============ 设计器 ============ */
.designer-view { min-height: calc(100vh - 100px); }
.dg-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.dg-head input.title { font-size: 17px; font-weight: 700; min-width: 240px; flex: 1; }
.dg-layout { display: grid; grid-template-columns: 196px minmax(360px, 1fr) 320px; gap: 12px; align-items: start; }
.dg-col { background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.dg-col-title { padding: 11px 13px; font-size: 13px; font-weight: 700; color: var(--text-2); border-bottom: 1px solid var(--line); background: var(--surface-2); }
.dg-palette, .dg-props-body { padding: 10px; max-height: calc(100vh - 230px); overflow: auto; }
.dg-palette-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.dg-tool { padding: 8px 4px; border: 1px solid var(--line); border-radius: 7px; background: #fff; font-size: 12px; cursor: pointer; color: var(--text); transition: .15s; }
.dg-tool:hover { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.dg-canvas { min-height: 460px; max-height: calc(100vh - 230px); overflow: auto; padding: 16px; background: #eef2f8; }
.dg-survey-head { background: #fff; border-radius: 10px; padding: 16px; margin-bottom: 12px; border: 1px solid var(--line); }
.dg-survey-head h3 { margin: 0 0 4px; font-size: 18px; }
.dg-q { position: relative; background: #fff; border: 1.5px solid var(--line); border-radius: 10px; padding: 13px 14px; margin-bottom: 10px; cursor: pointer; transition: .15s; }
.dg-q:hover { border-color: #9fc4ef; }
.dg-q.active { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(21,101,192,.1); }
.dg-q-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.dg-q-type { font-size: 11px; color: var(--brand); background: var(--brand-soft); padding: 2px 7px; border-radius: 5px; font-weight: 700; }
.dg-q-title { font-weight: 600; font-size: 14px; flex: 1; }
.dg-q-ops { display: flex; gap: 4px; }
.dg-icon-btn { border: 0; background: transparent; cursor: pointer; color: var(--text-2); font-size: 14px; padding: 2px 5px; border-radius: 5px; }
.dg-icon-btn:hover { background: var(--surface-2); color: var(--brand); }
.dg-preview { font-size: 12px; color: var(--text-2); padding-left: 2px; word-break: break-all; }
.dg-pagebreak { background: #e8eef7; border: 1px dashed #9db4d2; color: var(--brand); text-align: center; font-weight: 700; font-size: 12px; padding: 8px; border-radius: 8px; margin: 10px 0; }
.dg-empty { text-align: center; padding: 56px 10px; color: var(--text-2); font-size: 13px; }
.dg-prop-group { border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 12px; }
.dg-prop-group:last-child { border: 0; margin: 0; }
.dg-prop-group h4 { margin: 0 0 10px; font-size: 13px; color: var(--brand); }
.dg-prop-group label.field > span { font-size: 12px; }
.dg-checkline { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 8px; }
.dg-checkline input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--brand); }
.dg-opt-row { display: flex; gap: 5px; margin-bottom: 6px; }
.dg-opt-row input { flex: 1; min-width: 0; }
.dg-tabs { display: flex; gap: 4px; margin-bottom: 12px; }
.dg-tab { flex: 1; padding: 6px 4px; text-align: center; font-size: 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff; cursor: pointer; }
.dg-tab.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.dg-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dg-color { display: flex; align-items: center; gap: 6px; }
.dg-color input[type=color] { width: 34px; height: 34px; padding: 0; border: 1px solid var(--line); border-radius: 7px; cursor: pointer; background: #fff; }

@media (max-width: 1100px) {
  .dg-layout { grid-template-columns: 170px 1fr; }
  .dg-props-col { grid-column: 1 / -1; }
  .dg-palette, .dg-props-body, .dg-canvas { max-height: none; }
}
@media (max-width: 760px) {
  .sidebar { transform: translateX(-100%); transition: transform .22s; }
  .sidebar.open { transform: none; }
  .app-main { margin-left: 0; }
  .nav-toggle { display: block; }
  .app-header { padding: 0 14px; }
  .app-content { padding: 14px; }
  .view-toolbar { align-items: stretch; }
  .view-toolbar > .row { width: 100%; }
  .view-toolbar .input, .view-toolbar .select { flex: 1; min-width: 0; }
  .dg-layout { grid-template-columns: 1fr; }
  .dg-palette-grid { grid-template-columns: repeat(4, 1fr); }
  .dg-tool { font-size: 11px; }
  .dg-canvas { padding: 10px; }
  .dg-q-ops { flex-wrap: wrap; justify-content: flex-end; }
  .stat b { font-size: 26px; }
}
@media (max-width: 420px) {
  .dg-palette-grid { grid-template-columns: repeat(3, 1fr); }
  .dg-head input.title { min-width: 0; width: 100%; }
}
