:root {
  /* 整体浅色风格，更接近 03121 */
  --bg: #f3f4f6;
  --bg-card: #ffffff;
  --bg-input: #f9fafb;
  --border: #e5e7eb;
  --text: #111827;
  --text-muted: #6b7280;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --success: #16a34a;
  --error: #dc2626;
  --radius: 14px;
  --shadow-card: 0 18px 45px rgba(15, 23, 42, 0.14);
  --font: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  background: radial-gradient(circle at top left, #e0f2fe 0, #f9fafb 40%, #f3f4f6 100%);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

.nav {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #e5e7eb;
  padding: 0.75rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-weight: 700;
  font-size: 1.2rem;
  color: #111827;
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-size: 0.85rem;
  transition: color 0.15s ease, background 0.15s ease;
}
.btn-group-xs>.btn, .btn-xs {
    font-size: 12px;
    padding: 2px 6px;
    line-height: 18px;
}
.btn-info {
    background-color: #48b0f7;
    border-color: #48b0f7;
    color: #fff !important;
}
.cat-pill-hot::after {
  content: '🔥';
  margin-left: 4px;
  font-size: 12px;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
  background: rgba(37, 99, 235, 0.08);
}

.user-info {
  margin-left: 0.75rem;
  font-size: 0.8rem;
  color: #4b5563;
}

.main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2.8rem 1.5rem 2.5rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 2.2rem 2rem;
  box-shadow: var(--shadow-card);
}

.card.secondary {
  background: #f9fafb;
  border-style: dashed;
}

.card h1 {
  font-size: 1.5rem;
  margin-bottom: 0.35rem;
}

.hint {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
/* 项目备注（支持安全富文本展示） */
#projectRemarkBox {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-left: 4px solid #60a5fa;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  color: #0f172a;
  padding: 0.85rem 0.9rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.75;
  max-height: 220px;
  color: #c62828 !important;
  background-color: #fbf5f5;
  overflow: auto;
}

#projectRemarkBox a {
  color: var(--accent);
  text-decoration: underline;
}

#projectRemarkBox hr {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin: 0.6rem 0;
}

#projectRemarkBox p {
  margin: 0.35rem 0;
}

#projectRemarkBox ul,
#projectRemarkBox ol {
  margin: 0.35rem 0 0.35rem 1.25rem;
}

#projectRemarkBox li {
  margin: 0.15rem 0;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 500;
  color: #374151;
}

.form-group .req {
  color: var(--error);
}

.form-group small {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.form-group a {
  color: var(--accent);
  text-decoration: none;
}

.form-group a:hover {
  text-decoration: underline;
}

input,
select,
textarea {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.7rem 0.95rem;
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

input::placeholder {
  color: var(--text-muted);
  opacity: 0.8;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.35);
  background-color: #ffffff;
}

.btn {
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: background 0.15s ease, opacity 0.15s ease, transform 0.05s ease;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.45);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-secondary {
  background: #eef2ff;
  color: #4338ca;
  border: 1px solid #e5e7eb;
}

.btn-secondary:hover {
  background: #e0e7ff;
}

.btn-sm {
  padding: 0.45rem 0.9rem;
  font-size: 0.75rem;
}

.category-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.cat-pill {
  border: 1px solid #e5e7eb;
  background: #f8fafc;
  color: #475569;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 1rem;
  cursor: pointer;
}

.cat-pill.active,
.cat-pill:hover {
  color: var(--accent);
  border-color: rgba(37, 99, 235, 0.5);
  background: rgba(37, 99, 235, 0.08);
}

.project-search {
  position: relative;
  margin-top: 0.75rem;
}

.project-search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 200;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 20px 55px rgba(15, 23, 42, 0.16);
  max-height: 320px;
  overflow: auto;
}

.ps-item {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
}

.ps-item:hover {
  background: #f8fafc;
}

.ps-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: #111827;
}

.ps-sub {
  font-size: 0.8rem;
  color: #64748b;
  margin-top: 0.1rem;
}

.ps-empty {
  padding: 0.85rem 0.75rem;
  font-size: 0.85rem;
  color: #64748b;
}

/* 工单 */
.ticket-thread {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.75rem;
}

.ticket-msg {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 0.6rem 0.75rem;
  background: #ffffff;
}

.ticket-msg.admin {
  background: #f8fafc;
}

.ticket-msg .meta {
  font-size: 0.78rem;
  color: #64748b;
  margin-bottom: 0.25rem;
}

.ticket-msg .content {
  font-size: 0.9rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.tab {
  padding: 0.5rem 1rem;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
}

.tab:hover, .tab.active {
  color: var(--accent);
  border-color: rgba(37, 99, 235, 0.5);
  background: rgba(37, 99, 235, 0.08);
}

.toolbar {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.search-input {
  flex: 1;
}

.result-box, .error-box {
  margin-top: 1.5rem;
  padding: 1rem;
  border-radius: 8px;
  font-size: 0.95rem;
}

.result-box.success {
  background: #ecfdf3;
  border: 1px solid #bbf7d0;
  color: var(--success);
}

.result-box.error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--error);
}

.data-result {
  margin-top: 1rem;
  padding: 1rem;
  background: #f1f5f9;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 0.85rem;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 400px;
  overflow-y: auto;
}

.loading {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
}

.project-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.project-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  background: #ffffff;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  font-size: 0.9rem;
}

.project-item .id {
  font-weight: 600;
  color: var(--accent);
  font-family: monospace;
  min-width: 80px;
}

.project-item .name {
  flex: 1;
  color: #b91c1c;
}

.project-item .copy-btn {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
}

.footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.admin-shell {
  min-width: 0;
}

.admin-topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 1.25rem;
}

.admin-topbar-title {
  font-size: 1.25rem;
  font-weight: 700;
}

.admin-topbar-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.admin-topbar-tabs {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-wrap: wrap;
}

.admin-tab {
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #f3f4f6;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.admin-tab:hover,
.admin-tab.active {
  color: var(--accent);
  border-color: rgba(37, 99, 235, 0.5);
  background: rgba(37, 99, 235, 0.08);
}

.admin-content {
  min-width: 0;
}

.admin-section h1 {
  font-size: 1.35rem;
  margin-bottom: 0.25rem;
}

.admin-dashboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.admin-dashboard-card {
  background: #f9fafb;
  border-radius: 14px;
  padding: 1rem 1.1rem;
  border: 1px solid #e5e7eb;
}

.admin-dashboard-card-title {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.admin-dashboard-card-value {
  font-size: 1.35rem;
  font-weight: 600;
}

.admin-logs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  align-items: start;
  margin-top: 1rem;
  min-width: 0;
}

.admin-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
  margin: 1rem 0 1rem;
}

.admin-logs-grid > div {
  min-width: 0;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(2px);
}

.modal-card {
  position: relative;
  width: min(520px, calc(100vw - 2rem));
  margin: 8vh auto 0;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.35);
  padding: 1.25rem 1.25rem 1.5rem;
  max-height: 84vh;
  overflow: auto;
}

.modal-card-wide {
  width: min(820px, calc(100vw - 2rem));
}

/* 上游搜索结果很多时，在框内滚动 */
#upstreamSearchResult.table-list {
  max-height: 45vh;
  overflow: auto;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.modal-title {
  font-size: 1.05rem;
  font-weight: 700;
}

.modal-close {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  color: #6b7280;
}

.modal-close:hover {
  background: #f3f4f6;
  color: #111827;
}

.inline-form {
  gap: 0.85rem;
}

.checkbox-inline {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.9rem;
  color: #374151;
}

.table-list {
  width: 100%;
  overflow: auto;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
}

/* 订单查单：参考目标站表格布局 */
.order-table-wrap {
  width: 100%;
  overflow: auto;
}

.order-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  min-width: 1080px;
}

.order-table .col-ck { width: 40px; max-width: 40px; }
.order-table .col-localid { width: 30px; max-width: 30px; }
.order-table .col-oid { width: 120px; max-width: 120px; }
.order-table .col-proj { width: 110px; max-width: 110px; }
.order-table .col-account { width: 110px; max-width: 110px; }
.order-table .col-course { width: 140px; max-width: 140px; }
.order-table .col-actions { width: 70px; max-width: 70px; }
.order-table .col-status { width: 70px; max-width: 70px; }
.order-table .col-process { width: 70px; max-width: 70px; }
.order-table .col-remark { width: 190px; max-width: 190px; }
.order-table .col-dates { width: 150px; max-width: 150px; }

.order-table th,
.order-table td {
  padding: 0.55rem 0.55rem;
  border-bottom: 1px solid #f1f5f9;
  text-align: center;
  font-size: 0.88rem;
  vertical-align: center;
}

.order-table th {
  background: #f8fafc;
  color: #475569;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.order-table tr:hover td {
  background: #f8fafc;
}

.td-wrap {
  word-break: break-all;
  white-space: normal;
}

/* 规则：
   - 单元格固定“两行高度”
   - 内容能一行则垂直居中
   - 放不下自动换行到第二行（最多两行，超出隐藏）
*/
.cell-2line {
 line-height: 1.2rem;
    min-height: calc(0.8rem * 2);
    display: flex;
    justify-content: space-evenly;
    align-items: flex-end;
}

.cell-2line .cell-text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  white-space: normal;
  word-break: break-all;
  line-height: 1.2rem;
}

/* 需要强制只显示 1 行的情况（如账号/创建时间） */
.cell-2line .cell-text-1 {
  -webkit-line-clamp: 1;
}
.ops-stack{
  display:flex;
  flex-direction:column;
  gap:.35rem;
  align-items:center;
}
.ops-stack .btn{
  width:100%;
  justify-content:center;
}
/* 备注等：3 行显示 */
.cell-3line {
  line-height: 1.2rem;
  min-height: calc(1.2rem * 3);
  display: flex;
  align-items: center;
}

.cell-3line .cell-text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  white-space: normal;
  word-break: break-all;
  line-height: 1.2rem;
}

/* 显式标记 3 行 clamp（便于在 DOM 里区分） */
.cell-text-3 {
  -webkit-line-clamp: 3;
}

/* 时间列：三行高度（支持 <br>） */
.cell-dates-3line {
  line-height: 1.2rem;
  min-height: calc(1.2rem * 3);
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: normal;
}

.td-dates {
  font-size: 0.82rem;
  color: #334155;
  line-height: 1.25rem;
  white-space: normal;
}

.order-id-sub {
  margin-top: 0.35rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid #e5e7eb;
  background: #f1f5ff;
  color: #4338ca;
  white-space: nowrap;
}

/* checkbox 简化 */
.ck {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.ck input {
  width: 14px;
  height: 14px;
}
.ck span {
  display: none;
}

.order-detail-row td {
  background: #ffffff;
}

.order-detail-box {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
}

.detail-row {
  display: flex;
  gap: 0.75rem;
  padding: 0.2rem 0;
  align-items: baseline;
}

.detail-row .dk {
  min-width: 42px;
  color: #64748b;
  font-size: 0.8rem;
}

.detail-row .dv {
  color: #111827;
  font-size: 0.9rem;
  word-break: break-word;
  white-space: normal;
}

.table-list table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.table-list th,
.table-list td {
  padding: 0.65rem 0.05rem;
  border-bottom: 1px solid #f1f5f9;
  text-align: center;
  font-size: 0.9rem;
  white-space: nowrap;
}

.table-list th {
  background: #f8fafc;
  color: #475569;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.table-list tr:hover td {
  background: #f8fafc;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid #e5e7eb;
  background: #f3f4f6;
  color: #374151;
}

.tag-success {
  background: #ecfdf3;
  border-color: #bbf7d0;
  color: #166534;
}

.tag-warn {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #9a3412;
}

.tag-danger {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.order-detail-placeholder {
  padding: 0.5rem 0.25rem 0.75rem;
}

.order-detail-box {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 0.9rem 1rem;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.06);
}

.order-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.order-detail-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: #111827;
}

.order-detail-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.order-detail-process {
  font-size: 0.85rem;
  color: #64748b;
  font-weight: 600;
}

.order-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1rem;
}

.order-detail-grid .full {
  grid-column: 1 / -1;
}

.order-detail-grid .k {
  font-size: 0.78rem;
  color: #64748b;
  margin-bottom: 0.15rem;
}

.order-detail-grid .v {
  font-size: 0.9rem;
  color: #111827;
  word-break: break-word;
  white-space: normal;
}

.admin-pagination {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 0.75rem;
}

.admin-page-info {
  font-size: 0.8rem;
  color: var(--text-muted);
}

@media (max-width: 600px) {
  .nav {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
  .main {
    padding-top: 1.8rem;
  }
  .admin-topbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .admin-logs-grid {
    grid-template-columns: 1fr;
  }
}
