/* 意见收件箱 · 界面样式 v2 */
:root {
  --bg: #f5f6fa;
  --bg-glow-1: rgba(74, 108, 247, .10);
  --bg-glow-2: rgba(120, 190, 255, .12);
  --surface: #ffffff;
  --surface-2: #fafbfe;
  --ink: #0e1220;
  --ink-2: #4b5468;
  --ink-3: #8a92a6;
  --line: #e7eaf2;
  --line-strong: #d8deeb;
  --brand: #3a5ef5;
  --brand-2: #2743cf;
  --brand-soft: #eef2ff;
  --brand-ink: #2c4ad4;
  --ok: #0f9d58;
  --ok-soft: #e8f7ef;
  --warn: #b9761b;
  --warn-soft: #fdf4e5;
  --danger: #d13b3b;
  --danger-soft: #fdecec;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow-1: 0 1px 2px rgba(14, 18, 32, .04);
  --shadow-2: 0 2px 6px rgba(14, 18, 32, .04), 0 14px 34px rgba(14, 18, 32, .06);
  --shadow-3: 0 2px 8px rgba(58, 94, 245, .24), 0 10px 28px rgba(58, 94, 245, .24);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0f17;
    --bg-glow-1: rgba(74, 108, 247, .16);
    --bg-glow-2: rgba(28, 92, 180, .16);
    --surface: #151a26;
    --surface-2: #11151f;
    --ink: #eef1f7;
    --ink-2: #a7b0c4;
    --ink-3: #6f7889;
    --line: #242b3a;
    --line-strong: #333c50;
    --brand: #5c7bff;
    --brand-2: #4462ff;
    --brand-soft: #1a2138;
    --brand-ink: #9db0ff;
    --ok: #4ecb8a;
    --ok-soft: #122a1f;
    --warn: #e0a54a;
    --warn-soft: #2a2113;
    --danger: #ef6b6b;
    --danger-soft: #2b1717;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-2: 0 2px 8px rgba(0, 0, 0, .35), 0 16px 36px rgba(0, 0, 0, .35);
    --shadow-3: 0 2px 10px rgba(58, 94, 245, .4), 0 12px 30px rgba(58, 94, 245, .3);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* 背景光晕 */
.glow {
  position: fixed;
  inset: -30% -10% auto -10%;
  height: 620px;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(560px 340px at 22% 8%, var(--bg-glow-1), transparent 68%),
    radial-gradient(640px 380px at 82% 0%, var(--bg-glow-2), transparent 70%);
}

.wrap {
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
  padding: 40px 18px 64px;
}

/* ---------------- 头部 ---------------- */
.hero { padding: 0 2px 24px; }

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(145deg, #5b7cff, #2f52e8);
  box-shadow: 0 6px 18px rgba(48, 82, 232, .32);
  margin-bottom: 18px;
}

.brand-mark svg {
  width: 24px;
  height: 24px;
  display: block;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: 28px;
  line-height: 1.25;
  letter-spacing: -.028em;
  font-weight: 700;
}

.hero .sub {
  margin: 0;
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.7;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ok);
  background: var(--ok-soft);
  border-radius: 999px;
  padding: 4px 11px 4px 9px;
  margin-bottom: 14px;
  letter-spacing: .01em;
}

.status-pill i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(15, 157, 88, .14);
  animation: pulse 2.4s ease-in-out infinite;
}

.status-pill.closed { color: var(--ink-3); background: var(--surface-2); }
.status-pill.closed i { background: var(--ink-3); box-shadow: none; animation: none; }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(15, 157, 88, .14); }
  50% { box-shadow: 0 0 0 5px rgba(15, 157, 88, .05); }
}

/* ---------------- 卡片 ---------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-2);
  padding: 22px;
}

/* ---------------- 表单 ---------------- */
.lbl {
  display: block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--ink-3);
  margin-bottom: 10px;
  text-transform: none;
}

textarea,
input[type="text"],
input[type="password"],
input[type="search"] {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 15px;
  outline: none;
  transition: border-color .18s, box-shadow .18s, background .18s;
  appearance: none;
}

textarea {
  min-height: 160px;
  resize: vertical;
  line-height: 1.7;
}

textarea:focus,
input:focus {
  background: var(--surface);
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft);
}

textarea::placeholder,
input::placeholder { color: var(--ink-3); opacity: .85; }

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.count {
  font-size: 12.5px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  flex: none;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-2);
}

.count.over { color: var(--danger); background: var(--danger-soft); }

/* 分类 */
.chips { display: flex; gap: 7px; flex-wrap: wrap; }

.chip {
  font: inherit;
  font-size: 13.5px;
  line-height: 1;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 9px 15px;
  cursor: pointer;
  transition: all .16s ease;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}

.chip:hover { border-color: var(--brand); color: var(--brand-ink); background: var(--brand-soft); }

.chip.on {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(58, 94, 245, .26);
}

/* 按钮 */
.btn {
  font: inherit;
  font-size: 14.5px;
  font-weight: 500;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: 10px 17px;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .18s, background .18s, border-color .18s;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}

.btn:hover { background: var(--surface-2); border-color: var(--ink-3); }
.btn:active { transform: scale(.985); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.btn.primary {
  width: 100%;
  margin-top: 20px;
  padding: 15px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .01em;
  color: #fff;
  background: linear-gradient(180deg, #4a6dfa, var(--brand));
  border: none;
  box-shadow: var(--shadow-3);
}

.btn.primary:hover { background: linear-gradient(180deg, #5a7bff, var(--brand-2)); }
.btn.primary:active { box-shadow: 0 2px 8px rgba(58, 94, 245, .3); }

.btn.sm { padding: 7px 12px; font-size: 13.5px; border-radius: 10px; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-2); border-color: var(--line); }
.btn.danger { color: var(--danger); border-color: transparent; background: var(--danger-soft); }
.btn.danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn.ok { color: var(--ok); border-color: transparent; background: var(--ok-soft); }
.btn.ok:hover { border-color: var(--ok); background: var(--ok-soft); }

/* 提示 */
.hint {
  margin: 12px 0 0;
  font-size: 13.5px;
  color: var(--danger);
}

.hint:empty { display: none; }

.hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* ---------------- 成功 / 关闭 ---------------- */
.done { text-align: center; padding: 40px 24px; }

.done .check {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--ok-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  animation: pop .38s cubic-bezier(.34, 1.56, .64, 1);
}

.done .check svg { width: 30px; height: 30px; }

.done .check path {
  stroke: var(--ok);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  stroke-dasharray: 30;
  stroke-dashoffset: 30;
  animation: draw .5s .12s ease forwards;
}

@keyframes pop {
  from { transform: scale(.7); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes draw { to { stroke-dashoffset: 0; } }

.done h2 { margin: 0 0 8px; font-size: 21px; letter-spacing: -.02em; }
.done p { margin: 0 0 24px; color: var(--ink-2); font-size: 15px; }
.done .btn { width: auto; margin: 0; }

#closed h2 { margin: 0 0 8px; font-size: 19px; letter-spacing: -.02em; }

/* ---------------- 页脚 ---------------- */
.foot {
  margin-top: 28px;
  text-align: center;
  font-size: 12.5px;
  line-height: 2;
  color: var(--ink-3);
}

/* ---------------- 管理后台 ---------------- */
body.admin .wrap { max-width: 880px; padding-top: 32px; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.topbar h1 { margin: 0; font-size: 22px; letter-spacing: -.022em; }
.topbar .actions { display: flex; gap: 8px; flex-wrap: wrap; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 15px 16px;
  box-shadow: var(--shadow-1);
}

.stat .k { font-size: 12.5px; color: var(--ink-3); margin-bottom: 2px; }

.stat .v {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.stat .v.accent { color: var(--brand); }

.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.toolbar input[type="search"] { flex: 1 1 220px; padding: 10px 14px; border-radius: 999px; }

.list { display: flex; flex-direction: column; gap: 12px; }

.item {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-1);
  padding: 16px 18px 16px 20px;
  transition: box-shadow .18s ease, border-color .18s ease;
  overflow: hidden;
}

.item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--brand);
  opacity: .85;
}

.item:hover { box-shadow: var(--shadow-2); border-color: var(--line-strong); }

.item.is-done { background: var(--surface-2); }
.item.is-done::before { background: var(--line-strong); }
.item.is-done .text { color: var(--ink-2); }

.item .meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 9px;
  font-size: 12px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.tag {
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 7px;
  background: var(--brand-soft);
  color: var(--brand-ink);
}

.tag.gray { background: var(--surface-2); color: var(--ink-2); }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }

.item .text {
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0 0 14px;
  font-size: 15.5px;
  line-height: 1.72;
}

.item .ops { display: flex; gap: 8px; flex-wrap: wrap; }

.empty {
  text-align: center;
  color: var(--ink-3);
  padding: 64px 20px;
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  font-size: 14.5px;
}

/* 登录 */
.login { max-width: 412px; margin: 8vh auto 0; }

.login-head { margin-bottom: 22px; }

.login-head .brand-mark {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  border-radius: 15px;
}

.login h1 { font-size: 24px; margin: 0 0 8px; letter-spacing: -.026em; }
.login p.sub { color: var(--ink-2); font-size: 14px; line-height: 1.7; margin: 0; }
.login .btn.primary { margin-top: 18px; }

.login code {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Courier New", monospace;
  font-size: .9em;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
  white-space: nowrap;
}

/* 管理员账号列表 */
.user-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 4px;
}

.user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-2);
}

.user-row.is-off { opacity: .62; }

.user-name {
  font-weight: 600;
  font-size: 14.5px;
  word-break: break-all;
}

.user-tags { display: flex; gap: 6px; flex-wrap: wrap; }

.user-ops {
  margin-left: auto;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.user-ops .btn { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }

.row-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }

.field-gap { margin-top: 18px; }

.user-empty {
  color: var(--ink-3);
  font-size: 13.5px;
  padding: 6px 2px;
}

/* 根域名占位页 */
.placeholder-note {
  margin: 0;
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.9;
}

/* 表单字段 */
.field { margin-bottom: 14px; }
.field .lbl { margin-bottom: 7px; }
.field:last-of-type { margin-bottom: 0; }

/* 密码输入（可切换显示） */
.pw-field { position: relative; }

.pw-field input { padding-right: 50px; }

.pw-toggle {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
  transition: color .16s, background .16s;
  -webkit-tap-highlight-color: transparent;
}

.pw-toggle:hover { color: var(--ink); background: var(--surface-2); }
.pw-toggle:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.pw-toggle svg { width: 20px; height: 20px; display: block; }

.pw-toggle .eye-open { display: none; }
.pw-toggle.is-shown { color: var(--brand); }
.pw-toggle.is-shown .eye-open { display: block; }
.pw-toggle.is-shown .eye-off { display: none; }

.caps-hint {
  margin: 9px 0 0;
  font-size: 12.5px;
  color: var(--warn);
}

.caps-hint[hidden] { display: none; }

.remember {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
  user-select: none;
  line-height: 1.5;
}

.remember input {
  width: 16px;
  height: 16px;
  flex: none;
  margin: 0;
  accent-color: var(--brand);
  cursor: pointer;
}

/* 设置 */
.settings { margin-top: 20px; }
.settings .field { margin-bottom: 14px; }
.settings .lbl { margin-bottom: 7px; }
.settings h2.lbl { margin-top: 0; font-size: 15px; color: var(--ink); }

.divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 24px 0 20px;
}

/* toast */
#toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translate(-50%, 16px);
  background: rgba(17, 21, 32, .94);
  color: #fff;
  font-size: 13.5px;
  padding: 10px 18px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 60;
  max-width: 86vw;
  text-align: center;
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
}

#toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 640px) {
  .wrap { padding: 28px 14px 52px; }
  .hero h1 { font-size: 24px; }
  .card { padding: 18px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .item { padding: 14px 14px 14px 17px; }
  .topbar h1 { font-size: 19px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
