/* ==========================================================================
   文广旅局机关内部智效协同工作台 (Codex 智能体原生直连版)
   专业政务现代风 + AI 极客动效样式表
   ========================================================================== */

:root {
  --gov-blue-dark: #071526;
  --gov-blue: #0f2744;
  --gov-blue-light: #1b3d66;
  --gov-blue-subtle: #ebf4fc;
  --gov-gold: #c59b27;
  --gov-gold-light: #fef3c7;
  --gov-red: #dc2626;
  --gov-red-light: #fee2e2;

  --codex-green: #10b981;
  --codex-cyan: #06b6d4;
  --codex-purple: #a855f7;

  --bg-app: #f1f5f9;
  --bg-card: #ffffff;
  --bg-subtle: #f8fafc;
  --border-color: #e2e8f0;
  --border-focus: #0f2744;

  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.08);

  --font-sans: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Noto Serif SC', 'Songti SC', SimSun, serif;
  --font-mono: 'Fira Code', Consolas, monospace;

  --header-height: 110px;
  --mobile-bottom-height: 60px;
}

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

html {
  font-size: 15px;
  background-color: var(--bg-app);
  color: var(--text-main);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  padding-bottom: calc(var(--mobile-bottom-height) + 20px);
}

@media (min-width: 860px) {
  body {
    padding-bottom: 40px;
  }
}

a, button {
  font-family: inherit;
  transition: all 0.2s ease;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

input, select, textarea {
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text-main);
  background-color: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  width: 100%;
  transition: all 0.2s ease;
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(15, 39, 68, 0.12);
}

textarea {
  resize: vertical;
  line-height: 1.6;
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}

/* ==========================================================================
   Header & Tabs
   ========================================================================== */
.app-header {
  background: linear-gradient(135deg, var(--gov-blue-dark) 0%, var(--gov-blue) 100%);
  color: #fff;
  box-shadow: 0 4px 15px rgba(7, 21, 38, 0.25);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.85rem 1.25rem 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-area {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.emblem-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--gov-gold), #dfa72d);
  color: var(--gov-blue-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(197, 155, 39, 0.4);
}

.brand-title-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #fff;
}

.codex-engine-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-mono);
}

.pulse-green {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0% { opacity: 0.6; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.3); }
  100% { opacity: 0.6; transform: scale(0.9); }
}

.brand-sub {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.75);
  display: block;
}

.btn-codex-status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
}

.btn-codex-status:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.35);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.status-dot.online {
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

.nav-tabs-bar {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-tabs-bar::-webkit-scrollbar {
  display: none;
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1rem;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.88rem;
  font-weight: 600;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.nav-tab:hover {
  color: #fff;
}

.nav-tab.active {
  color: #fff;
  border-bottom-color: var(--gov-gold);
  background: rgba(255, 255, 255, 0.08);
  border-top-left-radius: var(--radius-sm);
  border-top-right-radius: var(--radius-sm);
}

/* ==========================================================================
   Main Content Layout
   ========================================================================== */
.main-content {
  max-width: 1200px;
  margin: 1.5rem auto;
  padding: 0 1.25rem;
}

.tab-pane {
  display: none;
}
.tab-pane.active {
  display: block;
}

.section-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.card-header {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--border-color);
}

@media (min-width: 768px) {
  .card-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gov-blue-dark);
}

.card-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.preset-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.btn-preset {
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--gov-blue-subtle);
  color: var(--gov-blue);
  border: 1px solid #c8e1fa;
  border-radius: var(--radius-full);
}

.btn-preset:hover {
  background: #dbeafe;
}

/* Sub-tool Tabs */
.sub-tool-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
  overflow-x: auto;
}

.sub-tab {
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.sub-tab.active {
  background: var(--gov-blue);
  color: #fff;
}

.sub-pane {
  display: none;
}
.sub-pane.active {
  display: block;
}

/* Form Grid */
.form-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1rem;
}

.col-4 { grid-column: span 12; }
.col-6 { grid-column: span 12; }
.col-12 { grid-column: span 12; }

@media (min-width: 768px) {
  .col-4 { grid-column: span 4; }
  .col-6 { grid-column: span 6; }
}

.d-flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.badge-hint {
  font-size: 0.75rem;
  font-weight: normal;
  color: #059669;
  background: #ecfdf5;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  border: 1px solid #a7f3d0;
}

/* Checkbox Grid for Enforcement */
.checkbox-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
}

@media (min-width: 640px) {
  .checkbox-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: var(--text-main);
  cursor: pointer;
  margin-bottom: 0;
}

.checkbox-item input {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* Action Buttons */
.form-actions {
  margin-top: 0.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.4rem;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.btn-primary {
  background: linear-gradient(135deg, var(--gov-blue-dark), var(--gov-blue));
  color: #fff;
  width: 100%;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--gov-blue), var(--gov-blue-light));
  box-shadow: 0 4px 12px rgba(15, 39, 68, 0.25);
}

.btn-codex {
  background: linear-gradient(135deg, #0f2744 0%, #064e3b 100%);
  border: 1px solid rgba(16, 185, 129, 0.4);
  position: relative;
  overflow: hidden;
}

.btn-codex:hover {
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.35);
  border-color: #34d399;
}

.btn-warning {
  background: linear-gradient(135deg, #b45309, #d97706);
  color: #fff;
  width: 100%;
}

.btn-warning:hover {
  background: linear-gradient(135deg, #d97706, #f59e0b);
}

.btn-secondary {
  background: var(--gov-blue-subtle);
  color: var(--gov-blue);
  border: 1px solid #bfdbfe;
}

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

.w-100 {
  width: 100%;
}

/* ==========================================================================
   Live Agent Trace Thinking Flow Box
   ========================================================================== */
.agent-trace-box {
  background: #0f172a;
  color: #e2e8f0;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #334155;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.trace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.trace-badge {
  font-weight: 700;
  color: #38bdf8;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.trace-timer {
  color: #94a3b8;
  font-size: 0.75rem;
}

.trace-steps {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.trace-step-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #cbd5e1;
}

.step-icon-done {
  color: #34d399;
  font-weight: bold;
}

.step-icon-active {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #38bdf8;
  animation: pulse-dot 1s infinite;
}

/* ==========================================================================
   Codex Assistant Chat Box
   ========================================================================== */
.chat-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chat-messages {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  min-height: 260px;
  max-height: 420px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chat-bubble {
  display: flex;
  gap: 0.75rem;
  max-width: 90%;
}

.chat-bubble.ai {
  align-self: flex-start;
}

.chat-bubble.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.bubble-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--gov-blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.chat-bubble.user .bubble-avatar {
  background: #3b82f6;
}

.bubble-content {
  background: #fff;
  border: 1px solid var(--border-color);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

.chat-bubble.user .bubble-content {
  background: var(--gov-blue-subtle);
  border-color: #bfdbfe;
  color: var(--gov-blue-dark);
}

.chat-input-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
}

.chat-input-row textarea {
  flex: 1;
}

.chat-input-row button {
  width: auto;
  padding: 0.75rem 1.4rem;
  white-space: nowrap;
}

/* ==========================================================================
   Toolbox: Capacity Calculator & Law Library
   ========================================================================== */
.tools-grid-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 860px) {
  .tools-grid-layout {
    grid-template-columns: repeat(2, 1fr);
  }
}

.tool-box-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.tool-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gov-blue-dark);
  margin-bottom: 0.4rem;
}

.tool-card-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.calc-inputs {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.calc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.calc-row label {
  font-size: 0.82rem;
  margin-bottom: 0;
  flex: 1;
}

.calc-row input {
  width: 140px;
  padding: 0.4rem 0.6rem;
  font-size: 0.88rem;
}

.calc-results {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  margin-bottom: 1rem;
}

.result-metric {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0;
  border-bottom: 1px dashed var(--border-color);
  font-size: 0.85rem;
}

.result-metric:last-child {
  border-bottom: none;
}

.metric-label {
  color: var(--text-muted);
}

.metric-val {
  font-weight: 700;
  color: var(--gov-blue-dark);
  font-family: var(--font-mono);
}

.warning-yellow {
  color: #b45309;
}
.warning-red {
  color: #dc2626;
}
.warning-green {
  color: #15803d;
}

/* Law Library */
.law-search-box {
  margin-bottom: 0.75rem;
}

.law-pills {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

.law-pill {
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  background: #e2e8f0;
  color: var(--text-muted);
  cursor: pointer;
}

.law-pill.active {
  background: var(--gov-blue);
  color: #fff;
}

.law-list {
  max-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.law-card {
  background: #fff;
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--gov-blue);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
}

.law-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--gov-blue);
  margin-bottom: 0.25rem;
}

.law-body {
  font-size: 0.78rem;
  color: var(--text-main);
  line-height: 1.5;
}

/* ==========================================================================
   Output Document Canvas & Red-Head Gov Styling
   ========================================================================== */
.doc-output-container {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  margin-top: 2rem;
}

.output-header {
  background: #f8fafc;
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 1.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.output-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.doc-type-tag {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  background: var(--gov-blue);
  color: #fff;
}

.output-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gov-blue-dark);
}

.output-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  background: #fff;
  border: 1px solid var(--border-color);
  color: var(--gov-blue);
}

.btn-action:hover {
  background: var(--gov-blue-subtle);
  border-color: var(--gov-blue);
}

.doc-canvas {
  padding: 2.5rem 2rem;
  background: #fafafa;
  min-height: 380px;
}

.empty-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 1rem;
  color: var(--text-muted);
  text-align: center;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.7;
}

/* ==========================================================================
   Red-Head Gov Doc Styles (红头公文样式)
   ========================================================================== */
.redhead-doc {
  background: #fff;
  max-width: 820px;
  margin: 0 auto;
  padding: 2.5rem 3rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid #e5e7eb;
  position: relative;
  font-family: var(--font-serif);
}

.redhead-top-title {
  text-align: center;
  color: var(--gov-red);
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  margin-bottom: 0.85rem;
  font-family: var(--font-serif);
}

.redhead-fileno {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.95rem;
  color: #333;
  margin-bottom: 0.4rem;
  font-family: var(--font-sans);
}

.redhead-divider {
  height: 3px;
  background: var(--gov-red);
  margin-bottom: 1.75rem;
}

.redhead-main-title {
  text-align: center;
  font-size: 1.45rem;
  font-weight: 700;
  color: #111;
  margin-bottom: 1.5rem;
  line-height: 1.45;
  font-family: var(--font-serif);
}

.redhead-content {
  font-size: 1.05rem;
  line-height: 1.85;
  color: #111;
  font-family: var(--font-serif);
}

.redhead-content p {
  text-indent: 2em;
  margin-bottom: 0.85rem;
}

.redhead-content h4 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 1.25rem 0 0.5rem;
  color: #111;
  text-indent: 2em;
}

.redhead-sign-block {
  margin-top: 3rem;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-family: var(--font-serif);
  position: relative;
}

.sign-org {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.sign-date {
  font-size: 1.05rem;
}

.seal-mockup {
  position: absolute;
  top: -20px;
  right: 15px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 3px solid rgba(220, 38, 38, 0.5);
  color: rgba(220, 38, 38, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  text-align: center;
  transform: rotate(-15deg);
  pointer-events: none;
}

/* Highlight boxes inside doc */
.audit-alert-box {
  background: #fef2f2;
  border-left: 4px solid var(--gov-red);
  padding: 0.85rem 1.1rem;
  margin: 1rem 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-family: var(--font-sans);
  font-size: 0.9rem;
}

.audit-alert-title {
  font-weight: 700;
  color: #991b1b;
  margin-bottom: 0.35rem;
}

.sensitive-tag {
  background: #fee2e2;
  color: #b91c1c;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  font-weight: 700;
  border: 1px solid #f87171;
}

/* ==========================================================================
   Settings Modal
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1.25rem;
}

.modal-overlay.open {
  display: flex;
}

.modal-card {
  background: #fff;
  border-radius: var(--radius-lg);
  max-width: 500px;
  width: 100%;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.modal-header {
  padding: 1.25rem 1.5rem;
  background: var(--gov-blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

.btn-close-modal {
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
}

.modal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-color);
}

/* ==========================================================================
   Mobile Bottom Nav Bar
   ========================================================================== */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--mobile-bottom-height);
  background: var(--gov-blue-dark);
  display: flex;
  align-items: center;
  justify-content: space-around;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 99;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

@media (min-width: 860px) {
  .mobile-bottom-nav {
    display: none;
  }
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.4rem 0.6rem;
}

.mobile-nav-item .m-icon {
  font-size: 1.15rem;
}

.mobile-nav-item.active {
  color: var(--gov-gold);
}

/* ==========================================================================
   Toast Notification
   ========================================================================== */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(50px);
  background: #1e293b;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1000;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  visibility: visible;
}

/* ==========================================================================
   Print Styles for Redhead Gov Docs
   ========================================================================== */
@media print {
  body {
    background: #fff;
    padding: 0;
  }
  .app-header, .section-card, .output-header, .agent-trace-box, .mobile-bottom-nav, .preset-selector, .toast {
    display: none !important;
  }
  .main-content, .doc-output-container, .doc-canvas {
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: #fff !important;
  }
  .redhead-doc {
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    max-width: 100% !important;
  }
}

/* ==========================================================================
   Cockpit (广阳文旅驾驶舱) Styles for Codex-H5
   ========================================================================== */

.cockpit-dark-panel {
  background: #06111f;
  border-radius: var(--radius-md);
  padding: 16px;
  color: #f0f6fc;
}

.cockpit-hero {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.12), rgba(15, 39, 68, 0.6), rgba(168, 85, 247, 0.08));
  border: 1px solid rgba(6, 182, 212, 0.25);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}

.cockpit-hero::after {
  content: "四季广阳";
  position: absolute;
  right: 15px;
  bottom: -10px;
  font-size: 54px;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.03);
  pointer-events: none;
}

.cockpit-hero-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
}

.cockpit-hero-desc {
  font-size: 0.85rem;
  color: #94a3b8;
  line-height: 1.6;
}

.cockpit-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.ckpi-card {
  background: rgba(15, 30, 50, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  border-left: 3px solid var(--codex-cyan);
}

.ckpi-card.yellow-border { border-left-color: var(--gov-gold); }
.ckpi-card.green-border { border-left-color: var(--codex-green); }
.ckpi-card.red-border { border-left-color: var(--gov-red); }

.ckpi-label {
  font-size: 0.78rem;
  color: #94a3b8;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ckpi-val {
  font-size: 1.6rem;
  font-weight: 900;
  color: #fff;
  margin: 4px 0 2px;
}

.ckpi-val small {
  font-size: 0.8rem;
  font-weight: normal;
  color: #94a3b8;
}

.ckpi-trend {
  font-size: 0.75rem;
}

.text-green { color: #10b981; }
.text-blue { color: #38bdf8; }
.text-red { color: #f87171; }

.cockpit-grid-2 {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 14px;
  margin-bottom: 14px;
}

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

.cockpit-grid-equal-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

.cockpit-chart-card {
  background: rgba(13, 26, 44, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  color: #f0f6fc;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.chart-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #e2e8f0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.chart-title::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 12px;
  background: var(--codex-cyan);
  border-radius: 2px;
}

.cockpit-echart-box {
  width: 100%;
  height: 250px;
}

.cockpit-echart-box-lg {
  width: 100%;
  height: 300px;
}

.cockpit-map-box {
  width: 100%;
  height: 320px;
  background: #081628;
  border: 1px solid rgba(6, 182, 212, 0.2);
  border-radius: var(--radius-sm);
  position: relative;
  overflow: hidden;
}

.timeline-h5 {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tl-item {
  display: grid;
  grid-template-columns: 50px 10px 1fr;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.82rem;
}

.tl-time {
  font-family: var(--font-mono);
  color: var(--codex-cyan);
  font-weight: 700;
  font-size: 0.78rem;
}

.tl-node {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gov-gold);
  margin-top: 3px;
}

.tl-body b {
  display: block;
  color: #fff;
}

.tl-body span {
  color: #94a3b8;
  font-size: 0.75rem;
}

.alert-h5-box {
  background: rgba(234, 179, 8, 0.08);
  border: 1px solid rgba(234, 179, 8, 0.25);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.8rem;
}

.alert-h5-item {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  color: #fef08a;
  line-height: 1.4;
}

.alert-h5-item.danger {
  color: #fca5a5;
}

.cockpit-table-scroll {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

.cockpit-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: left;
  white-space: nowrap;
}

.cockpit-table th, .cockpit-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color);
}

.cockpit-table th {
  background: var(--gov-blue-subtle);
  color: var(--gov-blue);
  font-weight: 700;
  position: sticky;
  top: 0;
}

.cockpit-table tr:hover td {
  background: rgba(15, 39, 68, 0.03);
}

.tag-h5 {
  display: inline-flex;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
}

.tag-h5.blue { background: rgba(6, 182, 212, 0.12); color: #0891b2; }
.tag-h5.green { background: rgba(16, 185, 129, 0.12); color: #059669; }
.tag-h5.yellow { background: rgba(245, 158, 11, 0.12); color: #d97706; }
.tag-h5.red { background: rgba(239, 68, 68, 0.12); color: #dc2626; }
.tag-h5.purple { background: rgba(168, 85, 247, 0.12); color: #9333ea; }

@media (max-width: 992px) {
  .cockpit-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .cockpit-grid-2, .cockpit-grid-3, .cockpit-grid-equal-2 { grid-template-columns: 1fr; }
}

