/* ===== TRsupport v0.2 ===== */
:root {
  --primary: #1e3a8a;
  --primary-light: #3b82f6;
  --bg: #f3f4f6;
  --card: #ffffff;
  --border: #e5e7eb;
  --text: #1f2937;
  --muted: #6b7280;
  --ok: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px; color: var(--text); background: var(--bg);
}
[x-cloak] { display: none !important; }

input, select, textarea, button { font: inherit; color: inherit; }

/* ===== Login ===== */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
}
.login-card {
  width: 360px; padding: 40px 30px; background: white;
  border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  text-align: center;
}
.login-card h1 { margin: 0 0 4px; color: var(--primary); }
.login-card .muted { margin: 0 0 24px; }
.login-card input {
  width: 100%; padding: 10px 12px; margin: 8px 0;
  border: 1px solid var(--border); border-radius: 6px;
}

/* ===== Layout ===== */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px; background: var(--primary); color: white;
  display: flex; flex-direction: column;
}
.brand { padding: 24px 20px 12px; border-bottom: 1px solid rgba(255,255,255,0.15); }
.brand-name { font-size: 20px; font-weight: bold; }
.brand-ver { font-size: 11px; opacity: 0.7; }
.sidebar nav { padding: 12px 0; flex: 1; overflow-y: auto; }
.nav-item {
  display: block; padding: 10px 20px; color: rgba(255,255,255,0.85);
  cursor: pointer; transition: background 0.15s;
  font-size: 14px;
}
.nav-item:hover { background: rgba(255,255,255,0.1); }
.nav-item.active { background: rgba(255,255,255,0.2); color: white; font-weight: 500; }
.nav-item.sub { padding-left: 36px; font-size: 13px; }
.nav-section { font-weight: 500; }
.nav-sub { background: rgba(0,0,0,0.15); }
.sidebar-foot { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.15); }
.sidebar-foot .user-name { font-size: 13px; }
.sidebar-foot .btn-link { color: rgba(255,255,255,0.7); font-size: 12px; }

.main-content {
  flex: 1; padding: 24px; overflow-y: auto; max-height: 100vh;
}

.page-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px;
  flex-wrap: wrap; gap: 12px;
}
.page-header h1 { margin: 0; font-size: 22px; color: var(--primary); }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ===== Filter bar ===== */
.filter-bar {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  margin-bottom: 14px; padding: 10px 14px;
  background: var(--card); border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.filter-bar input, .filter-bar select {
  padding: 7px 10px; border: 1px solid var(--border); border-radius: 5px;
  background: white;
}
.filter-bar input[type="search"] { min-width: 240px; flex: 1; max-width: 320px; }

/* ===== Combobox ===== */
.combobox { position: relative; }
.combobox > input {
  width: 100%; padding: 7px 10px; border: 1px solid var(--border);
  border-radius: 5px; background: white;
  min-width: 140px;
}
.combobox-list {
  position: absolute; z-index: 50; top: calc(100% + 2px); left: 0;
  min-width: 100%; max-width: 320px; max-height: 320px; overflow-y: auto;
  background: white; border: 1px solid var(--border); border-radius: 5px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.combobox-item {
  padding: 7px 12px; cursor: pointer; font-size: 13px;
  border-bottom: 1px solid #f3f4f6;
}
.combobox-item:last-child { border-bottom: 0; }
.combobox-item:hover, .combobox-item.active {
  background: #eff6ff; color: var(--primary);
}

/* ===== Buttons ===== */
.btn-primary, .btn-secondary, .btn-danger {
  padding: 7px 14px; border: 0; border-radius: 5px; cursor: pointer;
  font-weight: 500; transition: all 0.15s;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-light); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-secondary { background: white; color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: #f9fafb; }
.btn-danger { background: var(--danger); color: white; }
.btn-block { display: block; width: 100%; padding: 10px; margin-top: 12px; }
.btn-link {
  background: transparent; border: 0; cursor: pointer; color: var(--info);
  padding: 4px 8px; text-decoration: none; font-size: 13px;
}
.btn-link:hover { text-decoration: underline; }
.btn-link:disabled { opacity: 0.4; cursor: not-allowed; text-decoration: none; }
.btn-link.danger-text { color: var(--danger); }

/* ===== 概览 ===== */
.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px; margin-bottom: 24px;
}
.stat-card {
  background: var(--card); border-left: 4px solid var(--primary);
  padding: 16px; border-radius: 6px; box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.stat-card.warning { border-left-color: var(--warning); }
.stat-card.danger { border-left-color: var(--danger); }
.stat-label { color: var(--muted); font-size: 12px; }
.stat-num { font-size: 28px; font-weight: bold; color: var(--text); margin-top: 4px; }

.card {
  background: var(--card); border-radius: 8px; padding: 18px 20px;
  margin-bottom: 18px; box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.card h3 { margin: 0 0 14px; color: var(--primary); font-size: 16px; }

.sla-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 14px;
}
.sla-item { background: #f9fafb; padding: 12px; border-radius: 6px; text-align: center; }
.sla-label { color: var(--muted); font-size: 11px; }
.sla-val { font-size: 22px; font-weight: bold; margin-top: 6px; }
.sla-val.ok { color: var(--ok); }
.sla-val.warning { color: var(--warning); }
.sla-val.danger { color: var(--danger); }

/* ===== Tabs ===== */
.tabs { display: flex; gap: 4px; border-bottom: 0; }
.tabs a {
  padding: 8px 16px; cursor: pointer; border-radius: 5px 5px 0 0;
  background: #f3f4f6; color: var(--muted); font-size: 13px;
  transition: all 0.15s;
}
.tabs a:hover { background: #e5e7eb; }
.tabs a.active { background: var(--primary); color: white; }

/* ===== Table ===== */
.data-table {
  width: 100%; border-collapse: collapse; background: var(--card);
  border-radius: 6px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.data-table th {
  background: #f9fafb; color: var(--muted); font-weight: 500; font-size: 12px;
  padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 10px 12px; border-bottom: 1px solid #f3f4f6; font-size: 13px;
}
.data-table tr:last-child td { border-bottom: 0; }
.data-table.small th, .data-table.small td { padding: 6px 10px; font-size: 12px; }
.row-clickable { cursor: pointer; }
.row-clickable:hover { background: #f9fafb; }
.rowSel { background: #eff6ff !important; }

.muted { color: var(--muted); }
.small { font-size: 11px; }

/* ===== Tag ===== */
.tag {
  display: inline-block; padding: 2px 8px; border-radius: 3px;
  font-size: 11px; line-height: 1.6; margin-right: 4px;
  background: #f3f4f6; color: var(--muted);
}
.tag-ok { background: #d1fae5; color: #065f46; }
.tag-warning { background: #fef3c7; color: #92400e; }
.tag-danger { background: #fee2e2; color: #991b1b; }
.tag-info { background: #dbeafe; color: #1e3a8a; }

.pager {
  margin-top: 14px; padding: 12px 16px; background: var(--card);
  border-radius: 6px; display: flex; align-items: center; gap: 16px;
  font-size: 13px;
}
.pager select { padding: 4px 8px; border: 1px solid var(--border); border-radius: 4px; }

/* ===== 管理双栏 ===== */
.admin-split {
  display: grid; grid-template-columns: 380px 1fr; gap: 18px;
}
.admin-left, .admin-right {
  background: var(--card); padding: 16px; border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.admin-right.empty { padding: 60px; text-align: center; }
.admin-right-head {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px;
}
.admin-right-head h3 { margin: 0; color: var(--primary); font-size: 15px; }

/* ===== Drawer ===== */
.drawer { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 100; }
.drawer-mask { position: absolute; inset: 0; background: rgba(0,0,0,0.4); }
.drawer-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: 760px; max-width: 92vw;
  background: white; box-shadow: -4px 0 16px rgba(0,0,0,0.1);
  display: flex; flex-direction: column;
  animation: slideIn 0.25s;
}
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }
.drawer-head {
  padding: 16px 24px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.drawer-head h2 { margin: 0; font-size: 18px; color: var(--primary); }
.drawer-body { flex: 1; padding: 20px 24px; overflow-y: auto; }

/* ===== Form ===== */
.form-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px;
}
.form-grid label {
  display: flex; flex-direction: column; font-size: 12px;
}
.form-grid label.full { grid-column: span 2; }
.form-grid label > span {
  margin-bottom: 4px; color: var(--muted); font-size: 11px;
  display: flex; gap: 8px; align-items: baseline;
}
.form-grid label > span em { color: var(--danger); font-style: normal; }
.form-grid input, .form-grid select, .form-grid textarea {
  padding: 7px 10px; border: 1px solid var(--border); border-radius: 5px;
  font-size: 13px; background: white;
}
.form-grid textarea { resize: vertical; }
.form-grid input.readonly { background: #f9fafb; color: var(--muted); cursor: not-allowed; }
.form-grid label.new-issue-warn {
  background: #fef3c7; padding: 10px 12px; border-radius: 5px; border-left: 3px solid var(--warning);
}

.form-actions {
  margin-top: 18px; display: flex; gap: 12px; padding-top: 14px;
  border-top: 1px solid var(--border);
}

.form-line {
  display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px;
  font-size: 12px;
}
.form-line > span { color: var(--muted); }
.form-line > input, .form-line > select, .form-line > textarea {
  padding: 7px 10px; border: 1px solid var(--border); border-radius: 5px;
  font-size: 13px;
}
.inline-check {
  display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted);
}

/* ===== Timeline ===== */
.timeline-section {
  margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border);
}
.timeline-section h3 { margin: 0 0 14px; color: var(--primary); font-size: 16px; }

.log-add {
  display: grid; grid-template-columns: 130px 180px 1fr auto;
  gap: 8px; align-items: start; margin-bottom: 18px;
  padding: 12px; background: #f9fafb; border-radius: 6px;
}
.log-add textarea {
  grid-column: span 4; padding: 7px 10px; border: 1px solid var(--border);
  border-radius: 5px; font-size: 13px; resize: vertical;
}
.log-add input, .log-add select {
  padding: 6px 10px; border: 1px solid var(--border); border-radius: 5px;
  font-size: 13px;
}
.log-add button { grid-column: span 4; justify-self: end; }

.timeline { position: relative; padding-left: 24px; }
.timeline::before {
  content: ''; position: absolute; left: 9px; top: 4px; bottom: 4px;
  width: 2px; background: #e5e7eb;
}
.tl-item {
  position: relative; margin-bottom: 14px; padding: 8px 12px;
  background: var(--card); border-radius: 5px; border: 1px solid var(--border);
  font-size: 12px;
}
.tl-dot {
  position: absolute; left: -19px; top: 14px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--muted);
  border: 2px solid white; box-shadow: 0 0 0 1px var(--border);
}
.tl-item.action-create .tl-dot { background: var(--muted); }
.tl-item.action-respond .tl-dot { background: var(--info); }
.tl-item.action-supplement .tl-dot { background: var(--warning); }
.tl-item.action-internal .tl-dot { background: #8b5cf6; }
.tl-item.action-escalate .tl-dot { background: var(--danger); }
.tl-item.action-solution .tl-dot { background: var(--ok); }
.tl-item.action-reply .tl-dot { background: var(--info); }
.tl-item.action-wait .tl-dot { background: var(--warning); }
.tl-item.action-close .tl-dot { background: var(--muted); }
.tl-item.action-reopen .tl-dot { background: var(--danger); }

.tl-head {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px;
}
.tl-action { font-weight: 600; color: var(--text); }
.tl-internal { background: #ede9fe; color: #5b21b6; padding: 1px 6px; border-radius: 3px; }
.tl-del { margin-left: auto !important; font-size: 11px !important; color: var(--danger) !important; }
.tl-content { white-space: pre-wrap; line-height: 1.5; color: var(--text); }

/* ===== Section block (关联/退回/运费) ===== */
.section-block {
  margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border);
}
.section-block h3 {
  margin: 0 0 14px; color: var(--primary); font-size: 16px;
  display: flex; align-items: baseline; gap: 8px;
}

/* 关联反馈 */
.link-add {
  display: flex; gap: 8px; margin-bottom: 14px;
}
.link-add input {
  flex: 1; padding: 7px 10px; border: 1px solid var(--border); border-radius: 5px;
  font-size: 13px;
}
.link-cards { display: flex; flex-direction: column; gap: 8px; }
.link-card {
  background: #f9fafb; border: 1px solid var(--border); border-radius: 6px;
  padding: 10px 12px; font-size: 12px;
}
.link-head {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.link-body { margin-top: 4px; line-height: 1.5; }

/* ===== Dashboard 新筛选条 ===== */
.card-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.card-head h3 { margin: 0; }
.filter-row {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-bottom: 14px; padding: 10px; background: #f9fafb; border-radius: 6px;
}
.filter-row input[type=date] {
  padding: 5px 8px; border: 1px solid var(--border); border-radius: 4px; font-size: 12px;
}
.filter-divider { width: 1px; height: 22px; background: var(--border); margin: 0 4px; }

/* 粒度切换段 */
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 4px; overflow: hidden; }
.seg a {
  padding: 5px 12px; cursor: pointer; font-size: 12px;
  background: #fff; color: var(--text-secondary, #6b7280);
  border-right: 1px solid var(--border);
}
.seg a:last-child { border-right: none; }
.seg a.active { background: var(--primary); color: #fff; }
.seg a:hover:not(.active) { background: #f3f4f6; }

/* chip 多选 */
.chip-multi { position: relative; display: inline-block; }
.chip-btn {
  padding: 5px 12px; background: #fff; border: 1px solid var(--border); border-radius: 4px;
  cursor: pointer; font-size: 12px; color: var(--text);
  display: inline-flex; align-items: center; gap: 4px;
}
.chip-btn:hover { border-color: var(--primary); }
.chip-count { color: var(--primary); font-weight: 600; }
.chip-dropdown {
  position: absolute; top: 100%; left: 0; margin-top: 4px;
  background: #fff; border: 1px solid var(--border); border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  min-width: 200px; max-height: 300px; overflow-y: auto;
  z-index: 50; padding: 6px;
}
.chip-dropdown.wide { min-width: 280px; }
.chip-dropdown-head { display: flex; gap: 12px; padding: 4px 8px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.chip-dropdown-head a { font-size: 11px; color: var(--primary); cursor: pointer; }
.chip-opt {
  display: flex; align-items: center; gap: 6px; padding: 5px 8px;
  cursor: pointer; font-size: 12px; border-radius: 3px;
}
.chip-opt:hover { background: #f3f4f6; }
.chip-tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; background: #dbeafe; color: #1e40af;
  border-radius: 12px; font-size: 11px;
}
.chip-tag a { cursor: pointer; color: #1e40af; opacity: 0.6; }
.chip-tag a:hover { opacity: 1; }

/* 图表容器 */
.chart-wrap { height: 360px; position: relative; }

/* 热力图 */
.heatmap-wrap { padding: 12px 0; }
.heatmap-table {
  border-collapse: separate; border-spacing: 4px;
  font-size: 13px; width: 100%; table-layout: fixed;
}
.heatmap-table th {
  font-weight: 600; padding: 8px 8px; color: var(--text-secondary, #6b7280);
  text-align: center; background: transparent;
}
.heatmap-table thead th { font-size: 13px; }
.heatmap-table tbody th {
  text-align: right; padding-right: 14px; width: 110px;
  font-size: 12px;
}
.heatmap-table td {
  padding: 28px 6px; text-align: center;
  border-radius: 6px; font-weight: 700; font-size: 15px;
  transition: transform 0.1s;
}
.heatmap-table td:hover { transform: scale(1.04); cursor: default; }

/* 矩阵变体：top 8x8，列宽自适应、padding 收紧、表头斜排 */
.heatmap-matrix { table-layout: auto; }
.heatmap-matrix thead th {
  font-size: 11px; padding: 6px 4px;
  white-space: nowrap;
  vertical-align: bottom;
  height: 90px;
  /* 斜排表头 */
  transform: rotate(-30deg);
  transform-origin: left bottom;
  text-align: left;
  max-width: 60px;
}
.heatmap-matrix tbody th {
  width: 130px; max-width: 130px;
  font-size: 12px; padding-right: 10px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.heatmap-matrix td {
  padding: 14px 4px;
  font-size: 13px;
  min-width: 50px;
}
.heatmap-wrap { overflow-x: auto; }

/* ===== Modal ===== */
.modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 200; }
.modal-mask { position: absolute; inset: 0; background: rgba(0,0,0,0.5); }
.modal-card {
  position: relative; background: white; max-width: 92vw; max-height: 92vh;
  margin: 60px auto 0; border-radius: 8px; box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  display: flex; flex-direction: column;
  animation: zoomIn 0.2s;
}
@keyframes zoomIn { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }
.modal-head {
  padding: 14px 20px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.modal-head h2 { margin: 0; font-size: 16px; color: var(--primary); }
.modal-body { flex: 1; padding: 18px 20px; overflow-y: auto; }
.modal-foot {
  padding: 12px 20px; border-top: 1px solid var(--border);
  display: flex; gap: 12px; justify-content: flex-end;
}

/* ===== Toast ===== */
.toast {
  position: fixed; top: 24px; right: 24px; z-index: 300;
  padding: 12px 18px; background: var(--text); color: white;
  border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  font-size: 13px; max-width: 400px;
}
.toast.error { background: var(--danger); }
.toast.success { background: var(--ok); }
.toast.warning { background: var(--warning); }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .sidebar { width: 64px; }
  .nav-item { padding: 12px 8px; text-align: center; font-size: 11px; }
  .nav-item.sub { padding-left: 8px; }
  .brand-name { font-size: 14px; }
  .brand-ver { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid label.full { grid-column: span 1; }
  .admin-split { grid-template-columns: 1fr; }
}

/* ===== v0.7.0 问题跟踪 ===== */

/* 列表表格：行可点 + 内容超长省略 */
.data-table .clickable { cursor: pointer; }
.data-table .clickable:hover { background: #f9fafb; }
.data-table .cell-content {
  max-width: 0;  /* 让 td 受外部 width 控制 */
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* 状态药丸 */
.status-pill {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 500;
}
.status-进行中 { background: #fef3c7; color: #92400e; }
.status-已完成 { background: #d1fae5; color: #065f46; }
.status-已搁置 { background: #e5e7eb; color: #4b5563; }

.badge-num {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  background: #e0e7ff; color: #3730a3; font-size: 12px; font-weight: 500;
  min-width: 22px; text-align: center;
}
.badge-warn {
  display: inline-block; padding: 2px 6px; border-radius: 4px;
  background: #fef2f2; color: #b91c1c; font-size: 11px;
  margin-left: 4px;
}
.badge-pill {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 500;
}
.badge-complaint { background: #fee2e2; color: #991b1b; }
.badge-suggestion { background: #dbeafe; color: #1e40af; }

/* 关联反馈卡片 */
.link-cards { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.link-card {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; background: #f9fafb; border: 1px solid #e5e7eb;
  border-radius: 6px; font-size: 13px;
}
.link-card-id { font-weight: 600; color: #4f46e5; }
.link-card-platform { font-size: 11px; padding: 1px 6px; background: #e0e7ff; border-radius: 4px; color: #3730a3; }
.link-card-issue { font-family: monospace; color: #6b7280; }
.link-card-brief { flex: 1; color: #374151; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-card-jump, .link-card-remove {
  cursor: pointer; padding: 2px 6px; color: #6b7280;
}
.link-card-jump:hover { color: #4f46e5; }
.link-card-remove:hover { color: #dc2626; }

/* 关联反馈搜索框 */
.link-add { position: relative; display: flex; gap: 6px; align-items: center; }
.link-add input { flex: 1; }
.link-search-list {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 30;
  background: #fff; border: 1px solid #e5e7eb; border-radius: 6px;
  margin-top: 2px; max-height: 280px; overflow-y: auto;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.link-search-item {
  display: flex; gap: 8px; align-items: center;
  padding: 6px 10px; cursor: pointer;
  font-size: 12px; border-bottom: 1px solid #f3f4f6;
}
.link-search-item:hover { background: #f3f4f6; }
.link-search-item:last-child { border-bottom: none; }

/* 附件缩略图网格 */
.attachment-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
}
.attachment-item {
  position: relative; border: 1px solid #e5e7eb; border-radius: 6px;
  overflow: hidden; background: #f9fafb;
}
.attachment-item img {
  width: 100%; height: 100px; object-fit: cover; cursor: zoom-in;
  display: block;
}
.attachment-item img:hover { opacity: 0.85; }
.attachment-remove {
  position: absolute; top: 4px; right: 4px;
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(0,0,0,0.6); color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 14px; line-height: 1;
}
.attachment-remove:hover { background: #dc2626; }
.attachment-name {
  font-size: 10px; color: #6b7280;
  padding: 4px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: #fff;
}

/* 灯箱 */
.lightbox {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 999;
  background: rgba(0,0,0,0.85);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.lightbox img {
  max-width: 100%; max-height: 100%;
  object-fit: contain; box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.lightbox-close {
  position: absolute; top: 16px; right: 24px;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,0.15); color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 28px; line-height: 1;
}
.lightbox-close:hover { background: rgba(255,255,255,0.3); }
.lightbox-name {
  position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
  color: #fff; font-size: 13px; opacity: 0.7;
}

/* required 红星 */
.required { color: #dc2626; font-weight: bold; margin-left: 2px; }

/* 抽屉里的 form-row */
.form-row {
  display: grid; grid-template-columns: 100px 1fr;
  gap: 12px; margin-bottom: 14px; align-items: start;
}
.form-row > label { padding-top: 6px; font-weight: 500; color: #374151; font-size: 13px; }
.form-row > input, .form-row > select, .form-row > textarea {
  width: 100%;
}
.form-actions {
  margin-top: 20px; padding-top: 14px;
  border-top: 1px solid #e5e7eb;
  overflow: hidden;
}

/* ===== v0.7.0 抽屉表单布局微调 ===== */
.drawer-panel .drawer-body { padding: 20px 24px 80px; }

/* textarea 默认 line-height 提升可读性，允许垂直 resize */
.drawer-panel textarea {
  resize: vertical; line-height: 1.6;
  font-family: inherit; font-size: 13px;
  padding: 8px 10px;
}
/* rows 属性提供一个最小高度基线 */
.drawer-panel textarea[rows="3"] { min-height: 80px; }
.drawer-panel textarea[rows="4"] { min-height: 105px; }

/* 行间距适中（不撑稀）*/
.drawer-panel .form-row {
  margin-bottom: 14px;
  align-items: start;
}
.drawer-panel .form-row > label {
  padding-top: 8px; font-size: 13px; color: #4b5563;
}
.drawer-panel select, .drawer-panel input[type="text"],
.drawer-panel input[type="datetime-local"] {
  padding: 7px 10px;
}

/* 关联反馈 / 附件区上下留缝 */
.drawer-panel .link-cards { margin: 4px 0 8px; }
.drawer-panel .attachment-grid { margin-top: 8px; }

/* ===== v0.7.0 用户意见双栏布局 ===== */
.opinion-split {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  margin-top: 16px;
}
.opinion-col {
  background: #fff; border: 1px solid var(--border);
  border-radius: 8px; padding: 14px 16px;
  display: flex; flex-direction: column;
}
.opinion-col-head {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 10px; margin-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.opinion-cards { display: flex; flex-direction: column; gap: 8px; }
.opinion-card {
  background: #f9fafb; border: 1px solid #e5e7eb;
  border-radius: 6px; padding: 10px 12px;
  cursor: pointer; transition: all 0.15s;
}
.opinion-card:hover {
  background: #fff; border-color: #c7d2fe;
  box-shadow: 0 2px 6px rgba(99,102,241,0.1);
}
.opinion-card-content {
  font-size: 13px; line-height: 1.55; color: #1f2937;
  white-space: pre-wrap; word-break: break-word;
  margin-bottom: 6px;
}
.opinion-card-meta {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; flex-wrap: wrap;
}
.opinion-card-solution {
  margin-top: 6px; padding-top: 6px;
  border-top: 1px dashed #e5e7eb;
  font-size: 11px;
}

/* 移动端：双栏改单栏堆叠 */
@media (max-width: 900px) {
  .opinion-split { grid-template-columns: 1fr; }
}

/* ===== v0.7.2 重复反馈提示 ===== */
.dup-warn {
  background: #fefce8; border: 1px solid #fbbf24; border-radius: 6px;
  padding: 10px 14px; margin: 8px 0;
}
.dup-warn-head {
  font-size: 13px; font-weight: 600; color: #92400e;
  margin-bottom: 6px;
}
.dup-warn-item {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  padding: 4px 0; font-size: 12px;
  border-top: 1px solid #fde68a;
}
.dup-warn-item:first-of-type { border-top: none; }
.dup-warn-item a { color: #4f46e5; font-weight: 600; text-decoration: underline; }
.dup-warn-item a:hover { color: #312e81; }

/* 列表 issue_no 列样式（等宽，便于扫读）*/
.cell-issue-no {
  font-family: 'JetBrains Mono', 'Menlo', monospace;
  font-size: 12px; color: #6b7280;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ===== v0.8.0 角色权限 / 操作日志 ===== */

/* 只读模式：抽屉里所有控件锁住 */
.drawer-body[data-readonly="true"] input,
.drawer-body[data-readonly="true"] select,
.drawer-body[data-readonly="true"] textarea,
.drawer-body[data-readonly="true"] button:not(.btn-link),
.drawer-body[data-readonly="true"] .combobox,
.drawer-body[data-readonly="true"] .link-add,
.drawer-body[data-readonly="true"] .form-actions {
  pointer-events: none !important;
  opacity: 0.7;
}
.drawer-body[data-readonly="true"] .btn-primary,
.drawer-body[data-readonly="true"] .btn-danger {
  display: none !important;
}
.readonly-banner {
  background: #fef3c7; color: #92400e;
  padding: 10px 14px; border-radius: 6px;
  margin-bottom: 14px; font-size: 13px; font-weight: 500;
  border: 1px solid #fbbf24;
}

/* 用户管理：受保护行 */
.row-protected { background: #fef9c3; }
.row-protected:hover { background: #fef08a; }
.badge-protected {
  margin-left: 6px; font-size: 14px; vertical-align: middle;
}
.tag-role-L1 { background: #dbeafe; color: #1e40af; }
.tag-role-L2 { background: #d1fae5; color: #065f46; }
.tag-role-L3 { background: #ddd6fe; color: #5b21b6; }
.tag-role-admin { background: #fef3c7; color: #92400e; font-weight: 600; }

/* 操作日志页 */
.audit-detail {
  font-family: 'Menlo', monospace; font-size: 11px;
  color: #6b7280; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; max-width: 0;
}
.audit-action-create { background: #d1fae5; color: #065f46; }
.audit-action-update { background: #fef3c7; color: #92400e; }
.audit-action-delete { background: #fee2e2; color: #991b1b; }
.audit-action-login { background: #dbeafe; color: #1e40af; }
.audit-action-login_fail { background: #fee2e2; color: #b91c1c; font-weight: 600; }

/* readonly input 灰底 */
input[readonly] { background: #f3f4f6; color: #6b7280; cursor: not-allowed; }

/* 时间字段·剪贴板粘贴按钮 (v0.9.10) */
.dt-paste-wrap { display: flex; align-items: stretch; gap: 4px; }
.dt-paste-wrap input[type="datetime-local"] { flex: 1; min-width: 0; }
.dt-paste-btn {
  flex: 0 0 auto; padding: 0 8px; border: 1px solid #d1d5db; border-radius: 4px;
  background: #f9fafb; cursor: pointer; font-size: 14px; line-height: 1;
}
.dt-paste-btn:hover { background: #eef2ff; border-color: #6366f1; }
.dt-paste-btn:active { background: #e0e7ff; }

/* ===== 处理剧本库 SOP ===== */
.sop-block { margin-bottom: 16px; }
.sop-block .sop-h {
  font-size: 13px; font-weight: 700; color: #1f2937;
  margin-bottom: 8px; padding-bottom: 4px; border-bottom: 1px solid #f1f5f9;
}

/* ===== LLM 设置表单 ===== */
.llm-f { display:flex; flex-direction:column; gap:3px; font-size:13px; }
.llm-f > span { color:#6b7280; font-size:12px; }
.llm-f input, .llm-f select {
  padding:7px 10px; border:1px solid #d1d5db; border-radius:6px; font-size:13px;
}
