/* Phase 4 - Offline SmartDispatch App Styles */

:root {
  --primary: #16a34a;
  --primary-dark: #047857;
  --primary-soft: rgba(22, 163, 74, 0.12);
  --accent: #20c997;
  --danger: #ef4444;
  --warning: #f59e0b;
  --success: #16a34a;
  --info: #2563eb;
  --bg: #f7fbf8;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-strong: rgba(255, 255, 255, 0.96);
  --text: #17231c;
  --muted: #607266;
  --line: rgba(22, 101, 52, 0.14);
  --line-strong: rgba(22, 163, 74, 0.26);
  --shadow: 0 20px 52px rgba(15, 118, 74, 0.11), 0 8px 22px rgba(17, 24, 39, 0.05);
  --shadow-soft: 0 10px 28px rgba(22, 163, 74, 0.11);
  --radius: 16px;
  --radius-sm: 10px;
  --nav-height: 74px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: linear-gradient(135deg, #fbfefc 0%, #eef8f1 54%, #f8fbf8 100%);
  font-family: "Inter", "MiSans", "HarmonyOS Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
}

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

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

[hidden] {
  display: none !important;
}

.app {
  position: relative;
  min-height: 100vh;
  padding: 24px 24px calc(var(--nav-height) + 28px);
}

.app::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(236, 253, 245, 0.44)),
    repeating-linear-gradient(90deg, rgba(22, 101, 52, 0.045) 0 1px, transparent 1px 88px);
  pointer-events: none;
}

main {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 16px;
  z-index: 20;
  width: min(1180px, calc(100% - 0px));
  margin: 0 auto 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: calc(var(--radius) + 4px);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
}

.brand {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.brand strong {
  overflow: hidden;
  color: #171a30;
  font-size: 18px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand span,
.subtle,
.meta {
  color: var(--muted);
}

.brand span {
  font-size: 13px;
}

.brand .connection-online {
  color: #20c997;
}

.brand .connection-warning {
  color: #d97706;
}

.brand .connection-offline {
  color: #f5a623;
}

.topbar-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  max-width: 52%;
}

.user-chip {
  flex: 0 0 auto;
  max-width: 100%;
  overflow: hidden;
  padding: 9px 13px;
  border: 1px solid rgba(22, 163, 74, 0.16);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(22, 163, 74, 0.13), rgba(4, 120, 87, 0.1));
  color: #047857;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.view {
  display: none;
}

.view.active {
  display: block;
  animation: fade-up 0.28s ease-out;
}

.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(245, 247, 255, 0.86);
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
}

.login-card {
  width: min(400px, 100%);
  padding: 40px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.login-card h1 {
  margin-bottom: 8px;
  font-size: 28px;
}

.login-card form {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.login-error {
  margin-bottom: 2px;
  color: var(--danger);
  font-size: 13px;
  font-weight: 750;
}

.page-head,
.toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.page-head {
  margin-bottom: 18px;
}

.panel .page-head {
  margin-bottom: 14px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(26px, 4vw, 40px);
  line-height: 1.12;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 12px;
  font-size: 16px;
  line-height: 1.35;
}

.subtle {
  margin-bottom: 0;
  font-size: 14px;
  line-height: 1.65;
}

.grid,
.detail-layout {
  display: grid;
  gap: 18px;
}

.grid {
  grid-template-columns: minmax(300px, 0.9fr) minmax(360px, 1.1fr);
  align-items: start;
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.detail-layout {
  grid-template-columns: minmax(300px, 0.82fr) minmax(420px, 1.18fr);
  align-items: start;
}

.panel,
.ticket-card,
.metric-card,
.detail-panel {
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
}

.panel {
  padding: 18px;
}

.compact-section {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
}

.compact-section > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 58px;
  padding: 15px 18px;
  cursor: pointer;
  list-style: none;
}

.compact-section > summary::-webkit-details-marker {
  display: none;
}

.compact-section > summary::after {
  content: "展开";
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(22, 163, 74, 0.1);
  color: #047857;
  font-size: 12px;
  font-weight: 800;
}

.compact-section[open] > summary::after {
  content: "收起";
}

.compact-title {
  color: #20233a;
  font-size: 16px;
  font-weight: 850;
}

.compact-subtitle {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: right;
}

.compact-body {
  padding: 0 18px 18px;
}

.compact-section[open] .compact-body {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.compact-section.workload-panel {
  padding: 0;
}

.compact-section.knowledge-compact .page-head {
  display: none;
}

.stack-offset-sm {
  margin-top: 12px;
}

.gap-top-md {
  margin-top: 16px;
}

.gap-bottom-md {
  margin-bottom: 16px;
}

.form-more {
  border: 1px solid rgba(22, 163, 74, 0.14);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.48);
}

.form-more summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  padding: 0 12px;
  color: #047857;
  cursor: pointer;
  font-size: 13px;
  font-weight: 850;
  list-style: none;
}

.form-more summary::-webkit-details-marker {
  display: none;
}

.form-more summary::after {
  content: "选填";
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.form-more[open] summary {
  border-bottom: 1px solid var(--line);
}

.form-more-grid {
  display: grid;
  grid-template-columns: minmax(180px, 0.78fr) minmax(240px, 1.22fr);
  gap: 12px;
  padding: 12px;
}

.report-section textarea,
.form-more textarea {
  min-height: 86px;
}

.detail-panel {
  min-height: 520px;
}

.form,
.inline-form {
  display: grid;
  gap: 14px;
}

.inline-form {
  display: none;
  grid-template-columns: repeat(5, minmax(130px, 1fr)) auto auto;
  align-items: end;
}

.inline-form.active {
  display: grid;
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  color: #343850;
  font-size: 13px;
  font-weight: 750;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(22, 163, 74, 0.18);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

input,
select {
  padding: 0 12px;
}

textarea {
  min-height: 118px;
  resize: vertical;
  padding: 12px;
  line-height: 1.55;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(22, 163, 74, 0.62);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.13);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  box-shadow: 0 12px 24px rgba(22, 163, 74, 0.24);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(4, 120, 87, 0.28);
  filter: saturate(1.05);
}

.btn:active {
  transform: translateY(0);
}

.btn.secondary {
  border: 1px solid rgba(22, 163, 74, 0.16);
  background: rgba(255, 255, 255, 0.84);
  color: #047857;
  box-shadow: 0 8px 18px rgba(22, 163, 74, 0.1);
}

.btn.complete {
  margin-top: 14px;
  background: linear-gradient(135deg, #22c55e 0%, #0f9f6e 100%);
  box-shadow: 0 12px 24px rgba(34, 197, 94, 0.2);
}

.btn:focus-visible,
.nav-btn:focus-visible,
.ticket-card:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(22, 163, 74, 0.25);
  outline-offset: 2px;
}

.ticket-list {
  display: grid;
  gap: 12px;
}

.ticket-card {
  width: 100%;
  display: block;
  padding: 15px;
  color: inherit;
  text-align: left;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.ticket-card:hover,
.ticket-card.active-card {
  transform: translateY(-2px);
  border-color: rgba(22, 163, 74, 0.34);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 20px 42px rgba(22, 163, 74, 0.17), 0 8px 20px rgba(17, 24, 39, 0.07);
}

.ticket-card.active-card {
  box-shadow: inset 4px 0 0 var(--primary), var(--shadow);
}

.ticket-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.ticket-title {
  margin-bottom: 7px;
  color: #20233a;
  font-size: 16px;
  font-weight: 850;
  line-height: 1.38;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.45;
}

.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 25px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.tag.pending,
.pending {
  background: #fff7ed;
  color: #c2410c;
}

.tag.processing,
.processing {
  background: #eaf0ff;
  color: #4357d6;
}

.tag.completed,
.completed {
  background: #dcfce7;
  color: #15803d;
}

.tag.urgent,
.urgent {
  background: #fee2e2;
  color: #dc2626;
}
.tag.network,
.network {
  background: #dbeafe;
  color: #1d4ed8;
}
.tag.hardware,
.hardware {
  background: #fef3c7;
  color: #92400e;
}
.tag.software,
.software {
  background: #dcfce7;
  color: #15803d;
}
.ticket-tags {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.empty {
  display: grid;
  min-height: 138px;
  place-items: center;
  border: 1px dashed rgba(22, 163, 74, 0.28);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.46);
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.metric-card {
  min-height: 126px;
  display: grid;
  align-content: space-between;
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.62)),
    linear-gradient(135deg, rgba(22, 163, 74, 0.12), rgba(4, 120, 87, 0.1));
}

.metric-card strong {
  font-size: 38px;
  line-height: 1;
}

.metric-card.metric-tone-primary {
  border-left: 4px solid #16a34a;
}

.metric-card.metric-tone-secondary {
  border-left: 4px solid #047857;
}

.metric-card.metric-tone-success {
  border-left: 4px solid #20c997;
}

.metric-card.metric-tone-warning {
  border-left: 4px solid #f5a623;
}

.metric-card.metric-tone-danger {
  border-left: 4px solid #e74c3c;
}

.trend-positive {
  color: #20c997;
}

.trend-negative {
  color: #e74c3c;
}

.forecast-note {
  margin-top: 12px;
}

.data-table {
  width: 100%;
  overflow: hidden;
  border-collapse: collapse;
  border: 1px solid rgba(22, 163, 74, 0.14);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.78);
}

.data-table th,
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(22, 163, 74, 0.12);
  color: #2d3148;
  font-size: 14px;
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  background: rgba(22, 163, 74, 0.08);
  color: #545a75;
  font-size: 12px;
  font-weight: 850;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.data-table td:last-child {
  text-align: right;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.info-item {
  display: grid;
  gap: 7px;
  padding: 13px;
  border: 1px solid rgba(22, 163, 74, 0.12);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.58);
}

.info-item span {
  color: var(--muted);
  font-size: 12px;
}

.info-item strong {
  color: #22263e;
  font-size: 14px;
  line-height: 1.35;
}

.section {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid rgba(22, 163, 74, 0.14);
}
.detail-fold {
  padding-top: 0;
}
.detail-fold > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid rgba(22, 163, 74, 0.14);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  cursor: pointer;
  list-style: none;
}
.detail-fold > summary::-webkit-details-marker {
  display: none;
}
.detail-fold > summary span {
  font-size: 15px;
  font-weight: 850;
}
.detail-fold > summary small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}
.detail-fold > summary::after {
  content: "展开";
  color: var(--primary);
  font-size: 12px;
  font-weight: 850;
}
.detail-fold[open] > summary::after {
  content: "收起";
}
.detail-fold-body {
  padding-top: 14px;
}

.description {
  margin: 14px 0 0;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.58);
  color: #363b54;
  line-height: 1.7;
}

.timeline {
  position: relative;
  display: grid;
  gap: 12px;
  padding-left: 18px;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 5px;
  width: 2px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--primary), var(--primary-dark));
}

.timeline-item {
  position: relative;
  display: grid;
  gap: 4px;
  padding: 11px 13px;
  border: 1px solid rgba(22, 163, 74, 0.12);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.62);
}

.timeline-item::before {
  content: "";
  position: absolute;
  top: 15px;
  left: -18px;
  width: 10px;
  height: 10px;
  border: 3px solid #fff;
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.18);
}

.timeline-item strong {
  color: #2a2e45;
  font-size: 14px;
  line-height: 1.45;
}

.ai-box {
  display: grid;
  gap: 10px;
  padding: 15px;
  border: 1px solid rgba(22, 163, 74, 0.2);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(22, 163, 74, 0.13), rgba(4, 120, 87, 0.12)),
    rgba(255, 255, 255, 0.62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58);
}

.ai-box p {
  margin: 0;
  color: #30354e;
  font-size: 14px;
  line-height: 1.75;
}

.knowledge-panel {
  display: grid;
  gap: 12px;
}

.knowledge-library-panel:empty {
  display: none;
}

.knowledge-page-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.88fr) minmax(420px, 1.12fr);
  gap: 18px;
  margin-top: 18px;
  align-items: start;
}

.knowledge-sync-status {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.knowledge-sync-status.online {
  color: var(--success);
}

.knowledge-sync-status.offline {
  color: var(--warning);
}

.knowledge-library {
  display: grid;
  gap: 12px;
}

.knowledge-library-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.knowledge-library-tools input {
  width: 100%;
}

.knowledge-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.standalone-knowledge-tree {
  gap: 10px;
}

.knowledge-library-empty {
  padding: 12px 13px;
  border: 1px dashed rgba(22, 163, 74, 0.28);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.48);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.knowledge-search-row input {
  width: 100%;
}

.knowledge-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.knowledge-results {
  display: grid;
  gap: 12px;
}

.knowledge-more {
  border: 1px solid rgba(22, 163, 74, 0.14);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.5);
}

.knowledge-more > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  padding: 0 12px;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  list-style: none;
}

.knowledge-more > summary::-webkit-details-marker {
  display: none;
}

.knowledge-more > summary::after {
  content: "+";
  color: var(--primary);
  font-size: 18px;
  line-height: 1;
}

.knowledge-more[open] > summary::after {
  content: "-";
}

.knowledge-more .knowledge-tree {
  padding: 0 12px 12px;
}

.diagnosis-output {
  display: grid;
  gap: 10px;
}

.diagnosis-empty {
  padding: 12px 13px;
  border: 1px dashed rgba(22, 163, 74, 0.28);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.48);
  color: var(--muted);
  font-size: 13px;
}

.diagnosis-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-left: 4px solid #2563eb;
  border-radius: var(--radius-sm);
  background: rgba(239, 246, 255, 0.72);
}

.diagnosis-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.diagnosis-card p {
  margin: 0;
  color: #30354e;
  line-height: 1.7;
}

.diagnosis-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.diagnosis-grid h4 {
  margin: 0 0 8px;
  color: #2b3049;
}

.diagnosis-grid ul,
.diagnosis-grid ol {
  margin: 0;
  padding-left: 18px;
  color: #30354e;
  line-height: 1.7;
}

.knowledge-focus {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.task-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 14px 0 16px;
  padding: 14px;
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: var(--radius-sm);
  background: rgba(255, 251, 235, 0.82);
}

.task-action-bar strong {
  display: block;
  margin-bottom: 2px;
  color: #92400e;
}

.security-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.schema-status {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
  padding: 13px;
  border: 1px solid rgba(22, 163, 74, 0.14);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.66);
}

.schema-status.online {
  border-color: rgba(22, 163, 74, 0.22);
  background: rgba(240, 253, 244, 0.72);
}

.schema-status.offline {
  border-color: rgba(239, 68, 68, 0.22);
  background: rgba(254, 242, 242, 0.72);
}

.schema-status-head,
.schema-check {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.schema-status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.schema-check {
  min-height: 52px;
  padding: 10px;
  border: 1px solid rgba(22, 163, 74, 0.12);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.66);
  color: #30354e;
}

.schema-check.ok strong {
  color: var(--success);
}

.schema-check.warn strong {
  color: var(--warning);
}

.schema-check.fail strong {
  color: var(--danger);
}

.schema-check small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
}

.knowledge-focus > div,
.security-summary > div {
  min-height: 70px;
  padding: 12px;
  border: 1px solid rgba(22, 163, 74, 0.14);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.64);
}

.knowledge-focus strong,
.security-summary strong {
  display: block;
  margin-top: 6px;
  color: #242842;
}

.knowledge-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.knowledge-columns > div,
.knowledge-node {
  border: 1px solid rgba(22, 163, 74, 0.14);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.62);
}

.knowledge-columns > div {
  padding: 13px;
}

.knowledge-columns h4 {
  margin: 0 0 8px;
  color: #2b3049;
}

.knowledge-columns ul,
.knowledge-node ol {
  margin: 0;
  padding-left: 18px;
  color: #30354e;
  line-height: 1.7;
}

.knowledge-tree {
  display: grid;
  gap: 8px;
}

.knowledge-node summary {
  cursor: pointer;
  padding: 12px 13px;
  color: #252a44;
  font-weight: 850;
}

.knowledge-node-body {
  display: grid;
  gap: 8px;
  padding: 0 13px 13px;
}

.security-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.security-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(22, 163, 74, 0.14);
  border-left: 4px solid #f59e0b;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.66);
}

.security-item.high {
  border-left-color: #dc2626;
}

.security-item p {
  margin: 5px 0 0;
  color: #4b5563;
  font-size: 13px;
}

.security-meta {
  display: grid;
  gap: 4px;
  justify-items: end;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.checklist {
  display: grid;
  gap: 10px;
}

.task-complete-body {
  display: grid;
  gap: 12px;
  align-items: start;
}

.task-complete-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.task-complete-head span {
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
}

.task-complete-head small {
  color: var(--muted);
  font-size: 12px;
}

.task-complete-body .complete {
  justify-self: start;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid rgba(22, 163, 74, 0.14);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.62);
  color: #333750;
  font-weight: 700;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.check-row.done {
  border-color: rgba(34, 197, 94, 0.25);
  background: rgba(220, 252, 231, 0.72);
  color: #166534;
}

.check-row input {
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  accent-color: var(--success);
}

.bottom-nav {
  position: fixed;
  right: 18px;
  bottom: 18px;
  left: auto;
  z-index: 30;
  width: min(520px, calc(100% - 36px));
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px;
  padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 18px 44px rgba(15, 118, 74, 0.18), 0 6px 16px rgba(17, 24, 39, 0.08);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
}

.bottom-nav.collapsed {
  width: auto;
  padding: 7px;
}

.bottom-nav-content {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.bottom-nav.collapsed .bottom-nav-content {
  display: none;
}

.bottom-nav-toggle {
  min-width: 48px;
  min-height: 40px;
  padding: 0 13px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-size: 13px;
  font-weight: 850;
  box-shadow: 0 10px 22px rgba(22, 163, 74, 0.24);
}

.nav-btn {
  min-height: 46px;
  padding: 0 16px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 850;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.nav-btn:hover {
  color: #047857;
  background: rgba(22, 163, 74, 0.08);
}

.nav-btn.active {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  box-shadow: 0 10px 22px rgba(22, 163, 74, 0.24);
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---- Phase 5 新增样式 ---- */

/* 危险按钮 */
.btn.danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #fff;
  box-shadow: 0 8px 18px rgba(239, 68, 68, 0.24);
}
.btn.secondary.danger {
  border-color: rgba(239, 68, 68, 0.2);
  background: rgba(255, 255, 255, 0.84);
  color: #dc2626;
  box-shadow: 0 8px 18px rgba(239, 68, 68, 0.1);
}
.btn.secondary.danger:hover {
  background: rgba(254, 226, 226, 0.6);
}

/* Toast 通知 */
.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  z-index: 100;
  transform: translateX(-50%);
  padding: 12px 24px;
  border-radius: 999px;
  background: linear-gradient(135deg, #1f2937, #374151);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  pointer-events: none;
  animation: toast-in 0.26s ease-out;
}
.toast.info { background: linear-gradient(135deg, #2563eb, #0f766e); }
.toast.success { background: linear-gradient(135deg, #16a34a, #0f9f6e); }
.toast.error { background: linear-gradient(135deg, #ef4444, #dc2626); }
@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* 筛选按钮行 */
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.filter-btn {
  min-height: 36px;
  padding: 0 14px;
  font-size: 13px;
}
.filter-count {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  margin-left: 8px;
  padding: 0 6px;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.34);
  font-size: 12px;
  font-weight: 850;
}
.btn.secondary .filter-count {
  background: rgba(22, 163, 74, 0.1);
  color: #047857;
}

/* 超时标记 */
.tag.overtime {
  background: #fff3cd;
  color: #b45309;
}
.overtime-text {
  color: var(--danger) !important;
}
.ticket-card.overtime {
  border-left: 4px solid var(--warning);
}
.ticket-card.urgent-card {
  border-left: 4px solid var(--danger);
}
.ticket-card.expected-late {
  box-shadow: inset 0 0 0 1px rgba(220, 38, 38, 0.2), var(--shadow);
}
.urgent-flash {
  animation: urgent-pulse 1.15s ease-in-out infinite;
}
@keyframes urgent-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.22); }
  50% { box-shadow: 0 0 0 7px rgba(220, 38, 38, 0.02); }
}
.request-note {
  border-left: 3px solid rgba(37, 99, 235, 0.3);
  background: rgba(37, 99, 235, 0.06);
}

/* 管理员操作区 */
.admin-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.admin-quick-actions {
  max-width: 560px;
}
.admin-page-head {
  margin-bottom: 14px;
}
.admin-command-center {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(22, 163, 74, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.06);
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
}
.admin-command-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.admin-command-head h2 {
  margin: 0 0 4px;
  font-size: 18px;
}
.admin-tool-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.admin-tool-btn {
  min-height: 54px;
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  text-align: left;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}
.admin-tool-btn:hover {
  border-color: var(--line-strong);
  box-shadow: 0 10px 24px rgba(22, 163, 74, 0.12);
  transform: translateY(-1px);
}
.admin-tool-btn strong {
  font-size: 14px;
  line-height: 1.25;
}
.admin-tool-btn span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
.admin-tool-btn.primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
}
.admin-tool-btn.primary span {
  color: rgba(255, 255, 255, 0.82);
}
.admin-more-tools {
  border-top: 1px solid rgba(22, 163, 74, 0.12);
  padding-top: 8px;
}
.admin-more-tools > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
  list-style: none;
}
.admin-more-tools > summary::-webkit-details-marker {
  display: none;
}
.admin-more-tools > summary:hover {
  background: rgba(22, 163, 74, 0.08);
}
.admin-more-tools > summary span {
  font-weight: 700;
}
.admin-more-tools > summary small {
  color: var(--muted);
  font-size: 12px;
}
.admin-more-tools > summary::after {
  content: "展开";
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}
.admin-more-tools[open] > summary::after {
  content: "收起";
}
.admin-secondary-tools {
  margin-top: 8px;
}
.admin-ticket-panel {
  margin-top: 0;
}
.admin-ticket-workspace {
  display: flex;
  gap: 12px;
  align-items: stretch;
  margin-top: 12px;
}
.admin-ticket-workspace > .admin-ticket-panel {
  flex: 0 0 58%;
  min-width: 360px;
}
.admin-ticket-workspace.admin-width-38 > .admin-ticket-panel { flex-basis: 38%; }
.admin-ticket-workspace.admin-width-40 > .admin-ticket-panel { flex-basis: 40%; }
.admin-ticket-workspace.admin-width-42 > .admin-ticket-panel { flex-basis: 42%; }
.admin-ticket-workspace.admin-width-44 > .admin-ticket-panel { flex-basis: 44%; }
.admin-ticket-workspace.admin-width-46 > .admin-ticket-panel { flex-basis: 46%; }
.admin-ticket-workspace.admin-width-48 > .admin-ticket-panel { flex-basis: 48%; }
.admin-ticket-workspace.admin-width-50 > .admin-ticket-panel { flex-basis: 50%; }
.admin-ticket-workspace.admin-width-52 > .admin-ticket-panel { flex-basis: 52%; }
.admin-ticket-workspace.admin-width-54 > .admin-ticket-panel { flex-basis: 54%; }
.admin-ticket-workspace.admin-width-56 > .admin-ticket-panel { flex-basis: 56%; }
.admin-ticket-workspace.admin-width-58 > .admin-ticket-panel { flex-basis: 58%; }
.admin-ticket-workspace.admin-width-60 > .admin-ticket-panel { flex-basis: 60%; }
.admin-ticket-workspace.admin-width-62 > .admin-ticket-panel { flex-basis: 62%; }
.admin-ticket-workspace.admin-width-64 > .admin-ticket-panel { flex-basis: 64%; }
.admin-ticket-workspace.admin-width-66 > .admin-ticket-panel { flex-basis: 66%; }
.admin-ticket-workspace.admin-width-68 > .admin-ticket-panel { flex-basis: 68%; }
.admin-ticket-workspace.admin-width-70 > .admin-ticket-panel { flex-basis: 70%; }
.admin-ticket-workspace.admin-width-72 > .admin-ticket-panel { flex-basis: 72%; }
.admin-ticket-workspace > .admin-report-panel {
  flex: 1 1 320px;
  min-width: 320px;
  align-self: stretch;
}
.admin-workspace-resizer {
  flex: 0 0 12px;
  align-self: stretch;
  min-height: 120px;
  border: 1px solid rgba(22, 163, 74, 0.12);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(22, 163, 74, 0.08), rgba(4, 120, 87, 0.08)),
    rgba(255, 255, 255, 0.5);
  cursor: col-resize;
  touch-action: none;
}
.admin-workspace-resizer::before {
  content: "";
  display: block;
  width: 3px;
  height: 46px;
  margin: 18px auto 0;
  border-radius: 999px;
  background: rgba(22, 163, 74, 0.38);
}
.admin-workspace-resizer:hover,
.admin-workspace-resizer:focus-visible,
body.is-resizing-admin-workspace .admin-workspace-resizer {
  border-color: rgba(22, 163, 74, 0.32);
  background: rgba(22, 163, 74, 0.12);
  outline: none;
}
body.is-resizing-admin-workspace {
  cursor: col-resize;
  user-select: none;
}
.admin-report-panel {
  margin-top: 0;
}
.field-hint {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
.admin-queue-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(22, 163, 74, 0.14);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.56);
}
.admin-queue-toolbar strong {
  display: block;
  margin-bottom: 2px;
  color: var(--text);
  font-size: 14px;
}
.admin-queue-note {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.admin-ticket-card {
  padding: 13px 14px;
}
.admin-ticket-card .ticket-top {
  gap: 10px;
}
.admin-ticket-desc {
  display: -webkit-box;
  margin: 8px 0 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.admin-section-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.admin-section-grid .admin-section {
  margin-top: 0;
}
.admin-section-grid #admin-knowledge-panel {
  display: contents;
}
.admin-section-grid .admin-section:not(#admin-knowledge-panel):not([open]),
.admin-section-grid #admin-knowledge-panel .compact-section:not([open]) {
  display: none;
}
.admin-section-grid .compact-section[open] {
  grid-column: 1 / -1;
}
.admin-section {
  margin-top: 14px;
}
.admin-ticket-panel .page-head,
.admin-section .compact-body > .page-head:first-child {
  margin-bottom: 12px;
}
.admin-ticket-actions {
  align-items: center;
  margin-top: 6px;
}
.assignment-control {
  display: grid;
  grid-template-columns: minmax(160px, 220px) auto;
  gap: 8px;
  align-items: center;
}
.assignment-control-wide {
  grid-template-columns: minmax(130px, 170px) minmax(160px, 220px) auto;
}
.assignment-control select {
  min-height: 38px;
  font-size: 13px;
}
.assignment-control .btn {
  min-height: 38px;
  white-space: nowrap;
}
.reject-note {
  margin-top: 8px;
  padding: 8px 10px;
  border-left: 3px solid var(--warning);
  border-radius: 6px;
  background: rgba(245, 158, 11, 0.1);
}
.reject-note span {
  display: inline-block;
  margin-left: 10px;
}
.readonly-field {
  min-height: 42px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(22, 163, 74, 0.06);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

/* 工程师确认按钮区 */
.engineer-confirm {
  gap: 12px;
  flex-wrap: wrap;
}

/* 预测面板 */
.forecast-controls { display: flex; gap: 24px; flex-wrap: wrap; margin: 16px 0; }
.date-range { flex: 1; min-width: 200px; }
.date-range strong { display: block; margin-bottom: 8px; }
.date-inputs { display: flex; gap: 12px; }
.date-inputs .field { flex: 1; }
.date-inputs .field input { font-size: 13px; }

/* 数据分析面板 */
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.analytics-section {
  min-width: 0;
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(22, 163, 74, 0.13);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.48);
}
.analytics-wide {
  grid-column: 1 / -1;
}
.analytics-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.analytics-share-bar {
  height: 18px;
  overflow: hidden;
  display: flex;
  border-radius: 999px;
  background: rgba(22, 163, 74, 0.1);
}
.analytics-share-bar.empty-bar {
  border: 1px dashed rgba(22, 163, 74, 0.24);
  background: rgba(255, 255, 255, 0.5);
}
.analytics-share-segment.hardware,
.analytics-legend-row i.hardware,
.duration-item.hardware {
  background: #2563eb;
}
.analytics-share-segment.network,
.analytics-legend-row i.network,
.duration-item.network {
  background: #0ea5e9;
}
.analytics-share-segment.software,
.analytics-legend-row i.software,
.duration-item.software {
  background: #20c997;
}
.analytics-share-segment.urgent,
.analytics-legend-row i.urgent {
  background: #ef4444;
}
.analytics-share-segment.normal,
.analytics-legend-row i.normal {
  background: #f59e0b;
}
.analytics-share-segment {
  flex: 0 0 auto;
}
.pct-0 {
  width: 0%;
}
.pct-5 {
  width: 5%;
}
.pct-10 {
  width: 10%;
}
.pct-15 {
  width: 15%;
}
.pct-20 {
  width: 20%;
}
.pct-25 {
  width: 25%;
}
.pct-30 {
  width: 30%;
}
.pct-35 {
  width: 35%;
}
.pct-40 {
  width: 40%;
}
.pct-45 {
  width: 45%;
}
.pct-50 {
  width: 50%;
}
.pct-55 {
  width: 55%;
}
.pct-60 {
  width: 60%;
}
.pct-65 {
  width: 65%;
}
.pct-70 {
  width: 70%;
}
.pct-75 {
  width: 75%;
}
.pct-80 {
  width: 80%;
}
.pct-85 {
  width: 85%;
}
.pct-90 {
  width: 90%;
}
.pct-95 {
  width: 95%;
}
.pct-100 {
  width: 100%;
}
.analytics-legend {
  display: grid;
  gap: 8px;
}
.analytics-legend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #343850;
  font-size: 13px;
}
.analytics-legend-row span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.analytics-legend-row i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}
.trend-chart {
  min-height: 148px;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  padding: 12px 6px 0;
  border-bottom: 1px solid rgba(22, 163, 74, 0.18);
}
.trend-bar {
  flex: 1;
  min-width: 4px;
  position: relative;
  border-radius: 5px 5px 0 0;
  background: linear-gradient(180deg, #2563eb, #20c997);
}
.trend-h-0 {
  height: 2px;
}
.trend-h-5 {
  height: 8px;
}
.trend-h-10 {
  height: 12px;
}
.trend-h-15 {
  height: 18px;
}
.trend-h-20 {
  height: 24px;
}
.trend-h-25 {
  height: 30px;
}
.trend-h-30 {
  height: 36px;
}
.trend-h-35 {
  height: 42px;
}
.trend-h-40 {
  height: 48px;
}
.trend-h-45 {
  height: 54px;
}
.trend-h-50 {
  height: 60px;
}
.trend-h-55 {
  height: 66px;
}
.trend-h-60 {
  height: 72px;
}
.trend-h-65 {
  height: 78px;
}
.trend-h-70 {
  height: 84px;
}
.trend-h-75 {
  height: 90px;
}
.trend-h-80 {
  height: 96px;
}
.trend-h-85 {
  height: 102px;
}
.trend-h-90 {
  height: 108px;
}
.trend-h-95 {
  height: 114px;
}
.trend-h-100 {
  height: 120px;
}
.trend-bar span {
  position: absolute;
  right: 50%;
  bottom: calc(100% + 4px);
  transform: translateX(50%);
  color: var(--muted);
  font-size: 10px;
  line-height: 1;
}
.trend-axis {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}
.ranking-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ranking-list li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 8px 10px;
  align-items: center;
}
.rank-index {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 999px;
  background: rgba(22, 163, 74, 0.14);
  color: #047857;
  font-size: 12px;
  font-weight: 850;
}
.rank-name {
  overflow: hidden;
  color: #2d3148;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rank-count {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}
.rank-meter {
  grid-column: 2 / -1;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(22, 163, 74, 0.1);
}
.rank-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #20c997);
}
.duration-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.duration-item {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: var(--radius-sm);
  color: #fff;
}
.duration-item span {
  font-size: 13px;
  opacity: 0.88;
}
.duration-item strong {
  font-size: 24px;
  line-height: 1.2;
}
.analytics-empty {
  min-height: 96px;
}

/* 角色标签 */
.role-home-chip {
  max-width: min(260px, 46vw);
  overflow: hidden;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-logout-btn { padding: 6px 14px; }

/* 员工统计 */
.employee-stat-grid { margin-top: 18px; }

/* Responsive breakpoints */
@media (min-width: 1025px) {
  .grid {
    grid-template-columns: minmax(300px, 0.9fr) minmax(360px, 1.1fr);
  }

  .grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .detail-layout {
    grid-template-columns: minmax(300px, 0.82fr) minmax(420px, 1.18fr);
  }

  .inline-form {
    grid-template-columns: repeat(5, minmax(130px, 1fr)) auto auto;
  }
}

@media (max-width: 768px) {
  .grid,
  .detail-layout,
  .grid.three,
  .analytics-grid,
  .knowledge-page-layout,
  .diagnosis-grid,
  .knowledge-library-tools,
  .knowledge-columns,
  .admin-tool-grid,
  .admin-section-grid,
  .security-summary,
  .duration-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-ticket-workspace {
    flex-direction: column;
  }

  .admin-workspace-resizer {
    display: none;
  }

  .admin-ticket-workspace > .admin-ticket-panel,
  .admin-ticket-workspace > .admin-report-panel {
    flex-basis: auto;
    min-width: 0;
    width: 100%;
  }

  .inline-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .inline-form .btn {
    grid-column: auto;
  }
}

@media (max-width: 480px) {
  .app {
    padding: 14px 12px calc(var(--nav-height) + 22px + env(safe-area-inset-bottom, 0px));
  }

  .topbar {
    position: static;
    flex-direction: column;
    align-items: stretch;
    padding: 14px;
    border-radius: var(--radius);
  }

  .brand strong {
    white-space: normal;
  }

  .user-chip {
    max-width: none;
    width: 100%;
  }

  .topbar-actions {
    width: 100%;
    max-width: none;
    flex-direction: column;
    align-items: stretch;
  }

  .login-card {
    padding: 28px;
  }

  .page-head,
  .toolbar,
  .ticket-top,
  .task-action-bar,
  .analytics-title-row {
    flex-direction: column;
    align-items: stretch;
  }

  h1 {
    font-size: 28px;
  }

  .panel {
    padding: 14px;
  }

  .grid,
  .detail-layout,
  .grid.three,
  .inline-form,
  .info-grid,
  .analytics-grid,
  .knowledge-page-layout,
  .diagnosis-grid,
  .knowledge-library-tools,
  .knowledge-search-row,
  .knowledge-columns,
  .admin-tool-grid,
  .admin-section-grid,
  .admin-ticket-workspace,
  .form-more-grid,
  .security-summary,
  .duration-grid {
    grid-template-columns: 1fr;
  }

  .form,
  .inline-form,
  .login-card form,
  .field {
    width: 100%;
    min-width: 0;
  }

  .inline-form .btn {
    grid-column: 1 / -1;
  }

  .forecast-controls,
  .date-inputs,
  .admin-actions,
  .admin-quick-actions,
  .admin-queue-toolbar,
  .admin-command-head,
  .admin-more-tools > summary,
  .security-item,
  .compact-section > summary,
  .engineer-confirm {
    flex-direction: column;
    align-items: stretch;
  }

  .assignment-control {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .assignment-control .btn {
    justify-content: center;
  }

  .compact-subtitle {
    text-align: left;
  }

  .date-range {
    width: 100%;
    min-width: 0;
  }

  .data-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  button,
  .btn,
  .filter-btn,
  .nav-btn {
    min-height: 44px;
  }

  .bottom-nav {
    right: 12px;
    bottom: 12px;
    left: 0;
    left: auto;
    width: min(360px, calc(100% - 24px));
    border-radius: 999px;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px));
  }

  .bottom-nav.collapsed {
    width: auto;
  }

  .nav-btn {
    padding: 0 10px;
    font-size: 13px;
  }
}

/* [CSS_PHASE4_REWRITE_DONE] */
/* Engineer workspace scoped overrides */
.engineer-workspace .engineer-ticket-panel {
  padding: 22px;
}

.engineer-workspace .engineer-task-panel {
  min-height: 580px;
  padding: 22px;
}

.engineer-workspace .ticket-card {
  padding: 18px;
  border-radius: 18px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.engineer-workspace .ticket-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(22, 163, 74, 0.18);
}

.engineer-workspace .ticket-card.active-card {
  border-left: 4px solid var(--primary);
}

.engineer-workspace .ticket-title {
  font-size: 17px;
}

.engineer-workspace .meta {
  font-size: 13px;
  gap: 10px 12px;
  margin-top: 12px;
}

.engineer-workspace .info-grid {
  gap: 14px;
}

.engineer-workspace .description {
  padding: 16px;
}

.engineer-workspace .ai-box {
  padding: 18px;
  gap: 12px;
}

.engineer-workspace .ai-box p {
  line-height: 1.8;
}

.engineer-workspace .check-row {
  padding: 12px 14px;
}

.engineer-workspace .timeline {
  gap: 14px;
}

.engineer-workspace .engineer-confirm {
  gap: 16px;
  margin-top: 16px;
}

/* Employee workspace scoped overrides */
.employee-workspace.employee-stat-grid {
  margin-bottom: 22px;
}

.employee-workspace .panel {
  padding: 22px;
}

.employee-workspace .form {
  gap: 18px;
}

.employee-workspace .field {
  gap: 10px;
}

.employee-workspace .ticket-list {
  gap: 16px;
}

.employee-workspace .ticket-card {
  padding: 18px;
  border-color: rgba(37, 99, 235, 0.18);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(239, 246, 255, 0.82)),
    linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(14, 165, 233, 0.08));
  box-shadow: 0 14px 34px rgba(37, 99, 235, 0.1), 0 6px 18px rgba(15, 23, 42, 0.06);
}

.employee-workspace .ticket-card:hover,
.employee-workspace .ticket-card.active-card {
  border-color: rgba(37, 99, 235, 0.36);
  box-shadow: 0 20px 42px rgba(37, 99, 235, 0.16), 0 8px 22px rgba(15, 23, 42, 0.08);
}

.employee-workspace .metric-card {
  min-height: 138px;
  padding: 22px;
  border-color: rgba(37, 99, 235, 0.2);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(239, 246, 255, 0.82)),
    linear-gradient(135deg, rgba(37, 99, 235, 0.16), rgba(14, 165, 233, 0.12));
  box-shadow: 0 18px 40px rgba(37, 99, 235, 0.14), 0 8px 20px rgba(15, 23, 42, 0.06);
}

.employee-workspace .metric-card strong {
  color: #1d4ed8;
  font-size: 42px;
}

/* Employee column (vertical) layout */
.employee-column {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.employee-column .panel {
  width: 100%;
}
/* Engineer column (vertical) layout */
.engineer-column {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.engineer-column .engineer-ticket-panel {
  width: 100%;
}

.engineer-column .engineer-task-panel {
  width: 100%;
}

/* Workload stats styles */
.workload-panel {
  padding: 22px;
}

.workload-filters {
  display: flex;
  gap: 8px;
  margin: 14px 0;
}

.workload-filters .workload-filter.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
}

.workload-stats {
  min-height: 100px;
}

.workload-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.workload-card {
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px solid rgba(22, 163, 74, 0.16);
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(255,255,255,0.92), rgba(239,246,255,0.78));
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.08);
}

.workload-card strong {
  font-size: 32px;
  color: var(--primary);
  line-height: 1;
}

.workload-timeline {
  display: grid;
  gap: 8px;
}

.workload-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border: 1px solid rgba(22, 163, 74, 0.1);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.6);
}

.workload-title {
  font-weight: 700;
  color: #20233a;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  margin-right: 12px;
}

.workload-item .subtle {
  font-size: 12px;
  flex-shrink: 0;
}

.workload-empty {
  display: grid;
  min-height: 80px;
  place-items: center;
  border: 1px dashed rgba(22, 163, 74, 0.2);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 480px) {
  .workload-grid {
    grid-template-columns: 1fr;
  }
}
