/* 信淼用户反馈平台 · 样式

   方向：一本做得极工整的台账。
   签名元素：列表左边缘的"票根"——等宽编号 + 贴着左边缘的严重程度色条，
   让整张列表的左沿形成一条有节奏的色带。除此之外一切从简。

   不引外部字体：内网、中文 webfont 体积大、国内 CDN 不稳。
   性格靠排版处理（等宽数字、疏排小标签、克制的层级）来给。
*/

:root {
  --topbar-h: 56px;
  --page-max: 1040px;

  /* 墨色 */
  --ink: #16191d;
  --ink-2: #5a6472;
  --faint: #8c95a3;

  /* 纸面 */
  --bg: #f4f5f7;
  --surface: #ffffff;
  --line: #e3e6ea;
  --line-soft: #eef0f3;
  --field-line: #d5dae1;
  --head-band: #f8f9fb;

  /* 唯一的主色，只用在动作、链接、聚焦环 */
  --accent: #4338ca;
  --accent-dark: #3730a3;
  --accent-soft: #eef2ff;

  /* 语义色 */
  /* 严重程度四档，颜色从红到灰一路降低存在感 */
  --p0: #b42318; /* 紧急 */
  --p1: #c2410c; /* 严重 */
  --p2: #b54708; /* 一般 */
  --p3: #667085; /* 建议 */
  --st-open: #475467;
  --st-doing: #b54708;
  --st-done: #067647;
  --st-wontfix: #98a2b3;

  --radius: 8px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 2px 4px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .06);
  --ring: 0 0 0 3px rgba(67, 56, 202, .14);

  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
        "Microsoft YaHei", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* 数字、编号、日期一律等宽对齐 */
.mono, .code, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* 疏排小标签：中文排版里给"标签"的一种克制性格 */
.eyebrow,
table.grid thead th,
.fieldlabel,
.form label > span,
.shotbox-hint {
  letter-spacing: .06em;
}

/* ---------------------------------------------------------------- 顶栏 */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--topbar-h);
  background: rgba(255, 255, 255, .93);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}

/* 顶栏内容与正文同宽，宽屏下不会一个贴左一个居中 */
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--page-max);
  height: 100%;
  margin: 0 auto;
  padding: 0 28px;
}

.brand {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--ink);
  text-decoration: none;
}
.brand:hover { text-decoration: none; }

.userbox { display: flex; align-items: center; gap: 14px; }

/* ---------------------------------------------------------------- 版面 */

.page { max-width: var(--page-max); margin: 0 auto; padding: 26px 28px 72px; }

h1 { margin: 0 0 6px; font-size: 21px; font-weight: 600; letter-spacing: -.005em; }
h2 { margin: 0 0 12px; font-size: 13px; font-weight: 600; color: var(--ink-2); letter-spacing: .04em; }

.muted { color: var(--ink-2); }
.hint { margin: 6px 0 0; font-size: 12.5px; color: var(--faint); }

.eyebrow {
  display: block;
  margin-bottom: 6px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--faint);
  letter-spacing: .14em;
}

.card {
  padding: 20px 22px;
  margin-bottom: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card.narrow {
  max-width: 396px;
  margin: 80px auto 0;
  padding: 30px 28px 28px;
  box-shadow: var(--shadow);
}
.card.narrow h1 { margin-bottom: 8px; font-size: 22px; }

.pagehead { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 18px; }
.pagehead h1 { margin: 0; }

/* ---------------------------------------------------------------- 表单 */

input[type="text"],
input[type="password"],
input[type="search"],
input:not([type]),
select,
textarea {
  width: 100%;
  padding: 9px 12px;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--field-line);
  border-radius: var(--radius);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: 0;
  border-color: var(--accent);
  box-shadow: var(--ring);
}
textarea { resize: vertical; line-height: 1.65; }

.form { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.form label,
.fieldlabel { display: flex; flex-direction: column; gap: 7px; font-size: 12.5px; color: var(--faint); }

.row { display: flex; gap: 20px; align-items: flex-start; }
.row .field { flex: 1; }
/* 提交页：项目要宽一些，严重程度和类型短，别平均分配 */
.submitrow .field:first-child { flex: 1.7; }
/* 详情页的"处理"卡片：两个小选择，别拉满整行 */
.process-row .field { flex: 0 0 200px; }
.fielderr { font-size: 12.5px; color: var(--p0); }

.radios { padding-top: 9px; }
/* Django 的 RadioSelect 会把每个选项包在 div 里，这里把嵌套的 div 全拉平成一行 */
.radios, .radios div { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; }
.radios label { flex-direction: row; align-items: center; gap: 6px; font-size: 14px; color: var(--ink); }
.radios input { width: auto; }

/* ---------------------------------------------------------------- 按钮 */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 14px;
  font: inherit;
  font-size: 13.5px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--field-line);
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.btn:hover { background: #fafbfc; border-color: #c3cad3; text-decoration: none; }
.btn.primary {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}
.btn.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn.small { height: 26px; padding: 0 9px; font-size: 12.5px; }
.btn.disabled { color: #c3cad3; cursor: default; }
.btn.disabled:hover { background: #fff; border-color: var(--field-line); }

.linkbtn {
  padding: 0;
  font: inherit;
  font-size: 13px;
  color: var(--ink-2);
  background: none;
  border: 0;
  cursor: pointer;
  text-decoration: none;
}
.linkbtn:hover { color: var(--ink); text-decoration: none; }

/* ---------------------------------------------------------------- 提示 */

.alert {
  margin: 0;
  padding: 11px 14px;
  font-size: 13.5px;
  color: #912018;
  background: #fff6f5;
  border: 1px solid #fbd5d1;
  border-left: 3px solid var(--p0);
  border-radius: var(--radius);
}

/* 中性说明：不是错误，只是要告诉你一件事 */
.note {
  margin: 0;
  padding: 11px 14px;
  font-size: 13px;
  color: var(--ink-2);
  background: #f8f9fb;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
}

.flash { margin-bottom: 16px; }
.flash-item {
  margin: 0 0 8px;
  padding: 11px 14px;
  font-size: 13.5px;
  color: #05603a;
  background: #f2fdf6;
  border: 1px solid #c3ebd4;
  border-left: 3px solid var(--st-done);
  border-radius: var(--radius);
  animation: xm-drop .22s ease-out;
}
.flash-item.error,
.flash-item.warning {
  color: #8a4b08;
  background: #fffbf0;
  border-color: #f5e0b4;
  border-left-color: var(--st-doing);
}

@keyframes xm-drop {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}

/* ---------------------------------------------------------------- 工具栏 */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 11px 13px;
  margin-bottom: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.filters select { width: auto; padding: 6px 10px; font-size: 13px; }
.filters input[type="search"] { flex: 1; min-width: 190px; padding: 6px 11px; font-size: 13px; }
.filters .btn { height: 32px; }

.listmeta { margin-bottom: 10px; font-size: 12.5px; color: var(--faint); }

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 18px;
  font-size: 13px;
}
.pager .num { color: var(--faint); }

/* ---------------------------------------------------------------- 台账表格 */

table.grid {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  border-collapse: separate;
  border-spacing: 0;
  box-shadow: var(--shadow-sm);
  table-layout: fixed;
}

/* 列宽定死：标题吃掉剩余宽度，元数据列紧凑排在一起 */
table.grid th:nth-child(1) { width: 152px; }
table.grid th:nth-child(3) { width: 62px; }
table.grid th:nth-child(4) { width: 96px; }
table.grid th:nth-child(5) { width: 104px; }
table.grid th:nth-child(6) { width: 92px; }
table.grid th:nth-child(7) { width: 124px; }

table.grid thead th {
  position: sticky;
  top: var(--topbar-h);
  z-index: 2;
  padding: 10px 14px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--faint);
  text-align: left;
  white-space: nowrap;
  background: var(--head-band);
  box-shadow: inset 0 -1px 0 var(--line), inset 0 1px 0 var(--line);
}
table.grid thead th:first-child { border-top-left-radius: var(--radius); }
table.grid thead th:last-child { border-top-right-radius: var(--radius); }

table.grid td {
  padding: 10px 14px;
  vertical-align: middle;
  border-bottom: 1px solid var(--line-soft);
}

/* 标题单行显示，过长省略，鼠标悬停能看到完整内容 */
table.grid td.title a {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
table.grid tbody tr:last-child td { border-bottom: 0; }
table.grid tbody tr:last-child td:first-child { border-bottom-left-radius: var(--radius); }
table.grid tbody tr:last-child td:last-child { border-bottom-right-radius: var(--radius); }

table.grid tbody tr { transition: background .12s; }
table.grid tbody tr:hover { background: #fafbfc; }
table.grid td a { color: var(--ink); }
table.grid td a:hover { color: var(--accent); text-decoration: none; }

/* 票根：编号 + 贴着左沿的严重程度色条 */
td.ticket { position: relative; padding-left: 17px; white-space: nowrap; }
td.ticket::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--ticket, var(--p2));
}
td.ticket.sev-P0 { --ticket: var(--p0); }
td.ticket.sev-P1 { --ticket: var(--p1); }
td.ticket.sev-P2 { --ticket: var(--p2); }
td.ticket.sev-P3 { --ticket: var(--p3); }

td.ticket .code { font-size: 12.5px; font-weight: 500; color: var(--ink); }
td.ticket .inlineform { display: inline; }

/* 严重程度：管理员这里是个下拉，但看起来只是一小段等宽文字 */
select.sev-inline,
.sev-text {
  display: inline-block;
  width: auto;
  margin-left: 7px;
  padding: 1px 4px;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: .04em;
  border: 0;
  border-radius: 4px;
}
select.sev-inline { cursor: pointer; appearance: none; }
select.sev-inline:hover { filter: brightness(.96); }
select.sev-inline:focus { outline: 0; box-shadow: var(--ring); }
select.sev-inline.sev-P0, .sev-text.sev-P0 { color: var(--p0); background: #fff5f5; }
select.sev-inline.sev-P1, .sev-text.sev-P1 { color: var(--p1); background: #fff5ed; }
select.sev-inline.sev-P2, .sev-text.sev-P2 { color: var(--p2); background: #fffaeb; }
select.sev-inline.sev-P3, .sev-text.sev-P3 { color: var(--p3); background: #f2f4f7; }

/* 状态 */
/* 严重程度：详情页那几处用色块，列表里走左边的票根 */
.sev {
  display: inline-block;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  border-radius: 5px;
}
.sev.sev-P0 { color: var(--p0); background: #fff5f5; }
.sev.sev-P1 { color: var(--p1); background: #fff5ed; }
.sev.sev-P2 { color: var(--p2); background: #fffaeb; }
.sev.sev-P3 { color: var(--p3); background: #f4f5f7; }

.st {
  display: inline-block;
  padding: 2px 8px;
  font-size: 12px;
  white-space: nowrap;
  border-radius: 5px;
}
/* 待处理是最常见、而且"还要做"的状态，对比度给足 */
.st-open    { color: #344054; background: #e9ecf1; }
.st-doing   { color: var(--st-doing);   background: #fff3e6; }
.st-verify  { color: #6941c6; background: #f4f0ff; }
.st-done    { color: var(--st-done);    background: #eafaf1; }
/* 不处理是收起来的状态，让它安静下来，只留文字 */
.st-wontfix { color: var(--st-wontfix); background: transparent; padding-left: 0; padding-right: 0; }

.inlineform { margin: 0; }
select.st-inline {
  display: inline-block;
  width: auto;
  padding: 2px 8px;
  font: inherit;
  font-size: 12px;
  border: 0;
  border-radius: 5px;
  cursor: pointer;
  appearance: none;
}
select.st-inline:hover { filter: brightness(.97); }
select.st-inline:focus { outline: 0; box-shadow: var(--ring); }
select.st-inline.st-open    { color: #344054; background: #e9ecf1; }
select.st-inline.st-doing   { color: var(--st-doing);   background: #fff3e6; }
select.st-inline.st-verify  { color: #6941c6; background: #f4f0ff; }
select.st-inline.st-done    { color: var(--st-done);    background: #eafaf1; }
select.st-inline.st-wontfix { color: var(--st-wontfix); background: transparent; }

.count { font-family: var(--mono); font-size: 12px; color: var(--faint); }

/* ---------------------------------------------------------------- 空状态 */

/* 个人信息这类只有两三个字段的页面，别拉满整屏 */
.profilecol { max-width: 520px; }

.readonly {
  padding: 9px 12px;
  font-family: var(--mono);
  color: var(--ink-2);
  background: #f6f7f9;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.linkrow { display: flex; flex-wrap: wrap; gap: 10px; }

.empty {
  padding: 54px 20px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.empty p { margin: 0 0 16px; color: var(--ink-2); }

/* ---------------------------------------------------------------- 截图输入区 */

.shotbox {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  min-height: 46px;
  padding: 8px 12px;
  background: #fff;
  border: 1px solid var(--field-line);
  border-radius: var(--radius);
  cursor: text;
  transition: border-color .15s, box-shadow .15s;
}
.shotbox:hover { border-color: #c3cad3; }
.shotbox:focus,
.shotbox:focus-within { outline: 0; border-color: var(--accent); box-shadow: var(--ring); }
.shotbox.small { min-height: 40px; padding: 6px 10px; }

/* 一旦有附件了，"粘贴或点击加号…"就收起来，全部删光才回来 */
.shotbox.has-files .caret,
.shotbox.has-files .shotbox-hint { display: none; }

/* 那条会闪的竖线：告诉用户图片贴在这里 */
.caret {
  flex: none;
  width: 2px;
  height: 16px;
  background: var(--accent);
  border-radius: 1px;
  animation: xm-blink 1.15s step-end infinite;
}
.shotbox:focus .caret { height: 18px; animation: none; }

@keyframes xm-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.shotbox-hint { font-size: 13px; color: var(--faint); }

.plus {
  flex: none;
  width: 28px;
  height: 28px;
  margin-left: auto;
  padding: 0;
  font-size: 17px;
  line-height: 1;
  color: var(--ink-2);
  background: #f4f5f7;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.plus:hover { color: var(--accent); background: var(--accent-soft); border-color: #c7cbff; }

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

.thumb {
  position: relative;
  width: 64px;
  height: 64px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.thumb video { display: block; width: 100%; height: 100%; object-fit: cover; background: #000; }
.thumb-video::after {
  content: "▶";
  position: absolute;
  right: 4px;
  bottom: 2px;
  font-size: 10px;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .8);
  pointer-events: none;
}
.thumbdel {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  padding: 0;
  font-size: 12px;
  line-height: 16px;
  color: #fff;
  background: rgba(16, 20, 26, .6);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}
.thumbdel:hover { background: rgba(16, 20, 26, .85); }

/* 上传进度：贴在缩略图底部的一条细线 */
.thumbprog {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  background: var(--accent);
  transition: width .2s;
}
.thumb-failed { border-color: var(--p0); }
.thumbretry {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 2px 8px;
  font: inherit;
  font-size: 11px;
  color: #fff;
  background: rgba(180, 35, 24, .9);
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}

/* ---------------------------------------------------------------- 详情页 */

.backlink { display: inline-block; margin-bottom: 14px; font-size: 13px; color: var(--ink-2); }
.backlink:hover { color: var(--ink); text-decoration: none; }

.detailhead { margin-bottom: 18px; }
.detailhead h1 { margin: 8px 0 12px; font-size: 23px; }
.code { font-size: 12.5px; color: var(--faint); }
.metabar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; font-size: 13px; color: var(--ink-2); }

.pre { white-space: pre-wrap; word-break: break-word; }

.shots { display: flex; flex-wrap: wrap; gap: 12px; }
.shots img {
  display: block;
  max-width: 220px;
  max-height: 220px;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.shots.small img { max-width: 140px; max-height: 140px; }

/* 视频就地播放，不弹浮层 */
.shotvideo {
  display: block;
  max-width: 320px;
  max-height: 240px;
  background: #000;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.shots.small .shotvideo { max-width: 220px; max-height: 170px; }

img.zoomable { cursor: zoom-in; transition: box-shadow .15s; }
img.zoomable:hover { box-shadow: var(--shadow); }

.reply {
  padding: 2px 0 2px 14px;
  margin-bottom: 16px;
  border-left: 3px solid var(--line);
}
.reply-admin { border-left-color: var(--accent); }

.replyhead { display: flex; gap: 8px; align-items: baseline; margin-bottom: 4px; font-size: 13px; }
.replyhead .who { font-weight: 600; }
.replyhead .when { font-family: var(--mono); font-size: 12px; color: var(--faint); }

.tag {
  padding: 1px 6px;
  font-size: 11.5px;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 4px;
}

.replyform { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }

/* 状态流转记录 */
.changes { margin: 0; padding: 0; list-style: none; font-size: 13px; }
.changes li { padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.changes li:last-child { border-bottom: 0; }
.changes .when { margin-right: 8px; font-family: var(--mono); font-size: 12px; color: var(--faint); }
.changes .who { margin-right: 6px; font-weight: 600; }
.changenote {
  margin: 6px 0 0;
  padding: 8px 10px;
  font-size: 13px;
  color: var(--ink-2);
  background: #f8f9fb;
  border-radius: 6px;
}

/* ---------------------------------------------------------------- 看大图 */

.lightbox {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: rgba(16, 20, 26, .78);
  cursor: zoom-out;
  animation: xm-fade .14s ease-out;
}
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 12px 60px rgba(0, 0, 0, .5);
}
.lightbox video {
  max-width: 100%;
  max-height: 100%;
  background: #000;
  border-radius: 6px;
  box-shadow: 0 12px 60px rgba(0, 0, 0, .5);
}

@keyframes xm-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
