*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', 'Noto Sans SC', "Microsoft YaHei", "微软雅黑", -apple-system, sans-serif; color: #16161f; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
[x-cloak] { display: none !important; }

/* ═══ 肌理层 (finesse substrate) ═══ */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  opacity: .025;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ═══ 品牌色系 ═══ */
:root {
  --gold: #B8860B;
  --gold-light: #DAA520;
  --blue: #005bff;
  --blue-hover: #0045cc;
  --blue-dark: #1e3a5f;
  --green: #16a34a;
  --green-hover: #15803d;
  --orange: #ea580c;
  --red: #dc2626;
  --purple: #9333ea;
}

/* ═══ 背景 ═══ */
.bg-page { background-color: #edf0f6; }
.bg-white { background-color: #fafbfd; }
.bg-gray-50 { background-color: #f9fafb; }
.bg-blue { background-color: var(--blue); }
.bg-blue-hover:hover { background-color: var(--blue-hover); }
.bg-green { background-color: var(--green); }
.bg-green-hover:hover { background-color: var(--green-hover); }
.bg-green-50 { background-color: #f0fdf4; }
.bg-red-50 { background-color: #fef2f2; }
.bg-orange { background-color: var(--orange); }
.bg-orange-hover:hover { background-color: #d1430c; }

/* ═══ 品牌导航栏 ═══ */
.navbar {
  position: relative; z-index: 10;
  background: linear-gradient(135deg, #0f172a, var(--blue-dark));
  color: #fff;
  padding: 0 1.5rem;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.navbar-brand { font-size: 1.1rem; font-weight: 700; letter-spacing: 0.5px; }
.navbar-brand .gold { color: var(--gold-light); }
.brand-link { color: inherit; text-decoration: none; }
.navbar-links { display: flex; gap: 1.5rem; align-items: center; font-size: 0.875rem; }
.navbar-links a { color: rgba(255,255,255,0.85); transition: color 0.15s; }
.navbar-links a:hover { color: var(--gold-light); }

/* ═══ 卡片 ═══ */
.card {
  background: #fafbfd;
  border-radius: 0.5rem;
  box-shadow: 0 2px 16px rgba(15,23,42,0.05);
}
.card-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  font-weight: 600;
  font-size: 0.95rem;
}

/* ═══ 按钮 ═══ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.5rem 1.25rem; border-radius: 0.375rem; font-size: 0.875rem;
  font-weight: 500; cursor: pointer; border: none; transition: all 0.15s;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-hover); }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { background: var(--green-hover); }
.btn-orange { background: var(--orange); color: #fff; }
.btn-orange:hover { background: #d1430c; }
.btn-outline { background: #fff; color: var(--blue); border: 1px solid var(--blue); }
.btn-outline:hover { background: #f0f5ff; }
.btn-sm { padding: 0.25rem 0.75rem; font-size: 0.8rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:focus-visible, a:focus-visible, button:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 2px; }

/* ═══ 表单 ═══ */
.form-input {
  width: 100%; padding: 0.5rem 0.75rem; border: 1px solid rgba(0,0,0,0.1);
  border-radius: 0.375rem; font-size: 0.875rem; transition: border-color 0.15s, box-shadow 0.15s;
  background: #fafbfd;
}
.form-input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,91,255,0.12); }
.form-label { display: block; font-size: 0.875rem; font-weight: 500; margin-bottom: 0.25rem; color: #374151; }
.form-label .required { color: var(--red); }

/* ═══ 表格 ═══ */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; padding: 0.75rem 1rem; font-size: 0.8rem; font-weight: 600;
  color: #6b7280; background: #f9fafb; border-bottom: 2px solid rgba(0,0,0,0.06); text-transform: uppercase; letter-spacing: 0.5px; }
.table td { padding: 0.75rem 1rem; font-size: 0.875rem; border-bottom: 1px solid rgba(0,0,0,0.04); }
.table tr:hover td { background: rgba(0,0,0,0.01); }

/* ═══ 颜色文字 ═══ */
.text-gold { color: var(--gold); }
.text-blue { color: var(--blue); }
.text-green { color: var(--green); }
.text-orange { color: var(--orange); }
.text-red { color: var(--red); }
.text-purple { color: var(--purple); }
.text-gray-400 { color: #9ca3af; }
.text-gray-500 { color: #6b7280; }
.text-gray-600 { color: #4b5563; }
.text-gray-700 { color: #374151; }
.text-white { color: #fff; }

/* ═══ 排版 ═══ */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ═══ 链接 ═══ */
.link { color: var(--blue); }
.link:hover { text-decoration: underline; color: var(--blue-hover); }
.link-green { color: var(--green); }
.link-green:hover { color: var(--green-hover); text-decoration: underline; }
.link-purple { color: var(--purple); }
.link-purple:hover { text-decoration: underline; }
.link-orange { color: var(--orange); }
.link-orange:hover { text-decoration: underline; }
.link-danger { color: var(--red); }
.link-danger:hover { text-decoration: underline; }

/* ═══ 布局 ═══ */
.flex { display: flex; }
.flex-1 { flex: 1 1 0%; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-shrink-0 { flex-shrink: 0; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.space-x-2 > * + * { margin-left: 0.5rem; }
.space-x-3 > * + * { margin-left: 0.75rem; }
.space-y-1 > * + * { margin-top: 0.25rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.col-span-2 { grid-column: span 2; }
.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.max-w-3xl { max-width: 48rem; }
.max-w-5xl { max-width: 64rem; }

/* ═══ 尺寸 ═══ */
.w-10 { width: 2.5rem; } .w-12 { width: 3rem; } .w-14 { width: 3.5rem; }
.w-16 { width: 4rem; } .w-20 { width: 5rem; } .w-28 { width: 7rem; }
.w-80 { width: 20rem; } .w-full { width: 100%; }
.max-w-sm { max-width: 24rem; } .max-w-2xl { max-width: 42rem; }
.max-w-4xl { max-width: 56rem; } .max-w-6xl { max-width: 72rem; }
.min-h-screen { min-height: 100vh; }

/* ═══ 间距 ═══ */
.p-6 { padding: 1.5rem; } .p-8 { padding: 2rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }
.py-0\.5 { padding-top: 0.125rem; padding-bottom: 0.125rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-1\.5 { padding-top: 0.375rem; padding-bottom: 0.375rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.mb-1 { margin-bottom: 0.25rem; } .mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; } .mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mt-1 { margin-top: 0.25rem; } .mt-2 { margin-top: 0.5rem; }
.mt-6 { margin-top: 1.5rem; } .mt-8 { margin-top: 2rem; } .mt-12 { margin-top: 3rem; }
.mr-3 { margin-right: 0.75rem; }
.ml-1 { margin-left: 0.25rem; } .ml-2 { margin-left: 0.5rem; } .ml-3 { margin-left: 0.75rem; }

/* ═══ 杂项 ═══ */
.overflow-hidden { overflow: hidden; }
.overflow-y-auto { overflow-y: auto; }
.relative { position: relative; }
.inline-block { display: inline-block; }
.inline-flex { display: inline-flex; }
.self-center { align-self: center; }
.self-end { align-self: flex-end; }
.hover\:underline:hover { text-decoration: underline; }

/* ═══ 边框 ═══ */
.border { border: 1px solid rgba(0,0,0,0.08); }
.border-b { border-bottom: 1px solid rgba(0,0,0,0.06); }
.border-t { border-top: 1px solid rgba(0,0,0,0.06); }
.border-red-200 { border-color: #fecaca; }
.border-green-200 { border-color: #bbf7d0; }
.border-collapse { border-collapse: collapse; }
.rounded { border-radius: 0.375rem; }
.rounded-lg { border-radius: 0.5rem; }
.shadow-sm { box-shadow: 0 1px 2px rgba(0,0,0,0.05); }

/* ═══ 页面居中容器 ═══ */
.page-center {
  min-height: calc(100vh - 56px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem;
}

/* ═══ 状态标签 ═══ */
.status-draft { background: #fef3c7; color: #92400e; padding: 0.15rem 0.5rem; border-radius: 999px; font-size: 0.75rem; font-weight: 500; }
.status-confirmed { background: #d1fae5; color: #065f46; padding: 0.15rem 0.5rem; border-radius: 999px; font-size: 0.75rem; font-weight: 500; }

/* ═══ 图片上传区 ═══ */
.upload-zone {
  border: 2px dashed rgba(0,0,0,0.12); border-radius: 0.5rem; padding: 1.5rem;
  text-align: center; cursor: pointer; transition: all 0.2s;
  background: #fafbfd;
}
.upload-zone:hover, .upload-zone.dragover { border-color: var(--blue); background: #f0f5ff; }
.upload-zone.has-image { border-style: solid; border-color: #86efac; background: #f0fdf4; padding: 0.75rem; }
.upload-preview { max-width: 150px; max-height: 150px; border-radius: 0.375rem; border: 1px solid #e5e7eb; }
.upload-hint { font-size: 0.75rem; color: #9ca3af; margin-top: 0.5rem; }

/* ═══ 商品表 hover 高亮 ═══ */
.goods-row { transition: background 0.1s; }
.goods-row:hover { background: #eff6ff !important; }

/* ═══ 确认书商标图样 ═══ */
.trademark-figure {
  width: 3.5cm; height: 3.5cm; border: 1px solid rgba(0,0,0,0.2);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.trademark-figure img { max-width: 100%; max-height: 100%; object-fit: contain; }
.trademark-figure .placeholder { font-size: 0.65rem; color: #9ca3af; text-align: center; line-height: 1.4; }

/* ═══ 打印 ═══ */
@page { size: A4; margin: 15mm; }
@media print {
  .no-print { display: none !important; }
  body { background: white !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .print-area { box-shadow: none !important; margin: 0 !important; padding: 0 !important; max-width: 180mm; }
  .print-area .card { box-shadow: none; border: none; }
}

/* ═══ 工作台布局 ═══ */
.wb-layout { display: flex; min-height: calc(100vh - 56px); position: relative; z-index: 5; }
.wb-sidebar {
  width: 200px; flex-shrink: 0;
  background: linear-gradient(180deg, #0f172a 0%, #1e3a5f 100%);
  color: #fff; padding: 0 0 1rem 0;
}
.wb-brand { padding: 1rem 1rem 0.75rem; border-bottom: 1px solid rgba(255,255,255,0.08); margin-bottom: 0.5rem; display: flex; align-items: center; gap: 0.5rem; }
.wb-brand-link { display:flex; align-items:center; gap:0.5rem; text-decoration:none; color:inherit; }
.wb-brand-logo { height: 24px; width: auto; }
.wb-brand-text { font-size: 0.8rem; font-weight: 600; color: var(--gold-light); letter-spacing: 0.5px; white-space: nowrap; }
.wb-nav-title { padding: 0.5rem 1rem; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 1px; color: rgba(255,255,255,0.4); }
.wb-nav-item {
  display: flex; align-items: center; gap: 0.5rem;
  width: 100%; padding: 0.65rem 1rem; border: none;
  background: transparent; color: rgba(255,255,255,0.75);
  font-size: 0.85rem; cursor: pointer; transition: all 0.15s;
  text-align: left; font-family: inherit;
}
.wb-nav-item:hover { background: rgba(255,255,255,0.08); color: #fff; }
.wb-nav-item.active { background: rgba(255,255,255,0.12); color: var(--gold-light); font-weight: 600; border-right: 3px solid var(--gold-light); }
.wb-nav-icon { font-size: 1rem; width: 1.25rem; text-align: center; }
.wb-nav-icon svg { width: 18px; height: 18px; display: block; margin: 0 auto; }

/* ═══ 待完善标签（蓝色，促进导向） ═══ */
.text-blue-600 { color: #2563eb; }
.border-blue-400 { border-color: #93c5fd; }
.tag-pending { background: #dbeafe; color: #1e40af; padding: 0.12rem 0.5rem; border-radius: 999px; font-size: 0.75rem; font-weight: 500; white-space: nowrap; }

.wb-main { flex: 1; min-width: 0; padding: 1rem 1.25rem; overflow-y: auto; }

/* 续展提醒卡片 */
.wb-alert-cards { display: flex; gap: 0.75rem; margin-bottom: 1rem; }
.alert-card { padding: 0.5rem 1rem; border-radius: 0.375rem; font-size: 0.85rem; display: flex; align-items: center; gap: 0.5rem; }
.alert-yellow { background: #fffbeb; border: 1px solid rgba(217,119,6,0.15); color: #92400e; }
.alert-grace { background: #fff7ed; border: 1px solid rgba(234,88,12,0.15); color: #9a3412; }
.alert-red { background: #fef2f2; border: 1px solid rgba(220,38,38,0.12); color: #991b1b; }
.alert-icon { font-size: 1rem; }

/* iframe 嵌入 */
.wb-iframe-wrap { background: #fafbfd; border-radius: 0.375rem; box-shadow: 0 2px 16px rgba(15,23,42,0.05); overflow: hidden; }
.wb-iframe { width: 100%; height: calc(100vh - 140px); border: none; display: block; }

/* 案件列表行样式 */
.case-no { color: #1e40af; font-weight: 700; font-size: 0.85rem; font-family: Consolas, "Courier New", monospace; }
.tag-new { background: #dbeafe; color: #1e40af; padding: 0.12rem 0.45rem; border-radius: 999px; font-size: 0.7rem; font-weight: 500; white-space: nowrap; }
.tag-renewal { background: #f3e8ff; color: #6b21a8; padding: 0.12rem 0.45rem; border-radius: 999px; font-size: 0.7rem; font-weight: 500; white-space: nowrap; }
.tag-change { background: #fef3c7; color: #92400e; padding: 0.12rem 0.45rem; border-radius: 999px; font-size: 0.7rem; font-weight: 500; white-space: nowrap; }
.tag-transfer { background: #d1fae5; color: #065f46; padding: 0.12rem 0.45rem; border-radius: 999px; font-size: 0.7rem; font-weight: 500; white-space: nowrap; }
.wb-actions { white-space: nowrap; }
.act-sep { color: #d1d5db; margin: 0 0.15rem; }

/* 续展监控面板 */
.stat-box { flex: 1; text-align: center; padding: 0.75rem; border-radius: 0.375rem; }
.stat-yellow { background: #fffbeb; border: 1px solid rgba(217,119,6,0.15); }
.stat-grace { background: #fff7ed; border: 1px solid rgba(234,88,12,0.15); }
.stat-red { background: #fef2f2; border: 1px solid rgba(220,38,38,0.12); }
.stat-gray { background: #f9fafb; border: 1px solid rgba(0,0,0,0.06); }
.stat-num { font-size: 1.5rem; font-weight: 700; }
.stat-yellow .stat-num { color: #b45309; }
.stat-grace .stat-num { color: #c2410c; }
.stat-red .stat-num { color: #dc2626; }
.stat-gray .stat-num { color: #6b7280; }
.stat-label { font-size: 0.75rem; color: #6b7280; margin-top: 0.15rem; }
.stat-green { background: #f0fdf4; border: 1px solid rgba(22,163,74,0.12); }
.stat-green .stat-num { color: #15803d; }

/* 续展监控 — 客户分组 */
.monitor-groups { max-height: calc(100vh - 340px); overflow-y: auto; }
.monitor-group { border: 1px solid rgba(0,0,0,0.08); border-radius: 0.5rem; overflow: hidden; background: #fff; }
.monitor-group-header { display: flex; align-items: center; gap: 0.75rem; padding: 0.65rem 1rem; cursor: pointer; user-select: none; background: #fafbfd; border-bottom: 1px solid transparent; transition: background 0.15s, border-color 0.15s; }
.monitor-group-header:hover { background: #f3f4f6; }
.monitor-group-header.mg-expanded { border-bottom-color: rgba(0,0,0,0.06); }
.group-header-unfiled { background: #eff6ff; border-left: 3px solid #3b82f6; }
.group-header-unfiled:hover { background: #dbeafe; }
.group-name { font-weight: 600; font-size: 0.875rem; color: #16161f; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-badge { font-size: 0.7rem; color: #6b7280; background: rgba(0,0,0,0.05); padding: 0.1rem 0.5rem; border-radius: 999px; white-space: nowrap; font-weight: 500; }
.group-arrow { color: #9ca3af; font-size: 0.65rem; width: 14px; flex-shrink: 0; transition: transform 0.2s; }
.group-stats { font-size: 0.75rem; gap: 0.5rem; }
.group-stats .status-draft,
.group-stats .status-confirmed,
.group-stats .mg-tag-red { font-size: 0.68rem; }
.mg-tag-red { background: #fef2f2; color: #991b1b; padding: 0.1rem 0.5rem; border-radius: 999px; font-size: 0.68rem; font-weight: 500; white-space: nowrap; display: inline-block; }
.mg-tag-grace { background: #fff7ed; color: #9a3412; padding: 0.1rem 0.5rem; border-radius: 999px; font-size: 0.68rem; font-weight: 500; white-space: nowrap; display: inline-block; }
.monitor-group-body { border-top: 1px solid rgba(0,0,0,0.06); }
.monitor-group-body .table-wrap { max-height: none; }
.monitor-group-body .table th { font-size: 0.75rem; padding: 0.4rem 0.5rem; }
.monitor-group-body .table td { font-size: 0.8rem; padding: 0.4rem 0.5rem; }

@media (max-width: 768px) {
  .monitor-groups { max-height: none; }
  .group-stats { gap: 0.35rem !important; font-size: 0.7rem; }
  .group-name { font-size: 0.8rem; }
  .monitor-group-header { padding: 0.5rem 0.75rem; gap: 0.5rem; }
}

.row-renewal td { background: #fffbeb; }
.row-grace td { background: #fff7ed; }
.row-expired td { background: #fff5f5; }
.row-discarded td { background: #f9fafb; color: #9ca3af; }
.row-ok td { background: #f0fdf4; }
.row-partial td { background: #fffbeb; }
.hidden { display: none !important; }

/* ═══ 仪表盘 ═══ */
.dash-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.dash-card { background: #fff; border: 1px solid rgba(0,0,0,0.06); border-radius: 0.5rem; padding: 1.25rem; }
.dash-card-wide { grid-column: span 2; }
.dash-card-title { font-size: 0.85rem; font-weight: 600; color: #374151; margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 1px solid rgba(0,0,0,0.06); }
.dash-stats-row { display: flex; gap: 1.5rem; }
.dash-stat { flex: 1; text-align: center; }
.dash-stat-num { font-size: 1.75rem; font-weight: 700; color: #16161f; }
.dash-stat-label { font-size: 0.75rem; color: #6b7280; margin-top: 0.15rem; }
.dash-type-bars { display: flex; flex-direction: column; gap: 0.5rem; }
.dash-type-bar { display: flex; align-items: center; gap: 0.75rem; cursor: pointer; transition: opacity 0.15s; }
.dash-type-bar:hover { opacity: 0.7; }
.dash-type-label { width: 60px; font-size: 0.8rem; color: #374151; text-align: right; flex-shrink: 0; }
.dash-type-count { width: 40px; font-size: 0.75rem; font-weight: 600; color: #6b7280; flex-shrink: 0; }
.dash-type-track { flex: 1; height: 6px; background: #f3f4f6; border-radius: 3px; overflow: hidden; }
.dash-type-fill { height: 100%; background: var(--blue); border-radius: 3px; transition: width 0.5s ease; }

/* ═══ 导航栏全局搜索 ═══ */
.navbar-search { position: relative; flex: 1; max-width: 320px; margin: 0 1rem; }
.navbar-search-input { width: 100%; padding: 0.35rem 0.75rem; border: 1px solid rgba(255,255,255,0.2); border-radius: 0.375rem; font-size: 0.8rem; background: rgba(255,255,255,0.1); color: #fff; outline: none; transition: border-color 0.15s, background 0.15s; }
.navbar-search-input::placeholder { color: rgba(255,255,255,0.5); }
.navbar-search-input:focus { border-color: rgba(255,255,255,0.5); background: rgba(255,255,255,0.15); }
.navbar-search-dropdown { position: absolute; top: 100%; left: 0; right: 0; margin-top: 4px; background: #fff; border-radius: 0.5rem; box-shadow: 0 8px 30px rgba(0,0,0,0.15); max-height: 400px; overflow-y: auto; z-index: 100; }
.search-group { padding: 0.5rem 0; }
.search-group + .search-group { border-top: 1px solid rgba(0,0,0,0.06); }
.search-group-title { padding: 0.25rem 0.75rem; font-size: 0.7rem; font-weight: 600; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.5px; }
.search-result-item { display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0.75rem; font-size: 0.85rem; color: #16161f; text-decoration: none; transition: background 0.1s; }
.search-result-item:hover { background: #f3f4f6; }
.search-result-no { font-family: Consolas, "Courier New", monospace; font-size: 0.8rem; color: #1e40af; font-weight: 600; }

/* ═══ 表格紧凑 ═══ */
.table-sm th { font-size: 0.75rem; padding: 0.4rem 0.5rem; }
.table-sm td { font-size: 0.8rem; padding: 0.4rem 0.5rem; }

@media (max-width: 768px) {
  .dash-grid { grid-template-columns: 1fr; }
  .dash-card-wide { grid-column: span 1; }
  .dash-stats-row { flex-wrap: wrap; gap: 0.75rem; }
  .navbar-search { max-width: 160px; }
}

/* ═══ embed 模式：平铺嵌入 iframe ═══ */
body.embed-mode { background: transparent !important; }
body.embed-mode .navbar { display: none !important; }
body.embed-mode .page-center { min-height: auto; padding: 0 !important; display: block; }
body.embed-mode .card { box-shadow: none !important; border-radius: 0 !important; background: transparent !important; border: none !important; }
body.embed-mode .card-header { border-bottom: 1px solid #e5e7eb; background: transparent; font-weight: 600; }
body.embed-mode .p-6, body.embed-mode .p-4 { padding: 1rem !important; }
body.embed-mode .mb-4 { margin-bottom: 0.5rem !important; }

/* case_form embed：隐藏右侧图片上传栏，表单全宽 */
body.embed-mode .layout-right { display: none !important; }
body.embed-mode .layout-left { max-width: 100% !important; }

/* embed 模式：去除所有最大宽度限制（无论 inline style 还是 CSS class） */
body.embed-mode .w-full[style*="max-width"] { max-width: none !important; }
body.embed-mode .max-w-3xl, body.embed-mode .max-w-4xl,
body.embed-mode .max-w-5xl, body.embed-mode .max-w-6xl,
body.embed-mode .max-w-2xl, body.embed-mode .max-w-sm { max-width: none !important; }
body.embed-mode .sidebar { top: 0 !important; max-height: calc(100vh - 100px) !important; }
body.embed-mode .table-wrap { max-height: calc(100vh - 160px) !important; }

/* admin embed：表单行自适应 */
body.embed-mode .flex.gap-3.items-end { flex-wrap: wrap; }

/* ═══ 动效 (motion v7) ═══ */

button:active { transform: scale(0.97); }

.alert-card, .stat-box {
  transition: transform 0.25s cubic-bezier(0.33, 1, 0.68, 1), box-shadow 0.25s cubic-bezier(0.33, 1, 0.68, 1);
}

/* Alpine x-transition 工具类 */
.transition { transition-property: opacity, transform; transition-timing-function: ease-out; }
.duration-200 { transition-duration: 200ms; }
.opacity-0 { opacity: 0; }
.scale-95 { transform: scale(0.95); }

/* ── 场景选择弹窗 ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999; backdrop-filter: blur(4px);
}
.modal-card {
  background: #fff; border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.25);
  width: 92%; max-width: 560px; max-height: 85vh; overflow-y: auto;
}
.modal-header {
  padding: 20px 24px 16px; border-bottom: 1px solid #e2e8f0;
}
.modal-body {
  padding: 20px 24px;
}
.modal-footer {
  padding: 16px 24px; border-top: 1px solid #e2e8f0;
  display: flex; justify-content: flex-end; gap: 8px;
}

/* 案件状态时间线 */
.status-timeline { display: flex; flex-direction: column; gap: 0; }
.status-tl-item { display: flex; gap: 12px; position: relative; padding-bottom: 16px; }
.status-tl-item:not(:last-child)::before {
  content: ''; position: absolute; left: 5px; top: 12px; bottom: 0;
  width: 2px; background: #e5e7eb;
}
.status-tl-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; margin-top: 3px; box-shadow: 0 0 0 3px rgba(0,0,0,0.04); }
.status-tl-body { flex: 1; min-width: 0; }
.status-tl-current .status-tl-body .font-medium { color: #16a34a; }

.scenario-options {
  display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px;
}
.scenario-card {
  display: block; padding: 14px 16px; border: 2px solid #e2e8f0;
  border-radius: 10px; cursor: pointer; transition: all .2s;
}
.scenario-card:hover { border-color: #93c5fd; background: #f8fafc; }
.scenario-card.active {
  border-color: #005bff; background: #eff6ff; box-shadow: 0 0 0 3px rgba(0,91,255,.12);
}
.scenario-title {
  font-weight: 700; font-size: .95rem; color: #1e293b; margin-bottom: 2px;
}
.scenario-desc {
  font-size: .82rem; color: #64748b;
}
.scenario-tip {
  font-size: .75rem; color: #b45309; margin-top: 4px; padding: 4px 8px;
  background: #fffbeb; border-radius: 4px; display: inline-block;
}
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0);
}

.gen-extra-form {
  margin-top: 8px; padding: 14px; background: #f8fafc;
  border-radius: 8px; border: 1px solid #e2e8f0;
}
.gen-extra-form .form-row-2 {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px;
}
.gen-info-box {
  padding: 12px 16px; background: #eff6ff; border-radius: 8px;
  font-size: .85rem; color: #1e40af; margin-top: 8px;
}

/* ═══ 移动端响应式 ═══ */
@media (max-width: 768px) {
  .wb-layout { flex-direction: column; }
  .wb-sidebar {
    width: 100%; flex-shrink: 0;
    flex-direction: row; flex-wrap: wrap;
    padding: 0.5rem; gap: 0.25rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .wb-brand { display: none; }
  .wb-nav-title { display: none; }
  .wb-nav-item {
    flex-shrink: 0; width: auto; padding: 0.4rem 0.75rem;
    border-radius: 999px; font-size: 0.78rem;
    border-right: none !important;
  }
  .wb-nav-item.active {
    background: rgba(255,255,255,0.2); color: #fff;
    border-right: none !important;
  }
  .wb-main { padding: 0.75rem; }
  .wb-iframe { height: calc(100vh - 200px); }
  .table-wrap {
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }
  .wb-alert-cards { flex-direction: column; }
  .wb-actions { white-space: normal; }
  .navbar { padding: 0 0.75rem; }
  .navbar-links { gap: 0.75rem; font-size: 0.8rem; }
  .card-header { padding: 0.75rem 1rem; flex-direction: column; gap: 0.5rem; }
  .card-header .btn { width: 100%; }
}

@media (max-width: 480px) {
  .wb-sidebar { padding: 0.35rem; gap: 0.2rem; }
  .wb-nav-item { padding: 0.3rem 0.6rem; font-size: 0.72rem; }
  .wb-main { padding: 0.5rem; }
  .page-center { padding: 1rem 0.5rem; }
  .stat-box { padding: 0.5rem; }
  .stat-num { font-size: 1.2rem; }
  .p-6 { padding: 1rem; }
  .p-8 { padding: 1rem; }
  .flex.gap-3.items-end { flex-direction: column; align-items: stretch; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
