/* ==========================================================================
   市场调研大赛资料站 · 设计系统
   ========================================================================== */
:root {
  --brand: #3d5afe;
  --brand-2: #7c5cff;
  --brand-soft: #eef1fe;
  --ink: #101725;
  --ink-2: #4a5468;
  --ink-3: #8b95a9;
  --line: #e6eaf3;
  --bg: #f5f7fc;
  --card: #ffffff;
  --ok: #0ca678;
  --warn: #f08c00;
  --danger: #e03131;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(16, 23, 37, .06), 0 2px 8px rgba(16, 23, 37, .04);
  --shadow: 0 2px 6px rgba(16, 23, 37, .06), 0 12px 32px rgba(16, 23, 37, .07);
  --sidebar-w: 236px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================ 布局 ============================ */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: none;
  background: linear-gradient(170deg, #121b30 0%, #0b1220 100%);
  color: #c7d0e4;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 22px 0 0;
  overflow-y: auto;
}
.brand {
  padding: 0 22px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.brand-name {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  letter-spacing: .3px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.brand-name .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: linear-gradient(135deg, #6b7cff, #a78bfa);
  box-shadow: 0 0 0 4px rgba(109, 124, 255, .18);
}
.brand-sub {
  font-size: 12px;
  color: #7d879e;
  margin-top: 6px;
  line-height: 1.5;
}

.nav { padding: 14px 12px; flex: 1; }
.nav-label {
  font-size: 11px;
  color: #5d6880;
  letter-spacing: .12em;
  padding: 12px 10px 6px;
  text-transform: uppercase;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 10px;
  color: #c7d0e4;
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 2px;
  transition: background .15s, color .15s;
}
.nav a:hover { background: rgba(255, 255, 255, .07); text-decoration: none; color: #fff; }
.nav a.active {
  background: linear-gradient(90deg, rgba(109, 124, 255, .28), rgba(109, 124, 255, .06));
  color: #fff;
  box-shadow: inset 2px 0 0 #6b7cff;
}
.nav a .ico { width: 18px; text-align: center; font-size: 15px; flex: none; }

.sidebar-foot {
  padding: 16px 22px 20px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  font-size: 11.5px;
  color: #6b7590;
  line-height: 1.7;
}

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
  padding: 0 32px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 30;
}
.topbar h1 {
  font-size: 17px;
  font-weight: 700;
  margin: 0;
  letter-spacing: .2px;
}
.topbar .crumb { font-size: 12.5px; color: var(--ink-3); margin-top: 1px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

.content { padding: 26px 32px 64px; max-width: 1360px; width: 100%; }

/* ============================ 组件 ============================ */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  border: 1px solid rgba(16, 23, 37, .04);
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.card-title { font-size: 15px; font-weight: 700; margin: 0; }
.card-desc { font-size: 12.5px; color: var(--ink-3); margin: 4px 0 0; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--brand);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: transform .12s, box-shadow .15s, background .15s;
  white-space: nowrap;
}
.btn:hover { box-shadow: 0 6px 18px rgba(61, 90, 254, .3); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-ghost { background: #fff; color: var(--ink-2); border-color: var(--line); }
.btn-ghost:hover { box-shadow: var(--shadow-sm); border-color: #cfd6e6; }
.btn-soft { background: var(--brand-soft); color: var(--brand); }
.btn-soft:hover { box-shadow: 0 4px 12px rgba(61, 90, 254, .18); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 8px; }

.input, select.input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13.5px;
  font-family: inherit;
  background: #fcfdff;
  color: var(--ink);
  outline: none;
  transition: border-color .15s, background .15s;
}
.input:focus { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px rgba(61, 90, 254, .1); }

.tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 6px;
  background: #eef1f8;
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.tag-brand { background: var(--brand-soft); color: var(--brand); }
.tag-ok { background: #e6fcf5; color: #0b7a5c; }
.tag-warn { background: #fff4e6; color: #a35b00; }
.tag-danger { background: #fff0f0; color: #c92a2a; }

/* ---- KPI ---- */
.kpi {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(16, 23, 37, .04);
}
.kpi-num {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -.5px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.kpi-num small { font-size: 14px; font-weight: 700; margin-left: 2px; color: var(--ink-2); }
.kpi-label { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; }
.kpi-trend { font-size: 11.5px; color: var(--ok); margin-top: 6px; }

/* ---- 条形图 ---- */
.bar-row { margin-bottom: 13px; }
.bar-row:last-child { margin-bottom: 0; }
.bar-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.bar-name { font-size: 13px; font-weight: 600; }
.bar-val { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; flex: none; }
.bar-track { height: 9px; background: #eef1f8; border-radius: 5px; overflow: hidden; }
.bar-fill {
  height: 100%;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  animation: grow .7s cubic-bezier(.22, 1, .36, 1) both;
}
.bar-fill-ok { background: linear-gradient(90deg, #0ca678, #38d9a9); }
.bar-fill-warn { background: linear-gradient(90deg, #f08c00, #ffc94d); }
@keyframes grow { from { width: 0 !important; } }

/* ---- 词云 ---- */
.cloud { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cloud span {
  display: inline-block;
  padding: 4px 11px;
  border-radius: 20px;
  background: #f2f5fd;
  color: #3b4a68;
  font-weight: 600;
  transition: background .15s, transform .15s;
  cursor: default;
}
.cloud span:hover { background: var(--brand-soft); color: var(--brand); transform: translateY(-1px); }

/* ---- 表格 ---- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  position: sticky;
  top: 0;
  background: #f7f9fd;
  text-align: left;
  padding: 11px 14px;
  font-weight: 700;
  font-size: 12.5px;
  color: var(--ink-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  z-index: 2;
}
table.data td {
  padding: 10px 14px;
  border-bottom: 1px solid #f0f3f9;
  vertical-align: top;
}
table.data tr:hover td { background: #fafbff; }
table.data td.title { max-width: 560px; }
table.data td.muted { color: var(--ink-3); }

/* ---- 分页 ---- */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.pager button {
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.pager button:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.pager button.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.pager button:disabled { opacity: .45; cursor: not-allowed; }
.pager .info { font-size: 12.5px; color: var(--ink-3); margin: 0 8px; }

/* ---- 提示 ---- */
.notice {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #fff8e6;
  border: 1px solid #ffe8b3;
  font-size: 13px;
  color: #7a5410;
  line-height: 1.7;
}
.notice-brand { background: var(--brand-soft); border-color: #d9e0ff; color: #2f3f8f; }
.notice .ico { flex: none; font-size: 16px; line-height: 1.5; }

.filters {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr auto;
  gap: 10px;
  align-items: center;
}

.empty { text-align: center; padding: 56px 20px; color: var(--ink-3); }
.empty .big { font-size: 38px; display: block; margin-bottom: 10px; }

/* ---- 作品卡 ---- */
.work {
  padding: 14px 16px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
  margin-bottom: 10px;
  transition: border-color .15s, box-shadow .15s;
}
.work:hover { border-color: #cfd8f5; box-shadow: var(--shadow-sm); }
.work-title { font-size: 13.5px; font-weight: 600; line-height: 1.6; margin-bottom: 7px; }
.work-meta { font-size: 12px; color: var(--ink-3); display: flex; gap: 10px; flex-wrap: wrap; }

/* ---- 时间线 ---- */
.timeline { position: relative; padding-left: 26px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 7px; top: 6px; bottom: 6px;
  width: 2px;
  background: linear-gradient(180deg, var(--brand), #d9e0ff);
  border-radius: 1px;
}
.tl-item { position: relative; padding-bottom: 20px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: '';
  position: absolute;
  left: -24px; top: 6px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #fff;
  border: 2.5px solid var(--brand);
}
.tl-date { font-size: 12px; color: var(--brand); font-weight: 700; }
.tl-title { font-size: 13.5px; font-weight: 600; margin-top: 2px; }
.tl-desc { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }

/* ---- 下载项 ---- */
.dl {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  margin-bottom: 10px;
  transition: border-color .15s, transform .15s;
}
.dl:hover { border-color: #cfd8f5; transform: translateX(2px); }
.dl-ico {
  width: 40px; height: 40px; flex: none;
  border-radius: 10px;
  display: grid; place-items: center;
  font-size: 18px;
  background: var(--brand-soft);
}
.dl-main { flex: 1; min-width: 0; }
.dl-name { font-size: 13.5px; font-weight: 600; }
.dl-desc { font-size: 12px; color: var(--ink-3); margin-top: 2px; }

/* ============================ 登录页 ============================ */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(900px 500px at 12% -8%, rgba(109, 124, 255, .55), transparent 60%),
    radial-gradient(700px 500px at 108% 108%, rgba(167, 139, 250, .45), transparent 55%),
    linear-gradient(150deg, #141c33 0%, #0a1020 100%);
}
.login-card {
  width: 100%;
  max-width: 396px;
  background: rgba(255, 255, 255, .97);
  border-radius: 20px;
  padding: 34px 32px 30px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, .4);
}
.login-logo {
  width: 46px; height: 46px;
  border-radius: 13px;
  background: linear-gradient(135deg, #6b7cff, #a78bfa);
  display: grid; place-items: center;
  font-size: 22px;
  margin-bottom: 16px;
}
.login-card h1 { font-size: 21px; margin: 0 0 5px; font-weight: 750; }
.login-card .sub { font-size: 13px; color: var(--ink-3); margin-bottom: 24px; line-height: 1.6; }
.form-item { margin-bottom: 15px; }
.form-item label { display: block; font-size: 12.5px; font-weight: 700; color: var(--ink-2); margin-bottom: 6px; }
.btn-block { width: 100%; padding: 11px; font-size: 14.5px; }
.login-err {
  font-size: 12.5px;
  color: var(--danger);
  margin-top: 10px;
  min-height: 18px;
}
.login-hint {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.8;
}
.login-hint code {
  background: #f0f3f9;
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 11.5px;
  color: #2f3f8f;
  font-family: ui-monospace, Consolas, monospace;
}

/* ============================ 响应式 ============================ */
.menu-btn { display: none; }

@media (max-width: 1080px) {
  .grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 820px) {
  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    z-index: 60;
    transform: translateX(-100%);
    transition: transform .25s ease;
    box-shadow: 0 0 40px rgba(0, 0, 0, .4);
  }
  .sidebar.open { transform: translateX(0); }
  .menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    border-radius: 9px;
    border: 1px solid var(--line);
    background: #fff;
    cursor: pointer;
    font-size: 17px;
  }
  .topbar { padding: 0 16px; height: 58px; }
  .content { padding: 18px 16px 56px; }
  .grid-3, .grid-2, .grid-4, .grid-5 { grid-template-columns: 1fr; }
  .filters { grid-template-columns: 1fr; }
  .scrim {
    position: fixed; inset: 0;
    background: rgba(10, 16, 32, .45);
    z-index: 55;
    opacity: 0; pointer-events: none; transition: opacity .25s;
  }
  .scrim.on { opacity: 1; pointer-events: auto; }
}

/* ============================ 打印 ============================ */
@media print {
  .sidebar, .topbar-actions, .pager, .filters, .menu-btn { display: none !important; }
  .layout { display: block; }
  .content { padding: 0; max-width: none; }
  .card, .kpi { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
  body { background: #fff; }
}


/* ---------------- 侧栏附加区（问卷站点外链 / 退出登录） ---------------- */
.sidebar-ext {
  margin: 14px 12px 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar-ext a,
.sidebar-ext .logout-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.sidebar-ext a:hover { background: var(--brand-soft); color: var(--brand); }
.sidebar-ext .logout-btn { color: var(--danger); }
.sidebar-ext .logout-btn:hover { background: #fff0f0; }
.sidebar-ext .ico { width: 18px; text-align: center; }
