/* ============================================================
   SHANLING 反馈管理 · 现代设计系统
   ============================================================ */
:root {
  --primary: #007CC3;
  --primary-hover: #0090dd;
  --primary-soft: #e8f3fb;
  --sidebar-bg: #0f1d2e;
  --sidebar-hover: rgba(255,255,255,.06);
  --sidebar-active: rgba(0,124,195,.25);
  --sidebar-text: #8ba0b8;
  --bg: #f5f7fa;
  --card: #ffffff;
  --text: #1c2b3a;
  --muted: #67788f;
  --muted-2: #93a3b5;
  --border: #e6ecf3;
  --danger: #d92d20;
  --danger-soft: #fef1f0;
  --success: #12805c;
  --success-soft: #e9f7f0;
  --warning-soft: #fdf4e3;
  --warning: #b25e09;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(16,24,40,.05);
  --shadow-md: 0 8px 28px rgba(16,24,40,.08);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
::placeholder { color: var(--muted-2); }

/* ============ 布局：侧边栏 + 主区 ============ */
.app { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: 232px; background: var(--sidebar-bg);
  display: flex; flex-direction: column;
  z-index: 100;
}
.main { flex: 1; margin-left: 232px; padding: 28px 32px 48px; min-width: 0; }
@media (max-width: 900px) {
  .sidebar { display: none; }
  .main { margin-left: 0; padding: 20px 16px 40px; }
}

/* 侧边栏内部 */
.brand {
  display: flex; align-items: center; gap: 12px;
  padding: 22px 20px 20px;
}
.brand-icon {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, #007CC3, #00b3f4);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 18px;
  box-shadow: 0 4px 12px rgba(0,124,195,.35);
}
.brand-name { color: #fff; font-weight: 700; font-size: 15px; letter-spacing: .5px; display: block; }
.brand-sub { color: var(--sidebar-text); font-size: 11px; display: block; margin-top: 1px; }

.side-nav { padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.side-nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 9px;
  color: var(--sidebar-text); font-size: 13.5px; font-weight: 500;
  transition: all .15s ease;
}
.side-nav a i { font-size: 16px; }
.side-nav a:hover { background: var(--sidebar-hover); color: #dce6f2; }
.side-nav a.active {
  background: var(--sidebar-active); color: #fff;
  box-shadow: inset 2.5px 0 0 var(--primary);
}

.side-foot {
  margin-top: auto; padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.07);
  display: flex; align-items: center; gap: 11px;
}
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, #2c91c9, #1478ad);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 13px; flex-shrink: 0;
}
.side-user { flex: 1; min-width: 0; }
.side-user .name { color: #dce6f2; font-size: 13px; font-weight: 500; display: block; }
.side-user .logout { color: var(--sidebar-text); font-size: 11.5px; }
.side-user .logout:hover { color: #ff9d94; }

/* ============ 页头 ============ */
.page-head { margin-bottom: 22px; }
.page-title { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.page-sub { color: var(--muted); font-size: 13px; margin-top: 3px; }

/* ============ 统计卡片 ============ */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
@media (max-width: 1200px) { .stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .stats { grid-template-columns: 1fr; } }
.stat {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
  padding: 18px 20px; display: flex; align-items: center; gap: 14px;
  transition: box-shadow .2s ease, transform .2s ease;
}
.stat:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-icon {
  width: 42px; height: 42px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; flex-shrink: 0;
}
.stat-icon.blue   { background: var(--primary-soft); color: var(--primary); }
.stat-icon.red    { background: var(--danger-soft);  color: var(--danger); }
.stat-icon.green  { background: var(--success-soft); color: var(--success); }
.stat-icon.gray   { background: #eef1f5; color: var(--muted); }
.stat-num { font-size: 22px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.stat-label { color: var(--muted); font-size: 12px; margin-top: 2px; }

/* ============ 卡片容器 ============ */
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
}
.card-head {
  padding: 15px 20px; border-bottom: 1px solid var(--border);
  font-weight: 600; font-size: 14px;
  display: flex; align-items: center; gap: 8px;
}
.card-head i { color: var(--primary); font-size: 15px; }
.card-body { padding: 20px; }

/* ============ 筛选栏 ============ */
.filter-bar { padding: 14px 16px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.filter-bar select, .filter-bar input {
  height: 36px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: #fff; color: var(--text); font-family: var(--font); font-size: 13px;
  padding: 0 12px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.filter-bar select { cursor: pointer; }
.filter-bar input:focus, .filter-bar select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,124,195,.13);
}
.filter-bar .kw { width: 230px; }
.filter-spacer { flex: 1; }

/* ============ 按钮 ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 18px; border: none; border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 13.5px; font-weight: 600;
  cursor: pointer; transition: all .15s ease; white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 2px 6px rgba(0,124,195,.3); }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,124,195,.35); }
.btn-light { background: #fff; color: var(--text); border: 1px solid var(--border); }
.btn-light:hover { background: #f6f9fc; border-color: #cdd8e4; }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: #eef1f5; color: var(--text); }
.btn-sm { height: 30px; padding: 0 13px; font-size: 12.5px; }

/* ============ 表格 ============ */
.table-wrap { overflow-x: auto; }
table.modern { width: 100%; border-collapse: collapse; }
table.modern th {
  text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted-2);
  padding: 11px 16px; border-bottom: 1px solid var(--border);
  background: #fafbfd; white-space: nowrap;
}
table.modern td {
  padding: 13px 12px; border-bottom: 1px solid var(--border);
  vertical-align: middle; white-space: nowrap;
}
table.modern tbody tr { transition: background .12s ease; }
table.modern tbody tr:hover { background: #f7fafd; }
table.modern tbody tr:last-child td { border-bottom: none; }
.cell-desc {
  max-width: 260px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; color: var(--text);
}
.cell-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.cell-2line { line-height: 1.4; }
.cell-2line small { color: var(--muted); font-size: 11.5px; display: block; }
.empty-row { text-align: center; color: var(--muted-2); padding: 56px 16px !important; font-size: 13px; }
.empty-row i { font-size: 26px; display: block; margin-bottom: 8px; color: #cdd6e0; }

/* ============ 徽章（柔和色） ============ */
.badge-soft {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .02em; white-space: nowrap;
}
.badge-soft::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.b-gray  { background: #eef1f5; color: #5b6b7e; }
.b-blue  { background: var(--primary-soft); color: var(--primary); }
.b-green { background: var(--success-soft); color: var(--success); }
.b-red   { background: var(--danger-soft); color: var(--danger); }
.b-amber { background: var(--warning-soft); color: var(--warning); }
.tag-plain { background: #f4f6f9; color: var(--muted); padding: 2px 9px; border-radius: 6px; font-size: 12px; }

/* ============ 分页 ============ */
.pager { display: flex; align-items: center; gap: 10px; padding: 14px 16px; justify-content: flex-end; }
.pager-btn {
  width: 32px; height: 32px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); background: #fff; color: var(--text);
  cursor: pointer; text-decoration: none; font-size: 15px; transition: all .15s;
}
.pager-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.pager-btn.disabled { opacity: .4; pointer-events: none; }
.pager-info { color: var(--muted); font-size: 12.5px; }

/* ============ 详情页 ============ */
.crumbs { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.back-btn {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--muted); font-size: 13px; font-weight: 500;
  padding: 6px 12px; border-radius: 8px; transition: all .15s;
}
.back-btn:hover { background: #e9edf3; color: var(--text); }
.ticket-title { font-size: 17px; font-weight: 700; font-family: ui-monospace, Menlo, monospace; letter-spacing: .01em; }
.detail-grid { display: grid; grid-template-columns: 1fr 330px; gap: 18px; align-items: start; }
@media (max-width: 1100px) { .detail-grid { grid-template-columns: 1fr; } }
.detail-stack { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

.feedback-text {
  white-space: pre-wrap; word-break: break-word;
  font-size: 14.5px; line-height: 1.85; color: var(--text);
}
.badge-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }

/* 附件网格 */
.att-grid { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.att-thumb {
  width: 104px; height: 78px; object-fit: cover; border-radius: 9px;
  border: 1px solid var(--border); cursor: pointer;
  transition: all .18s ease; display: block;
}
.att-thumb:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--primary); }
.att-file {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px; border-radius: 9px; border: 1px solid var(--border);
  color: var(--text); font-size: 12.5px; font-weight: 500;
  max-width: 260px; transition: all .15s;
}
.att-file i { color: var(--primary); font-size: 16px; flex-shrink: 0; }
.att-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-file:hover { border-color: var(--primary); background: var(--primary-soft); }
.att-file em { color: var(--muted); font-style: normal; font-size: 11px; flex-shrink: 0; }

/* 信息列表（右侧卡片） */
.info-list { display: flex; flex-direction: column; }
.info-row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 14px;
  padding: 11px 20px; border-bottom: 1px solid var(--border); font-size: 13px;
}
.info-row:last-child { border-bottom: none; }
.info-row dt { color: var(--muted); flex-shrink: 0; }
.info-row dd { text-align: right; word-break: break-all; }
.info-row dd i.bi-eye { cursor: pointer; color: var(--primary); margin-left: 4px; }

/* 处理记录时间线 */
.timeline { position: relative; padding-left: 22px; }
.timeline::before {
  content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px;
  width: 2px; background: var(--border); border-radius: 1px;
}
.tl-item { position: relative; padding-bottom: 18px; }
.tl-item:last-child { padding-bottom: 2px; }
.tl-dot {
  position: absolute; left: -22px; top: 5px;
  width: 12px; height: 12px; border-radius: 50%;
  background: #fff; border: 3px solid var(--primary);
}
.tl-item.muted .tl-dot { border-color: #c3cedb; }
.tl-head { font-size: 13px; font-weight: 600; }
.tl-head .who { color: var(--text); }
.tl-head .what { color: var(--primary); font-weight: 500; }
.tl-head .arrow { color: var(--muted-2); font-size: 12px; }
.tl-time { color: var(--muted-2); font-size: 11.5px; margin-top: 1px; }
.tl-note {
  margin-top: 6px; padding: 9px 12px; background: #f7f9fc;
  border-radius: 8px; font-size: 12.5px; color: #46586d;
  word-break: break-word;
}

/* 状态流转表单 */
.transition-form { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.transition-form select, .transition-form input[type=text] {
  height: 38px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 0 12px; font-family: var(--font); font-size: 13px; outline: none;
  background: #fff; color: var(--text);
}
.transition-form select { width: 130px; cursor: pointer; }
.transition-form input[type=text] { flex: 1; min-width: 180px; }
.transition-form *:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,124,195,.13); }

.note-form { display: flex; gap: 10px; }
.note-form input {
  flex: 1; height: 38px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 0 14px; font-family: var(--font); font-size: 13px; outline: none;
}
.note-form input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,124,195,.13); }

/* 成功提示 */
.alert-ok {
  display: flex; align-items: center; gap: 8px;
  background: var(--success-soft); color: var(--success);
  padding: 10px 14px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; margin-bottom: 14px;
}

/* ============ 导出弹窗（原生 dialog） ============ */
dialog.dlg {
  border: none; border-radius: 16px; padding: 0;
  box-shadow: 0 24px 64px rgba(16,24,40,.22);
  width: 380px; max-width: calc(100vw - 32px);
}
dialog.dlg::backdrop { background: rgba(15,29,46,.45); backdrop-filter: blur(2px); }
.dlg-inner { padding: 24px; }
.dlg-title { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.dlg-sub { color: var(--muted); font-size: 12.5px; margin-bottom: 18px; }
.dlg-field { margin-bottom: 14px; }
.dlg-field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.dlg-field input {
  width: 100%; height: 40px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 0 13px; font-family: var(--font); font-size: 13.5px; outline: none;
}
.dlg-field input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,124,195,.13); }
.dlg-actions { display: flex; gap: 10px; margin-top: 20px; }
.dlg-actions .btn { flex: 1; height: 40px; }

/* ============ 登录页 ============ */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background:
    radial-gradient(680px 380px at 12% -8%, rgba(0,124,195,.12), transparent 60%),
    radial-gradient(600px 340px at 95% 108%, rgba(0,179,244,.10), transparent 60%),
    var(--bg);
}
.login-card {
  width: 400px; max-width: 100%;
  background: var(--card); border-radius: 18px;
  border: 1px solid var(--border);
  box-shadow: 0 18px 48px rgba(16,24,40,.10);
  padding: 40px 38px 34px;
}
.login-logo {
  width: 54px; height: 54px; border-radius: 14px; margin: 0 auto 18px;
  background: linear-gradient(135deg, #007CC3, #00b3f4);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 25px;
  box-shadow: 0 8px 20px rgba(0,124,195,.35);
}
.login-title { text-align: center; font-size: 19px; font-weight: 700; letter-spacing: .01em; }
.login-sub { text-align: center; color: var(--muted); font-size: 12.5px; margin: 5px 0 26px; }
.login-err {
  display: flex; align-items: center; gap: 8px;
  background: var(--danger-soft); color: var(--danger);
  border-radius: var(--radius-sm); padding: 10px 13px;
  font-size: 13px; margin-bottom: 16px;
}
.login-field { position: relative; margin-bottom: 15px; }
.login-field i {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  color: var(--muted-2); font-size: 14px; pointer-events: none;
}
.login-field input {
  width: 100%; height: 46px; border: 1px solid var(--border); border-radius: 11px;
  padding: 0 14px 0 44px; font-family: var(--font); font-size: 14px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.login-field input:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3.5px rgba(0,124,195,.13);
}
.login-btn {
  width: 100%; height: 46px; margin-top: 8px; border: none; border-radius: 11px;
  background: var(--primary); color: #fff; font-family: var(--font);
  font-size: 14.5px; font-weight: 600; letter-spacing: .22em; cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,124,195,.32);
  transition: all .18s ease;
}
.login-btn:hover { background: var(--primary-hover); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,124,195,.4); }
.login-foot { text-align: center; color: var(--muted-2); font-size: 11.5px; margin-top: 24px; }

/* ============ 工具类 ============ */
.text-muted { color: var(--muted); }
.text-small { font-size: 12px; }
.mb-16 { margin-bottom: 16px; }
.hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
