/* ==========================================================================
   投诉管理系统 · 基础样式（仿 WeUI 风格，支持浅色 / 深色）
   ========================================================================== */

:root {
  --bg: #f8f8f8;
  --bg-soft: #f2f2f2;
  --card: #ffffff;
  --text: #111111;
  --text-sub: #4a4a4a;
  --muted: #9a9a9a;
  --line: #e8e8e8;
  --line-strong: #d9d9d9;
  --green: #1aad19;
  --green-2: #179b16;
  --green-soft: #ecf8ec;
  --blue: #576b95;
  --danger: #fa5151;
  --danger-soft: #fdeceb;
  --warn: #e08a21;
  --warn-soft: #fdf3e3;
  --info: #10aeff;
  --info-soft: #e8f6ff;
  --mask: rgba(0, 0, 0, .45);
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 18px;
  --radius-full: 999px;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .04);
  --shadow-2: 0 2px 8px rgba(0, 0, 0, .05), 0 12px 32px rgba(0, 0, 0, .07);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-soft: #131313;
    --card: #1c1c1e;
    --text: #f2f2f7;
    --text-sub: #c7c7cc;
    --muted: #8e8e93;
    --line: #333336;
    --line-strong: #454549;
    --green: #07c160;
    --green-2: #06ad56;
    --green-soft: #10301d;
    --blue: #5ac8fa;
    --danger: #ff453a;
    --danger-soft: #33100f;
    --warn: #ff9f0a;
    --warn-soft: #2e2110;
    --info: #0a84ff;
    --info-soft: #0d2333;
    --mask: rgba(0, 0, 0, .65);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .5);
    --shadow-2: 0 2px 8px rgba(0, 0, 0, .5), 0 12px 32px rgba(0, 0, 0, .45);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-size-adjust: 100%;
}

a { color: var(--blue); text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
[hidden] { display: none !important; }
[v-cloak] { display: none; }

/* ---------- 布局 ---------- */
.wrap { max-width: 720px; margin: 0 auto; padding: 0 0 32px; }
.page-title {
  font-size: 15px; color: var(--muted); padding: 20px 16px 8px; font-weight: 400;
}

/* ---------- 卡片 / 分组 ---------- */
.group { margin: 12px 0; background: var(--card); }
.group__title {
  font-size: 14px; color: var(--muted); padding: 16px 16px 8px; background: transparent;
}
.cells { background: var(--card); }
.cell {
  display: flex; align-items: center; gap: 12px;
  padding: 15px 16px; position: relative; background: var(--card);
  min-height: 54px; cursor: default;
}
.cell::after {
  content: ""; position: absolute; left: 16px; right: 0; bottom: 0;
  height: 1px; background: var(--line); transform: scaleY(.5); transform-origin: 0 100%;
}
.cell:last-child::after { display: none; }
.cell--link { cursor: pointer; }
.cell--link:active { background: var(--bg-soft); }
.cell__bd { flex: 1; min-width: 0; }
.cell__label { flex: 0 0 88px; color: var(--text); font-size: 16px; }
.cell__value { flex: 1; min-width: 0; color: var(--text); }
.cell__value--muted { color: var(--muted); }
.cell__arrow { flex: none; color: var(--muted); font-size: 15px; }
.cell__hint { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* ---------- 表单 ---------- */
.input, .textarea, .select {
  width: 100%; border: 0; background: transparent; outline: none;
  font-size: 16px; padding: 4px 0; color: var(--text);
  appearance: none; -webkit-appearance: none;
}
.textarea { resize: none; line-height: 1.6; min-height: 96px; }
.input::placeholder, .textarea::placeholder { color: var(--muted); }
.select { padding-right: 22px; }

.field {
  display: block; padding: 12px 16px; background: var(--card); position: relative;
}
.field + .field::before {
  content: ""; position: absolute; left: 16px; right: 0; top: 0;
  height: 1px; background: var(--line); transform: scaleY(.5); transform-origin: 0 0;
}
.field__label { font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.field__box {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-soft); border-radius: var(--radius-sm); padding: 10px 12px;
}
.field__box .input, .field__box .textarea { padding: 0; }
.field__box--plain { background: transparent; padding: 0; }
.field--row { display: flex; align-items: center; gap: 12px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: var(--radius-sm); padding: 12px 18px;
  font-size: 16px; font-weight: 500; cursor: pointer; background: var(--green);
  color: #fff; transition: opacity .15s, background .15s; line-height: 1.2;
  white-space: nowrap;
}
.btn:active { opacity: .82; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn--block { display: flex; width: 100%; }
.btn--lg { padding: 14px 20px; font-size: 17px; border-radius: var(--radius); }
.btn--ghost { background: transparent; color: var(--text); border: 1px solid var(--line-strong); }
.btn--soft { background: var(--green-soft); color: var(--green-2); }
.btn--plain { background: var(--bg-soft); color: var(--text); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--danger-soft { background: var(--danger-soft); color: var(--danger); }
.btn--blue { background: var(--blue); }
.btn--sm { padding: 7px 12px; font-size: 14px; border-radius: var(--radius-sm); }
.btn--xs { padding: 5px 10px; font-size: 13px; border-radius: var(--radius-sm); }

.btn-area { padding: 20px 16px; }

/* ---------- 标签 ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: var(--radius-full);
  font-size: 12px; line-height: 18px; background: var(--bg-soft); color: var(--muted);
  white-space: nowrap;
}
.tag--pending { background: var(--warn-soft); color: var(--warn); }
.tag--processing { background: var(--info-soft); color: var(--info); }
.tag--resolved { background: var(--green-soft); color: var(--green-2); }
.tag--rejected { background: var(--danger-soft); color: var(--danger); }
.tag--on { background: var(--green-soft); color: var(--green-2); }
.tag--off { background: var(--bg-soft); color: var(--muted); }
.tag--super { background: #efe7ff; color: #7a4ddb; }
@media (prefers-color-scheme: dark) { .tag--super { background: #241a3a; color: #c4a8ff; } }

/* ---------- 提示条 ---------- */
.alert {
  margin: 12px 16px; padding: 12px 14px; border-radius: var(--radius);
  font-size: 14px; line-height: 1.6; display: flex; gap: 8px; align-items: flex-start;
}
.alert--info { background: var(--info-soft); color: var(--text-sub); }
.alert--warn { background: var(--warn-soft); color: var(--text-sub); }
.alert--error { background: var(--danger-soft); color: var(--text-sub); }
.alert--ok { background: var(--green-soft); color: var(--text-sub); }

.empty { padding: 56px 24px; text-align: center; color: var(--muted); font-size: 14px; }
.empty__icon { font-size: 40px; margin-bottom: 10px; opacity: .5; }

.spinner {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--line-strong); border-top-color: var(--green);
  animation: spin .7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 弹层 ---------- */
.mask {
  position: fixed; inset: 0; background: var(--mask); z-index: 900;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fade .18s ease-out;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--card); border-radius: var(--radius-lg); width: 100%; max-width: 460px;
  max-height: 86vh; display: flex; flex-direction: column; overflow: hidden;
  box-shadow: var(--shadow-2); animation: pop .2s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes pop { from { transform: scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }
.modal__hd {
  padding: 18px 20px 12px; font-size: 17px; font-weight: 600;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.modal__bd { padding: 0 20px 8px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.modal__ft { padding: 16px 20px calc(16px + env(safe-area-inset-bottom)); display: flex; gap: 10px; }
.modal__ft .btn { flex: 1; }
.modal__x {
  border: 0; background: transparent; color: var(--muted); font-size: 22px;
  line-height: 1; cursor: pointer; padding: 0 4px;
}

.toast-host {
  position: fixed; left: 50%; top: 18%; transform: translateX(-50%); z-index: 1000;
  display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none;
}
.toast {
  background: rgba(0, 0, 0, .82); color: #fff; padding: 10px 16px; border-radius: 8px;
  font-size: 14px; max-width: 78vw; text-align: center; animation: fade .16s ease-out;
}

/* ---------- 表格（后台） ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td {
  padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--line);
  vertical-align: middle; white-space: nowrap;
}
table.data th {
  color: var(--muted); font-weight: 500; font-size: 13px; background: var(--bg-soft);
  position: sticky; top: 0; z-index: 1;
}
table.data tbody tr:hover { background: var(--bg-soft); }
table.data td.wrap-cell { white-space: normal; min-width: 220px; max-width: 380px; }
.mono { font-family: var(--mono); font-size: 13px; }
.nowrap { white-space: nowrap; }
.text-muted { color: var(--muted); }
.text-danger { color: var(--danger); }
.text-green { color: var(--green); }

/* ---------- 骨架 ---------- */
.skeleton {
  background: linear-gradient(90deg, var(--bg-soft) 25%, var(--line) 37%, var(--bg-soft) 63%);
  background-size: 400% 100%; animation: shimmer 1.3s ease infinite; border-radius: 6px;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
