:root {
  --teal-50: #f0fdfa;
  --teal-100: #ccfbf1;
  --teal-400: #2dd4bf;
  --teal-500: #14b8a6;
  --teal-600: #0d9488;
  --teal-700: #0f766e;
  --teal-800: #115e59;
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;
  --red-500: #ef4444;
  --sidebar-w: 260px;
  --header-h: 56px;
  --radius: 10px;
  --shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
  --font-sans: "DM Sans", "Segoe UI", system-ui, sans-serif;
  --font-serif: "Instrument Serif", "Songti SC", Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--slate-800);
  background: linear-gradient(135deg, #e8f4f3 0%, #f0f4f8 40%, #e2ecf0 100%);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--teal-700); text-decoration: none; }
a:hover { color: var(--teal-800); text-decoration: underline; }

.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--slate-900) 0%, #162032 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  box-shadow: 4px 0 24px rgba(15, 23, 42, 0.15);
}

.sidebar-brand {
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 400;
  line-height: 1.35;
  color: #fff;
}

.sidebar-brand span {
  display: block;
  font-size: 0.7rem;
  color: var(--slate-400);
  margin-top: 0.25rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 0.625rem;
}

.nav-group { margin-bottom: 0.35rem; }

.nav-group-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  color: var(--slate-400);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.nav-group-toggle:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--slate-200);
}

.nav-group-toggle > span:first-of-type { flex: 1; }

.nav-caret {
  font-size: 1.05rem;
  line-height: 1;
  opacity: 0.85;
  transition: transform 0.15s;
  margin-left: auto;
}

.nav-group:not(.open) > .nav-group-toggle .nav-caret { transform: rotate(-90deg); }
.nav-group-body { padding: 0.15rem 0 0.35rem 0.35rem; }
.nav-group-body[hidden] { display: none; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem 0.55rem 1.15rem;
  border-radius: 8px;
  color: var(--slate-300);
  font-size: 1rem;
  font-weight: 500;
  width: 100%;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.nav-link-with-badge {
  justify-content: space-between;
  gap: 0.65rem;
  padding-right: 0.85rem;
}

.nav-link-text {
  min-width: 0;
  flex: 1 1 auto;
}

.nav-todo-badge {
  flex: 0 0 auto;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.25rem;
  text-align: center;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.15);
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  text-decoration: none;
}

.nav-link.active {
  background: rgba(20, 184, 166, 0.2);
  color: var(--teal-400);
}

.nav-link.active .nav-todo-badge {
  box-shadow: 0 0 0 1px rgba(20, 184, 166, 0.35);
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.user-info { font-size: 0.8125rem; color: var(--slate-400); margin-bottom: 0.5rem; }
.user-info strong { color: #fff; display: block; font-size: 0.875rem; }

.main-area {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--slate-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.75rem;
  position: sticky;
  top: 0;
  z-index: 50;
}

.view-switch {
  display: inline-flex;
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.view-switch a {
  padding: 0.35rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--slate-600);
  text-decoration: none;
  border-right: 1px solid var(--slate-200);
}
.view-switch a:last-child { border-right: 0; }
.view-switch a:hover { background: #f8fafc; color: var(--slate-800); }
.view-switch a.is-active {
  background: var(--teal-100, #ccfbf1);
  color: var(--teal-800, #115e59);
}
.config-list-table .form-group { margin: 0; }
.config-list-table input[type="text"],
.config-list-table input[type="password"] {
  width: 100%;
  min-width: 8rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--slate-200);
  border-radius: 6px;
  font-size: 0.8125rem;
  box-sizing: border-box;
}
.config-list-table .row-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.35rem;
  justify-content: flex-end;
  align-items: center;
  white-space: nowrap;
}
.config-list-table .row-actions .btn {
  flex: 0 0 auto;
}
.config-list-meta {
  font-size: 0.75rem;
  color: var(--slate-500);
  line-height: 1.35;
}

.topbar-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--slate-900);
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}
.notify-bell { position: relative; }
.notify-bell-btn {
  position: relative;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--slate-200);
  border-radius: 999px;
  background: #fff;
  color: var(--slate-600);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.notify-bell-btn:hover { color: var(--teal-700, #0f766e); border-color: #99f6e4; }
.notify-bell-badge {
  position: absolute;
  top: -0.2rem;
  right: -0.2rem;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1.1rem;
  text-align: center;
}
.notify-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 0.45rem);
  width: min(22rem, calc(100vw - 2rem));
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
  z-index: 80;
  overflow: hidden;
}
.notify-dropdown-head,
.notify-dropdown-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.7rem 0.85rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--slate-100);
}
.notify-dropdown-foot { border-bottom: 0; border-top: 1px solid var(--slate-100); }
.notify-dropdown-head a {
  font-size: 0.8125rem;
  color: var(--teal-700, #0f766e);
  text-decoration: none;
}
.notify-dropdown-list { max-height: 18rem; overflow: auto; }
.notify-empty { padding: 1.25rem; text-align: center; color: var(--slate-500); font-size: 0.875rem; }
.notify-item { margin: 0; border-bottom: 1px solid var(--slate-100); }
.notify-item:last-child { border-bottom: 0; }
.notify-item.is-unread { background: #f0fdfa; }
.notify-item-btn {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 0.7rem 0.85rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.notify-item-btn:hover { background: #f8fafc; }
.notify-item-title { font-size: 0.875rem; font-weight: 600; color: var(--slate-800); }
.notify-item-body {
  font-size: 0.78rem;
  color: var(--slate-600);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.notify-item-time { font-size: 0.72rem; color: var(--slate-400); }
.notify-row-unread td { background: #f0fdfa; }

.page-content {
  flex: 1;
  padding: 1.5rem 1.75rem 2rem;
  width: 100%;
  box-sizing: border-box;
}

.page-full-width {
  width: 100%;
  max-width: none;
}

.card {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 12px;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
  width: 100%;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--slate-100);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.card-header h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--slate-800);
}

.card-body { padding: 1.25rem; }
.card-body.no-pad { padding: 0; }

.model-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

/* ??/??????????????????????????????????????? */
.config-page.is-card-mode {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--header-h) - 3.5rem);
  min-height: 280px;
  box-sizing: border-box;
  overflow: hidden;
}
.config-page.is-card-mode > .alert {
  flex: 0 0 auto;
  margin-bottom: 0.75rem;
}
.config-page.is-card-mode > .config-card-shell {
  flex: 1 1 auto;
  min-height: 0;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.config-card-shell > .card-header {
  flex: 0 0 auto;
}
.config-card-shell > .config-card-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0.75rem;
  container-type: size;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.config-card-shell .config-card-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
  align-content: start;
  width: 100%;
  box-sizing: border-box;
  /* ????????????????????????????????? */
  grid-auto-rows: minmax(calc((100cqh - 0.75rem) / 2), max-content);
}
.config-card-shell .config-card-grid .model-card {
  min-height: 100%;
  height: auto;
  padding: 0.85rem 0.9rem;
  overflow: visible;
  display: block;
  box-sizing: border-box;
}
.config-card-shell .config-card-grid .model-card > form {
  display: block;
  overflow: visible;
  padding: 0;
  min-height: 0;
}
.config-card-shell .config-card-grid .form-group {
  margin-bottom: 0.5rem;
}
@media (max-width: 1400px) {
  .config-card-shell .config-card-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (max-width: 1100px) {
  .config-card-shell .config-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 800px) {
  .config-page.is-card-mode {
    height: auto;
    max-height: none;
    overflow: visible;
  }
  .config-card-shell .config-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: minmax(240px, max-content);
  }
}

.model-card {
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  padding: 1.1rem 1.15rem;
  background: #fff;
}

.model-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.model-card .provider {
  color: var(--slate-500);
  font-size: 0.8125rem;
  margin-bottom: 0.85rem;
  line-height: 1.45;
}

.model-card .default-tag {
  font-size: 0.7rem;
  background: var(--teal-100);
  color: var(--teal-800);
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-weight: 600;
}

.form-group { margin-bottom: 0.75rem; }
.form-group label {
  display: block;
  font-size: 0.8125rem;
  color: var(--slate-600);
  margin-bottom: 0.3rem;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group input[type="time"],
.form-group select,
.form-group textarea,
.param-value {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  font-size: 0.875rem;
  background: #fff;
}

.seal-form-panel {
  width: 100%;
  padding: 1.1rem 1.25rem 1.25rem;
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.seal-section-title {
  margin: 0 0 0.85rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--slate-800);
}
.seal-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.1rem 1.25rem;
  align-items: start;
}
.seal-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}
.seal-field-span {
  grid-column: 1 / -1;
}
.seal-field-label {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--slate-600);
  line-height: 1.2;
}
.seal-field-label .req {
  color: var(--red-500);
  font-weight: 600;
  margin-right: 0.1rem;
}
.seal-field-hint {
  margin: 0;
  font-size: 0.75rem;
  color: var(--slate-400);
  line-height: 1.35;
}
.seal-control,
.seal-form-panel .seal-control {
  width: 100%;
  height: 36px;
  padding: 0 0.75rem;
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  font-size: 0.875rem;
  color: var(--slate-800);
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.seal-control:hover { border-color: var(--slate-300); }
.seal-control:focus {
  outline: none;
  border-color: var(--teal-500);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.14);
}
.seal-control-shell {
  height: 36px;
  border-radius: 8px;
}
.seal-form-panel .seal-type-combo {
  height: 36px;
  border-color: var(--slate-200);
}
.seal-form-panel .seal-type-combo:focus-within {
  border-color: var(--teal-500);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.14);
}
.seal-form-panel .seal-type-combo input {
  height: 100%;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 0.65rem;
  background: transparent;
}

.seal-field-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}
.seal-field-hint.inline {
  margin: 0;
  white-space: nowrap;
}
.seal-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.seal-chip {
  display: inline-flex;
  align-items: center;
  margin: 0;
  min-height: 32px;
  padding: 0 0.85rem;
  border: 1px solid var(--slate-200);
  border-radius: 999px;
  background: #fff;
  color: var(--slate-600);
  font-size: 0.8125rem;
  cursor: pointer;
  user-select: none;
  transition: all .15s ease;
}
.seal-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.seal-chip:hover {
  border-color: var(--teal-400);
  color: var(--teal-700);
}
.seal-chip.is-on {
  border-color: rgba(13, 148, 136, 0.4);
  background: var(--teal-50);
  color: var(--teal-700);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(13, 148, 136, 0.08);
}

.seal-range-control {
  display: flex;
  align-items: center;
  height: 36px;
  padding: 0 0.55rem;
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  background: #fff;
  gap: 0.35rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.seal-range-control:focus-within {
  border-color: var(--teal-500);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.14);
}
.seal-range-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 0.2rem !important;
  background: transparent !important;
  font-size: 0.875rem;
}
.seal-range-sep {
  flex: 0 0 auto;
  color: var(--slate-400);
  font-size: 0.8125rem;
}

.seal-upload {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  min-height: 108px;
  padding: 1.15rem 1rem;
  border: 1px dashed var(--slate-300);
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.seal-upload:hover,
.seal-upload.is-drag {
  border-color: var(--teal-400);
  background: var(--teal-50);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.08);
}
.seal-upload input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.seal-upload-icon {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--slate-200);
  color: var(--teal-600);
  font-size: 0.9rem;
}
.seal-upload-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--slate-700);
}
.seal-upload-name {
  font-size: 0.75rem;
  color: var(--slate-400);
}
.seal-form-actions {
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--slate-100);
  display: flex;
  gap: 0.5rem;
}
@media (max-width: 960px) {
  .seal-form-grid { grid-template-columns: 1fr; }
}

.seal-cert-panel { padding-bottom: 1rem; }
.seal-cert-row {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.85rem 1rem;
}
.seal-cert-mode {
  flex: 0 0 220px;
  min-width: 180px;
}
.seal-cert-extra {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.85rem 1rem;
  min-width: 0;
}
.seal-cert-file {
  flex: 1 1 240px;
  min-width: 200px;
}
.seal-cert-pwd {
  flex: 0 1 180px;
  min-width: 140px;
}
.seal-cert-action {
  flex: 0 0 auto;
}
.seal-cert-parse {
  height: 36px;
  min-width: 88px;
}
.seal-cert-vendor {
  flex: 0 1 220px;
  min-width: 160px;
}
.seal-cert-demo {
  flex: 1 1 220px;
}
.seal-inline-hint {
  display: flex;
  align-items: center;
  height: 36px;
  padding: 0 0.75rem;
  border-radius: 8px;
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  color: var(--slate-600);
  font-size: 0.8125rem;
  white-space: nowrap;
}
.seal-file-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  height: 36px;
  padding: 0 0.75rem;
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  overflow: hidden;
}
.seal-file-btn:hover { border-color: var(--teal-400); }
.seal-file-btn input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.seal-file-btn-text {
  flex: 0 0 auto;
  padding: 0.15rem 0.55rem;
  border-radius: 6px;
  background: var(--slate-100);
  color: var(--slate-700);
  font-size: 0.75rem;
  font-weight: 500;
}
.seal-file-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--slate-500);
  font-size: 0.8125rem;
}
.seal-cert-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.seal-readonly-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  background: var(--slate-50);
  border: 1px solid var(--slate-100);
  font-size: 0.8125rem;
  color: var(--slate-600);
}
.seal-readonly-bar strong { color: var(--slate-800); font-weight: 600; }
.seal-readonly-value {
  min-height: 36px;
  display: flex;
  align-items: center;
  padding: 0 0.75rem;
  border: 1px solid var(--slate-100);
  border-radius: 8px;
  background: var(--slate-50);
  color: var(--slate-800);
  font-size: 0.875rem;
  word-break: break-all;
}
.seal-mono {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.8125rem;
}
.seal-readonly-upload {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 36px;
}
.seal-sub-title {
  margin: 1rem 0 0.65rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--slate-700);
}
.seal-readonly .seal-chip {
  cursor: default;
}

.seal-type-combo {
  position: relative;
  display: flex;
  align-items: stretch;
  width: 100%;
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  background: #fff;
}
.seal-type-combo:focus-within {
  border-color: var(--brand, #2563eb);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.seal-type-combo input {
  flex: 1;
  min-width: 0;
  width: auto !important;
  border: 0 !important;
  border-radius: 8px 0 0 8px !important;
  box-shadow: none !important;
  outline: none;
  background: transparent;
}
.seal-type-toggle {
  flex: 0 0 2.25rem;
  border: 0;
  border-left: 1px solid var(--slate-200);
  border-radius: 0 8px 8px 0;
  background: #f8fafc;
  color: var(--slate-600);
  cursor: pointer;
  font-size: 0.75rem;
  line-height: 1;
}
.seal-type-toggle:hover {
  background: #f1f5f9;
}
.seal-type-combo.open .seal-type-toggle {
  background: #e2e8f0;
}
.seal-type-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 40;
  margin: 0;
  padding: 0.25rem 0;
  list-style: none;
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.1);
  max-height: 220px;
  overflow: auto;
}
.seal-type-menu li {
  padding: 0.45rem 0.75rem;
  font-size: 0.875rem;
  cursor: pointer;
  color: var(--slate-700);
}
.seal-type-menu li:hover {
  background: #f1f5f9;
}

.seal-create-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem 1rem;
  align-items: end;
}
.seal-create-form .form-group {
  margin-bottom: 0;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.875rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0.45rem 0.85rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
}

.btn-sm { padding: 0.3rem 0.65rem; font-size: 0.8125rem; }
.btn-primary { background: var(--teal-600); color: #fff; }
.btn-primary:hover { background: var(--teal-700); color: #fff; text-decoration: none; }
.btn-secondary { background: #fff; border-color: var(--slate-200); color: var(--slate-700); }
.btn-secondary:hover { background: var(--slate-50); text-decoration: none; color: var(--slate-800); }
.btn-outline-light { background: transparent; border-color: rgba(255,255,255,0.35); color: #fff; }
.btn-danger { background: var(--red-500); color: #fff; }

.table-wrap { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table th, .data-table td {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--slate-100);
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  background: var(--slate-50);
  color: var(--slate-600);
  font-weight: 600;
  font-size: 0.8125rem;
}

.text-muted { color: var(--slate-500); }
.text-mono { font-family: ui-monospace, Consolas, monospace; font-size: 0.8125rem; }
.text-sm { font-size: 0.8125rem; }
.truncate { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty-state { text-align: center; color: var(--slate-500); padding: 2rem 1rem; }
.hint { color: var(--slate-500); font-size: 0.8125rem; line-height: 1.5; }
.toolbar { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.list-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--slate-200);
}
.list-pager-size {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
}
.list-pager-size select {
  min-width: 4.5rem;
  padding: 0.3rem 0.45rem;
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  background: #fff;
}
.list-pager-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.search-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
  align-items: center;
}

.search-bar input, .search-bar select {
  min-width: 120px;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--slate-200);
  border-radius: 8px;
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}
.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-danger { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.detail-item label {
  display: block;
  font-size: 0.75rem;
  color: var(--slate-500);
  margin-bottom: 0.25rem;
}

.detail-item .value { font-weight: 500; color: var(--slate-800); }

.account-profile-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1rem 2rem;
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  background: var(--slate-50);
  border: 1px solid var(--slate-100);
  border-radius: 10px;
}
.account-profile-row .detail-item {
  min-width: 0;
}
.account-profile-roles {
  flex: 1 1 220px;
}
.account-profile-roles .value {
  white-space: normal;
  word-break: break-word;
}
.pwd-reveal {
  display: flex;
  align-items: stretch;
  gap: 0.4rem;
}
.pwd-reveal input {
  flex: 1 1 auto;
  min-width: 0;
}
.pwd-reveal-btn {
  flex: 0 0 auto;
  white-space: nowrap;
}
.pwd-reveal-inline {
  flex: 0 1 260px;
}
.pwd-reveal-inline input {
  width: 100%;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  font-size: 0.8125rem;
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(20, 184, 166, 0.12), transparent),
    linear-gradient(135deg, #e8f4f3 0%, #f0f4f8 50%, #dde8ec 100%);
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 2.5rem 2rem;
}

.login-brand { text-align: center; margin-bottom: 2rem; }
.login-brand h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 400;
  color: var(--slate-900);
}
.login-brand p { margin-top: 0.5rem; color: var(--slate-500); font-size: 0.875rem; }

.login-tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1.25rem;
  padding: 0.25rem;
  background: var(--slate-100);
  border-radius: 10px;
}
.login-tab {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--slate-600);
  cursor: pointer;
}
.login-tab.active {
  background: #fff;
  color: var(--slate-900);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.multi-select {
  width: 100%;
  min-height: 140px;
  padding: 0.4rem;
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  background: #fff;
  font-size: 0.875rem;
}
.multi-select option { padding: 0.35rem 0.5rem; }
.row-active td { background: var(--teal-50); }

.check-panel {
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  background: #fff;
  max-height: 320px;
  overflow-y: auto;
  padding: 0.5rem 0.75rem;
}
.check-panel-group { margin-bottom: 0.75rem; }
.check-panel-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--slate-500);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
}
.check-panel .checkbox-row {
  padding: 0.35rem 0.25rem;
  border-radius: 6px;
  cursor: pointer;
}
.check-panel .checkbox-row:hover { background: var(--slate-50); }
.check-panel input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--teal-600);
  cursor: pointer;
}

.dropdown-check { position: relative; }
.dropdown-check-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  background: #fff;
  font-size: 0.875rem;
  color: var(--slate-800);
  cursor: pointer;
  text-align: left;
}
.dropdown-check.open .dropdown-check-toggle {
  border-color: var(--teal-400);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.12);
}
.dropdown-check-menu {
  position: absolute;
  z-index: 40;
  left: 0; right: 0;
  top: calc(100% + 4px);
  max-height: 220px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 0.5rem;
}
.dropdown-check-menu .checkbox-row {
  padding: 0.4rem 0.35rem;
  border-radius: 6px;
  cursor: pointer;
}
.dropdown-check-menu .checkbox-row:hover { background: var(--slate-50); }
.dropdown-check-menu input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--teal-600);
}

.create-user-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem 1rem;
  margin-bottom: 0.75rem;
  max-width: 960px;
}

.import-edit-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr 1.3fr 1fr 1fr 1fr auto;
  gap: 0.5rem;
  align-items: start;
}
.import-edit-grid input,
.import-edit-grid select {
  width: 100%;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  font-size: 0.8125rem;
}
@media (max-width: 1100px) {
  .import-edit-grid { grid-template-columns: 1fr 1fr; }
}

.user-edit-form-host { display: none; }

.user-edit-table {
  table-layout: fixed;
  width: 100%;
}
.user-edit-table col.col-name { width: 10%; }
.user-edit-table col.col-mobile { width: 12%; }
.user-edit-table col.col-idcard { width: 16%; }
.user-edit-table col.col-dept { width: 11%; }
.user-edit-table col.col-role { width: 14%; }
.user-edit-table col.col-approval { width: 8%; }
.user-edit-table col.col-enabled { width: 6%; }
.user-edit-table col.col-actions { width: 13%; }

.user-edit-table th,
.user-edit-table td {
  vertical-align: middle;
  overflow: hidden;
}
/* 角色下拉绝对定位菜单：避免被表格/单元格裁切导致无法勾选 */
.table-wrap:has(.user-edit-table) {
  overflow: visible;
}
.user-edit-table .user-data-row td.cell-role {
  overflow: visible;
  position: relative;
  z-index: 2;
}
.user-edit-table .user-data-row td.cell-role:has(.dropdown-check.open) {
  z-index: 60;
}
.user-edit-table .user-data-row td.cell-role .dropdown-check-menu {
  z-index: 70;
  min-width: 11rem;
  right: auto;
}
.user-edit-table .user-data-row td {
  padding: 0.55rem 0.5rem;
}
.user-edit-table .user-data-row input[type="text"],
.user-edit-table .user-data-row input:not([type]),
.user-edit-table .user-data-row input[name]:not([type="hidden"]):not([type="checkbox"]),
.user-edit-table .user-data-row select {
  width: 100%;
  max-width: 100%;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  font-size: 0.8125rem;
  box-sizing: border-box;
}
.user-edit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.pwd-reset-tr td {
  background: var(--slate-50);
  padding: 0.55rem 0.75rem;
}
.pwd-reset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.pwd-reset-row input[type="password"],
.pwd-reset-row input[type="text"][data-pwd-input] {
  width: 200px;
  max-width: 100%;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  font-size: 0.8125rem;
}

.user-edit-grid {
  display: none;
}

.field-hint {
  margin: 0.25rem 0 0;
  color: #b91c1c;
  font-size: 0.75rem;
  line-height: 1.3;
}
input.is-invalid {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.15);
}
.form-toast {
  position: fixed;
  top: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background: #7f1d1d;
  color: #fff;
  padding: 0.65rem 1.1rem;
  border-radius: 10px;
  font-size: 0.875rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  max-width: min(90vw, 420px);
}

.app-toast-host {
  position: fixed;
  top: 0.85rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: min(92vw, 560px);
  pointer-events: none;
}
.app-toast-host[hidden] {
  display: none !important;
}
.app-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  background: #fff;
  color: #0f172a;
  font-size: 0.9rem;
  line-height: 1.45;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
  border: 1px solid #e2e8f0;
  border-left-width: 4px;
}
.app-toast.is-ok { border-left-color: #16a34a; background: #f0fdf4; }
.app-toast.is-err { border-left-color: #dc2626; background: #fef2f2; }
.app-toast.is-warn { border-left-color: #d97706; background: #fffbeb; }
.app-toast.is-info { border-left-color: #0284c7; background: #f0f9ff; }
.app-toast.is-out { opacity: 0; transition: opacity 0.25s ease; }
.app-toast-msg { flex: 1; min-width: 0; }
.app-toast-close {
  border: 0;
  background: transparent;
  color: #64748b;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.15rem;
}
.app-toast-confirm {
  align-items: center;
  flex-wrap: wrap;
}
.app-toast-actions {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}

.dict-tabs {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 1.25rem;
  border-bottom: 1px solid var(--slate-100);
  padding-bottom: 0.5rem;
}
.dict-tab {
  padding: 0.45rem 0.9rem;
  border: 0;
  background: transparent;
  border-radius: 8px;
  color: var(--slate-600);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
}
.dict-tab:hover { background: var(--slate-50); color: var(--slate-800); }
.dict-tab.active {
  background: #ecfdf5;
  color: var(--teal-700, #0f766e);
  font-weight: 600;
}

.dash-summary {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0.5rem;
  width: 100%;
}
.dash-stat {
  flex: 1 1 0;
  min-width: 0;
  padding: 0.65rem 0.55rem;
  border-radius: 10px;
  background: linear-gradient(145deg, #f8fafc, #f1f5f9);
  border: 1px solid var(--slate-100);
}
a.dash-stat {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
a.dash-stat:hover {
  border-color: var(--teal-500, #14b8a6);
  box-shadow: 0 0 0 2px rgba(20, 184, 166, 0.12);
}
.dash-stat-label {
  display: block;
  font-size: 0.7rem;
  color: var(--slate-500);
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-stat-value {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--slate-900);
  font-variant-numeric: tabular-nums;
}
.dash-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem 1rem;
  align-items: end;
  max-width: none;
}
.dash-stat-table-wrap {
  max-height: 280px;
  overflow-x: hidden;
  overflow-y: auto;
}
.dash-period-wrap {
  margin: 1rem 0;
}
.dash-period-legend {
  padding: 0.85rem 1rem;
  margin-bottom: 0.75rem;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid var(--slate-100);
}
.dash-period-legend strong {
  display: block;
  font-size: 0.875rem;
  color: var(--slate-800);
  margin-bottom: 0.35rem;
}
.dash-period-legend p {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--slate-600);
}
.dash-period-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0;
  width: 100%;
}
.dash-period-card {
  min-width: 0;
  margin: 0;
}
.dash-period-card .card-header h2 {
  font-size: 0.95rem;
  margin: 0;
}
.dash-period-card .table-wrap {
  overflow-x: auto;
}
.dash-period-table {
  width: 100%;
  table-layout: auto;
  min-width: 17rem;
}
.dash-period-table th,
.dash-period-table td {
  padding: 0.4rem 0.3rem;
  font-size: 0.75rem;
  white-space: nowrap;
}
.dash-period-table th {
  overflow: visible;
  text-overflow: clip;
  font-weight: 600;
}
.dash-period-table td {
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-period-table th:first-child,
.dash-period-table td:first-child {
  width: auto;
  min-width: 4.5rem;
}
.dash-period-table th:last-child,
.dash-period-table td:last-child {
  width: auto;
  text-align: right;
  white-space: nowrap;
}
.dash-period-table .dash-bar-track {
  display: none;
}
@media (max-width: 1400px) {
  .dash-period-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 900px) {
  .dash-period-stats {
    grid-template-columns: 1fr;
  }
}
.dash-bar-track {
  height: 8px;
  background: var(--slate-100);
  border-radius: 4px;
  overflow: hidden;
  min-width: 40px;
  flex: 1;
}
.dash-bar-cell {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}
.dash-bar-pct {
  font-size: 0.75rem;
  color: var(--slate-500);
  font-variant-numeric: tabular-nums;
  min-width: 2.25rem;
}
.dash-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #0d9488, #14b8a6);
  border-radius: 4px;
  min-width: 0;
}

.archive-path-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: end;
  max-width: none;
}

.ai-review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}
.ai-review-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: end;
  padding: 0.75rem;
  border: 1px solid var(--slate-200);
  border-radius: 10px;
  background: #f8fafc;
}
.ai-review-panel {
  padding: 0.85rem 1rem;
  border: 1px solid var(--slate-200);
  border-radius: 10px;
  background: linear-gradient(145deg, #f8fafc, #f1f5f9);
}
.ai-opinion-box {
  margin-top: 0.75rem;
  border: 1px solid #99f6e4;
  border-radius: 10px;
  background: #f0fdfa;
  padding: 0.85rem 1rem;
}
.ai-opinion-fail {
  border-color: #fecaca;
  background: #fef2f2;
}
.ai-opinion-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  font-size: 0.8125rem;
  margin-bottom: 0.5rem;
  color: var(--slate-600);
}
.ai-opinion-text {
  margin: 0;
  white-space: pre-wrap;
  font-family: var(--font-sans, inherit);
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--slate-800);
}
.ai-timeline {
  list-style: none;
  margin: 0;
  padding: 0.75rem 1.25rem 1.25rem;
}
.ai-timeline li {
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--slate-100);
}
.ai-timeline li:last-child { border-bottom: none; }

.dict-type-block {
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--slate-100);
}
.dict-type-block:last-child { border-bottom: none; }
.dict-type-block h3 {
  font-size: 0.95rem;
  margin: 0 0 0.75rem;
}
.dict-add-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
  align-items: center;
}
.dict-add-row input {
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  font-size: 0.8125rem;
  min-width: 120px;
}
.template-edit-form textarea {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  font-size: 0.875rem;
  font-family: inherit;
  resize: vertical;
}
.template-inline-grid {
  display: grid;
  grid-template-columns: 9rem 7rem 6rem 9rem 1fr 3rem 4.5rem;
  gap: 0.45rem;
  align-items: start;
}
.template-inline-grid input,
.template-inline-grid select,
.template-inline-grid textarea {
  width: 100%;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  font-size: 0.8125rem;
  font-family: inherit;
}
.template-inline-grid textarea {
  resize: vertical;
  min-height: 2.5rem;
}
.template-inline-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.template-add-row {
  margin-top: 0.35rem;
}
@media (max-width: 1100px) {
  .template-inline-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.flow-meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  color: var(--slate-600);
}
.flow-version-hint {
  border-radius: 8px;
  border: 1px solid var(--slate-200);
  padding: 0.55rem 0.75rem;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  line-height: 1.45;
  background: #f8fafc;
  color: var(--slate-700);
}
.flow-version-hint.is-stale {
  border-color: #f0d7a8;
  background: #fffbeb;
  color: #92400e;
}
.flow-version-hint.is-current {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}
.flow-version-hint-title {
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  margin-bottom: 0.2rem;
  opacity: 0.9;
}
.flow-version-hint-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.35rem;
  align-items: baseline;
}
.flow-version-hint-meta .sep { opacity: 0.55; }
.flow-version-hint-why {
  margin: 0.35rem 0 0;
  color: inherit;
  opacity: 0.92;
}
.flow-editor-layout {
  display: grid;
  grid-template-columns: 1fr minmax(280px, 340px);
  gap: 1rem;
  align-items: start;
}
.flow-canvas-wrap { min-width: 0; position: relative; }
.flow-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin-bottom: 0.65rem;
  padding: 0.55rem 0.65rem;
  background: linear-gradient(180deg, #f8fafc, #f1f5f9);
  border: 1px solid var(--slate-200);
  border-radius: 10px;
}
.flow-palette-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--slate-500);
  margin-right: 0.35rem;
}
.flow-palette-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  background: #fff;
  font-size: 0.8125rem;
  color: var(--slate-700);
  cursor: grab;
}
.flow-palette-item:hover { border-color: #99f6e4; background: #f0fdfa; }
.flow-palette-item.active {
  border-color: #14b8a6;
  background: #ccfbf1;
  color: #0f766e;
}
.flow-palette-danger { color: #b91c1c; border-color: #fecaca; }
.flow-palette-danger:hover { background: #fef2f2; }
.flow-palette-sep {
  width: 1px;
  height: 1.5rem;
  background: var(--slate-200);
  margin: 0 0.25rem;
}
.fp-icon {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  flex-shrink: 0;
}
.fp-start, .fp-end { border-radius: 50%; }
.fp-end { border-width: 3px; }
.fp-task { border-radius: 3px; }
.fp-gateway {
  width: 12px;
  height: 12px;
  transform: rotate(45deg);
  border-radius: 1px;
}
.fp-edge {
  width: 18px;
  height: 0;
  border: none;
  border-top: 2px solid currentColor;
  position: relative;
}
.fp-edge::after {
  content: '';
  position: absolute;
  right: -1px;
  top: -5px;
  border: 4px solid transparent;
  border-left-color: currentColor;
}
#lf-container {
  height: min(70vh, 640px);
  width: 100%;
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  background: #fff;
}
.flow-side-panel {
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  padding: 1rem;
  background: #fff;
  max-height: min(70vh, 640px);
  overflow: auto;
}
.flow-side-panel h3 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
}
.field-perm-list { max-height: 280px; overflow: auto; }
.field-perm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--slate-100);
}
.field-perm-row select {
  width: 6.5rem;
  padding: 0.25rem 0.35rem;
  border: 1px solid var(--slate-200);
  border-radius: 6px;
  font-size: 0.75rem;
}
@media (max-width: 1000px) {
  .flow-editor-layout { grid-template-columns: 1fr; }
  .flow-side-panel { max-height: none; }
}

.badge-status {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-ok { background: #dcfce7; color: #166534; }
.badge-fail { background: #fee2e2; color: #991b1b; }
.badge-pending { background: #fef3c7; color: #92400e; }

@media (max-width: 900px) {
  .sidebar { width: 220px; }
  .main-area { margin-left: 220px; }
  :root { --sidebar-w: 220px; }
}

.detail-grid {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 0.55rem 1rem;
  margin: 0;
}
.detail-grid dt {
  margin: 0;
  color: var(--slate-600);
  font-weight: 600;
}
.detail-grid dd { margin: 0; color: var(--slate-900); }

/* ===== ?????????? / ??????????? ===== */
.ethics-form-wrap {
  max-width: 980px;
  margin: 0 auto 2rem;
}
.ethics-form {
  --ethics-font: "SimSun", "??", "Songti SC", "Noto Serif SC", serif;
  background: #fff;
  border: 1px solid #334155;
  border-radius: 0;
  box-shadow: var(--shadow);
  padding: 1.5rem 1.75rem 1.75rem;
  font-family: var(--ethics-font);
  font-size: 13px;
  line-height: 1.55;
  color: #111;
}
.ethics-form-title {
  margin: 0;
  text-align: center;
  font-family: var(--ethics-font);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: #111;
}
.ethics-form-no {
  text-align: right;
  margin: 0.75rem 0 1.25rem;
  color: #111;
  font-size: 0.95rem;
  font-family: var(--ethics-font);
}
.ethics-form .slot {
  display: inline-block;
  min-width: 3ch;
  text-align: center;
}
.ethics-inline-text {
  display: inline-block;
  min-width: 3.5rem;
  padding: 0 0.35rem;
  border-bottom: 1px solid #334155;
  text-align: center;
}
.ethics-inline-text.muted { color: #64748b; font-size: 0.85rem; min-width: 5rem; }
.ethics-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-family: var(--ethics-font);
  font-size: 13px;
  color: #111;
}
.ethics-table th,
.ethics-table td {
  border: 1px solid #334155;
  padding: 0.45rem 0.55rem;
  vertical-align: top;
  line-height: 1.55;
  font-weight: 400;
  font-family: inherit;
  color: #111;
}
.ethics-table .label-cell {
  width: 8.5rem;
  min-width: 8.5rem;
  background: #f8fafc;
  font-weight: 700;
  color: #111;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap; /* 项目名称、研究设计类别等单行展示 */
}
.ethics-table .label-cell.label-wrap,
.ethics-table .label-cell:has(br),
.ethics-table .label-cell:has(.hint) {
  white-space: normal; /* 长文案 / 带说明的标签允许换行 */
}
.ethics-table .hint,
.ethics-form .hint {
  color: #64748b;
  font-size: 0.8rem;
  font-weight: 400;
}
.ethics-table .opts { line-height: 1.75; }
.ethics-table .mat-line { margin: 0.15rem 0; }
.ethics-table .summary {
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 4rem;
  font-family: inherit;
}
.option-row, .option-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
  align-items: center;
}
.option-sub {
  margin-top: 0.65rem;
  padding-top: 0.55rem;
  border-top: 1px dashed #cbd5e1;
}
.option-sub .sub-label { color: #475569; font-size: 0.85rem; }
.ethics-form .opt {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin: 0;
  font-size: 13px;
  font-weight: 400;
  font-family: inherit;
  color: #111;
  cursor: pointer;
  white-space: nowrap;
}
.ethics-form .materials-cell,
.ethics-form .material-title,
.ethics-form .material-note,
.ethics-form .mat-line {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}
.staged-file-hint {
  display: block;
  margin: 0.35rem 0 0;
  padding-left: 0.1rem;
  color: #0f766e;
  font-size: 0.82rem;
  line-height: 1.4;
  white-space: normal;
  word-break: break-all;
}
.material-one-line {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.35rem 1.1rem;
  min-width: 0;
  overflow-x: auto;
  white-space: nowrap;
}
.material-one-line .material-title {
  flex: 0 0 auto;
  white-space: nowrap;
  font-weight: 600;
  color: var(--slate-800);
}
.material-one-line .field-text {
  margin-right: 0.25rem;
  font-size: 0.8rem;
  color: var(--slate-600);
}
.material-one-line .staged-file-hint {
  display: inline;
  margin: 0;
  padding: 0;
  white-space: nowrap;
  word-break: normal;
}
.date-range {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 0.3rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.date-range > span {
  white-space: nowrap;
  color: #334155;
  padding: 0 0.05rem;
}
/* 原生 date 固有最小宽度大，压进单元格，避免「项目起止时间」撑破表格右边框 */
.date-range .form-control,
.date-range input[type="date"],
.ethics-form .date-range .form-control,
.ethics-form .date-range input[type="date"] {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.ethics-table td:has(.date-range) {
  overflow: hidden;
}
.materials-cell { padding: 0 !important; }
.material-item {
  padding: 0.7rem 0.75rem;
  border-bottom: 1px solid var(--slate-200);
}
.material-item:last-child { border-bottom: none; }
.material-title {
  font-weight: 600;
  margin-bottom: 0;
  color: var(--slate-800);
}
.material-note {
  font-weight: 400;
  color: var(--slate-500);
  font-size: 0.85rem;
}
.material-fields {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 0.55rem 0.75rem;
  align-items: end;
  margin-top: 0.45rem;
}
.material-required-inline {
  display: grid;
  grid-template-columns: auto minmax(160px, 1.6fr) minmax(110px, 1fr) minmax(130px, 1fr);
  align-items: center;
  column-gap: 0.75rem;
  row-gap: 0.35rem;
}
.opt-disabled {
  opacity: 0.45;
  filter: grayscale(0.15);
  pointer-events: none;
  user-select: none;
}
.material-required-inline .material-title {
  white-space: nowrap;
  font-weight: 600;
  color: var(--slate-800);
}
.material-field-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  white-space: nowrap;
}
.material-field-inline .field-text {
  flex: 0 0 auto;
  font-size: 0.8rem;
  color: var(--slate-600);
}
.material-field-inline .input-inline,
.material-field-inline .file-inline {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  padding: 0.25rem 0.4rem;
  border: 1px solid var(--slate-200);
  border-radius: 6px;
  font-size: 0.8125rem;
  background: #fff;
  font-family: inherit;
}
.material-field-inline .file-inline {
  flex: 1 1 11rem;
  min-width: 11rem;
  padding: 0.15rem 0;
  border: none;
  border-radius: 0;
  background: transparent;
}
.material-field-file {
  white-space: normal;
}
.material-required-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 0.55rem 0.75rem;
  align-items: end;
  margin-top: 0.45rem;
}
.material-fields label,
.material-required-row label {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-size: 0.8rem;
  color: var(--slate-600);
  white-space: nowrap;
}
.material-fields label .form-control,
.material-required-row label .form-control {
  width: auto !important;
  flex: 1 1 auto;
  min-width: 5.5rem;
}
.material-head-row {
  display: flex;
  align-items: center;
  gap: 0.85rem 1rem;
  flex-wrap: nowrap;
}
.material-optional-inline {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.65rem 0.85rem;
  min-width: 0;
}
.material-optional-inline > .material-title {
  flex: 0 1 auto;
  white-space: nowrap;
  font-weight: 600;
  color: var(--slate-800);
}
.material-optional-fields {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.75rem;
  flex: 1 1 auto;
  min-width: 0;
}
.material-optional-fields .material-field-inline {
  flex: 0 1 auto;
}
.material-optional-fields .material-field-file {
  flex: 1 1 auto;
  min-width: 0;
}
.material-head-row .material-title {
  flex: 0 1 auto;
  min-width: 0;
}
.material-has-opts {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  flex-shrink: 0;
}
.material-file-inline {
  flex: 1 1 14rem;
  min-width: 12rem;
  max-width: 24rem;
}
.material-file-inline label,
.material-file-row label {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-size: 0.8rem;
  color: var(--slate-600);
  white-space: nowrap;
}
.material-file-inline label .form-control,
.material-file-inline label input[type="file"],
.material-file-row label .form-control,
.material-file-row label input[type="file"] {
  width: auto !important;
  flex: 1 1 auto;
  min-width: 0;
}
.material-file-row {
  margin-top: 0.55rem;
  max-width: 28rem;
}
.material-optional {
  grid-template-columns: auto auto 1fr;
  align-items: center;
}
.summary-count {
  margin-top: 0.35rem;
  text-align: right;
  font-size: 0.8rem;
  color: var(--slate-500);
}
.declare-cell .declare-heading {
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #111;
  font-family: inherit;
}
.declare-cell .declare-text {
  line-height: 1.65;
  margin-bottom: 0.45rem;
  color: #111;
  font-family: inherit;
}
.declare-sign-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-top: 1rem;
}
.declare-sign-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
  font-size: 13px;
  color: #111;
  font-family: inherit;
}
.declare-sign-item .input-inline {
  width: 8.5rem;
  padding: 0.2rem 0.35rem;
  border: none;
  border-bottom: 1px solid #334155;
  border-radius: 0;
  font-size: 13px;
  background: transparent;
  font-family: inherit;
  color: #111;
}
.declare-sign-item input[type="date"].input-inline {
  width: 9.5rem;
}
.sign-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.75rem;
}
.sign-row label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 12rem;
  flex: 1;
  margin: 0;
  font-size: 0.85rem;
  color: var(--slate-700);
}
.approval-cell { background: #fafbfc; }
.ethics-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.25rem;
}
.d-none { display: none !important; }
@media (max-width: 768px) {
  .ethics-table .label-cell { width: 7.5rem; min-width: 7.5rem; font-size: 0.85rem; }
  .material-fields,
  .material-required-row { grid-template-columns: 1fr; }
  .material-required-inline {
    grid-template-columns: 1fr;
  }
  .material-optional-inline {
    flex-wrap: wrap;
  }
  .material-optional-fields {
    flex: 1 1 100%;
  }
  .material-head-row { flex-wrap: wrap; }
  .material-file-inline { max-width: none; min-width: 100%; }
}
.ethics-form .form-control,
.ethics-form .form-control-sm {
  width: 100%;
  padding: 0.3rem 0.45rem;
  border: 1px solid #94a3b8;
  border-radius: 0;
  font-size: 13px;
  line-height: 1.55;
  background: #fff;
  font-family: inherit;
  color: #111;
}
.ethics-form .form-control-sm { padding: 0.25rem 0.4rem; font-size: 13px; }
.ethics-form textarea.form-control { resize: vertical; min-height: 140px; font-family: inherit; }
.ethics-form .form-check { display: flex; gap: 0.45rem; align-items: flex-start; }
.ethics-form .form-check-input { margin-top: 0.25rem; }
.ethics-form .form-check-label { font-size: 13px; color: #111; font-family: inherit; }
.ethics-inline-input {
  display: inline-block;
  width: 4.5rem;
  padding: 0.15rem 0.35rem;
  border: none;
  border-bottom: 1px solid #334155;
  background: transparent;
  text-align: center;
  font-size: 13px;
  font-family: inherit;
  color: #111;
}
.ethics-inline-input.ethics-year { width: 4.2rem; }
.ethics-inline-input.ethics-seq { width: 5rem; }
.ethics-inline-input:focus {
  outline: none;
  border-bottom-color: #0d9488;
}
.btn-outline-secondary {
  background: #fff;
  border: 1px solid var(--slate-300);
  color: var(--slate-700);
}
.btn-outline-secondary:hover {
  background: var(--slate-50);
  text-decoration: none;
  color: var(--slate-900);
}
.ethics-form-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.75rem;
  font-family: var(--font-sans);
}
.ethics-form-actions,
.ethics-form-actions label,
.ethics-form-actions select,
.ethics-form-actions textarea,
.ethics-form-actions .btn {
  font-family: var(--font-sans);
}
.ethics-form-actions label {
  font-size: 0.875rem;
  color: var(--slate-700);
}
.ethics-form-actions select,
.ethics-form-actions textarea {
  font-size: 0.875rem;
}
.ethics-form-header {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  margin-bottom: 1rem;
}
.ethics-form-header .ethics-form-title {
  margin: 0;
  text-align: center;
  width: 100%;
}
.ethics-form-header .ethics-form-no {
  margin: 0.75rem 0 0;
  text-align: right;
  white-space: nowrap;
}
.ethics-table .label-cell .req,
.material-title .req,
.declare-sign-item .req,
.declare-heading .req,
.approve-page .req,
.ethics-form .req {
  color: #dc2626;
  margin-right: 0.15rem;
  font-weight: 700;
}

/* 临床「科学研究项目伦理审查意见」：A4 + 政府表单边距（上下20mm、左右25mm） */
.c-opinion-a4 {
  max-width: none;
}
.c-opinion-a4 .c-opinion-sheet {
  width: 210mm;
  min-height: 297mm;
  margin: 12px auto 0;
  padding: 20mm 25mm;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  border: 1px solid #cbd5e1;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}
.c-opinion-a4 .c-opinion-sheet > .ethics-table {
  flex: 1 1 auto;
}
.c-opinion-a4 .ethics-form-actions {
  width: 210mm;
  margin: 0.75rem auto 1.5rem;
}
.c-opinion-a4 .ethics-form-toolbar {
  width: 210mm;
  margin-left: auto;
  margin-right: auto;
}

/* 临床「科学研究项目伦理审查意见」表头字号（四号=14pt，五号=10.5pt） */
.c-opinion-sheet .ethics-form-org {
  text-align: center;
  font-family: "仿宋", FangSong, "STFangsong", "FangSong_GB2312", serif;
  font-size: 14pt; /* 四号 */
  font-weight: 400;
  margin: 0 0 0.15rem;
  letter-spacing: 0;
}
.c-opinion-sheet .ethics-form-org-en {
  text-align: center;
  font-family: "Times New Roman", Times, serif;
  font-size: 11pt;
  font-weight: 400;
  color: #111;
  margin: 0 0 0.55rem;
}
.c-opinion-sheet .ethics-form-title {
  text-align: center;
  font-family: "仿宋", FangSong, "STFangsong", "FangSong_GB2312", serif;
  font-size: 14pt; /* 四号 */
  font-weight: 400;
  letter-spacing: 0;
  margin: 0.2rem 0 0.15rem;
}
.c-opinion-sheet .ethics-form-subtitle {
  text-align: center;
  font-family: "Times New Roman", Times, serif;
  font-size: 11pt;
  font-weight: 400;
  color: #111;
  margin: 0 0 0.65rem;
}
.c-opinion-sheet .c-opinion-no-row {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
  margin: 0.5rem 0 0;
}
/* 研审第（YYYY-NNN）号：- 前 4 字宽、后 3 字宽 */
.c-opinion-sheet .ethics-inline-input.ethics-year,
.c-opinion-sheet .c-no-year {
  display: inline-block;
  width: 4ch;
  min-width: 4ch;
  max-width: 4ch;
  box-sizing: content-box;
  padding: 0.1rem 0;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.c-opinion-sheet .ethics-inline-input.ethics-seq,
.c-opinion-sheet .c-no-seq {
  display: inline-block;
  width: 3ch;
  min-width: 3ch;
  max-width: 3ch;
  box-sizing: content-box;
  padding: 0.1rem 0;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.c-opinion-sheet .ethics-inline-input.ethics-year::-webkit-outer-spin-button,
.c-opinion-sheet .ethics-inline-input.ethics-year::-webkit-inner-spin-button,
.c-opinion-sheet .ethics-inline-input.ethics-seq::-webkit-outer-spin-button,
.c-opinion-sheet .ethics-inline-input.ethics-seq::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.c-opinion-sheet .ethics-inline-input.ethics-year,
.c-opinion-sheet .ethics-inline-input.ethics-seq {
  -moz-appearance: textfield;
  appearance: textfield;
}
.c-opinion-sheet .ethics-form-no {
  margin: 0;
  text-align: right;
  font-family: "仿宋", FangSong, "STFangsong", "FangSong_GB2312", serif;
  font-size: 10.5pt; /* 五号 */
  font-weight: 400;
  white-space: nowrap;
}
.c-opinion-sheet .c-opinion-approval-no {
  margin: 0;
  text-align: right;
  font-family: "Times New Roman", Times, serif;
  font-size: 10.5pt; /* 五号 */
  font-weight: 400;
  color: #111;
  white-space: nowrap;
}
.c-opinion-sheet .c-opinion-approval-blank {
  display: inline-block;
  width: 8ch; /* No. 后预留 8 位数空位 */
  min-width: 8ch;
}
.c-opinion-sheet .ethics-table .label-cell {
  width: 11.5rem;
  min-width: 11.5rem;
  font-family: "仿宋", FangSong, "STFangsong", "FangSong_GB2312", serif;
  font-size: 12pt; /* 小四 */
  font-weight: 400;
  color: #111;
  text-align: center;
  vertical-align: middle;
  white-space: normal;
}
/* 中文标签、英文标签各占一行，且自身不折行 */
.c-opinion-sheet .ethics-table .label-cell .cn-label {
  display: block;
  white-space: nowrap;
}
.c-opinion-sheet .ethics-table .label-cell .en {
  display: block;
  font-family: "Times New Roman", Times, serif;
  font-size: 10.5pt; /* 五号 */
  font-weight: 400;
  color: #111;
  margin-top: 0.1rem;
  white-space: nowrap;
}
.c-opinion-sheet .c-en {
  display: block;
  font-family: "Times New Roman", Times, serif;
  font-size: 10.5pt; /* 五号 */
  font-weight: 400;
  color: #111;
  margin-top: 0.1rem;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
}
.c-opinion-sheet .c-cn {
  font-family: "仿宋", FangSong, "STFangsong", "FangSong_GB2312", serif;
  font-size: 12pt; /* 小四 */
  font-weight: 400;
  color: #111;
}
.c-opinion-sheet .option-row .opt,
.c-opinion-sheet .option-sub .opt,
.c-opinion-sheet .c-approach-opt {
  font-family: "仿宋", FangSong, "STFangsong", "FangSong_GB2312", serif;
  font-size: 10.5pt; /* 五号 */
  color: #111;
}
.c-opinion-sheet .c-full-static td {
  padding: 0.55rem 0.65rem;
}
.c-opinion-sheet .c-decision-block {
  padding: 0.55rem 0.65rem 0.85rem;
}
.c-opinion-sheet .c-decision-block .c-preamble {
  text-indent: 2em;
  line-height: 1.55;
  margin: 0.45rem 0 0.85rem;
}
.c-opinion-sheet .c-decision-result {
  margin: 0.75rem 0 1.25rem;
}
/* 「同意」「Approved」均缩进 2 格 */
.c-opinion-sheet .c-decision-result .c-cn,
.c-opinion-sheet .c-decision-result .c-en {
  text-indent: 2em;
}
/* 委员会中英文 / 签字行：整块靠右，内部左对齐（中文对齐英文左侧） */
.c-opinion-sheet .c-committee {
  display: flex;
  justify-content: flex-end;
  padding-right: 1.5rem;
  margin-top: 1.25rem;
}
.c-opinion-sheet .c-committee-block {
  text-align: left;
  line-height: 1.7;
  width: max-content;
  max-width: 100%;
}
.c-opinion-sheet .c-committee-block .c-en {
  margin-bottom: 0.15rem;
}
.c-opinion-sheet .c-chair-line,
.c-opinion-sheet .c-date-line {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  flex-wrap: nowrap;
}
.c-opinion-sheet .c-chair-line {
  justify-content: flex-start;
}
/* 年/月/日 与 Date 靠右 */
.c-opinion-sheet .c-date-line {
  justify-content: flex-end;
  width: 100%;
}
.c-opinion-sheet .c-date-en {
  text-align: right;
  width: 100%;
  white-space: nowrap;
}
.c-opinion-sheet .c-chair-input {
  width: 7rem;
  max-width: 40%;
  border: none;
  border-bottom: 1px solid #334155;
  border-radius: 0;
  background: transparent;
  font-family: "仿宋", FangSong, "STFangsong", "FangSong_GB2312", serif;
  font-size: 12pt;
  text-align: center;
  padding: 0 0.25rem;
}
.c-opinion-sheet .c-date-picker {
  width: 10.5rem;
  border: none;
  border-bottom: 1px solid #334155;
  border-radius: 0;
  background: transparent;
  font-family: "仿宋", FangSong, "STFangsong", "FangSong_GB2312", serif;
  font-size: 12pt;
  padding: 0 0.15rem;
  color: #111;
}
.c-opinion-sheet .c-date-picker::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.7;
}
.c-opinion-sheet .c-validity-block {
  padding: 0.55rem 0.65rem 0.85rem;
}
.c-opinion-sheet .c-validity-body {
  text-indent: 2em;
  margin-top: 0.45rem;
  line-height: 1.55;
}
.c-opinion-sheet .c-validity-body .c-en {
  text-indent: 0;
  margin-top: 0.25rem;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* ===== ????????? ===== */
.page-content:has(.detail-page) {
  container-type: inline-size;
  container-name: detail-page;
}
.detail-page { display: flex; flex-direction: column; gap: 1rem; width: 100%; }
.detail-page-head {
  display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between;
  gap: 0.75rem 1rem; padding: 0.25rem 0;
}
.detail-page-title { margin: 0; font-size: 1.25rem; color: var(--slate-900); }
.detail-page-meta { margin-top: 0.35rem; color: var(--slate-600); font-size: 0.9rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.35rem; }
.detail-page-meta .dot { color: var(--slate-400); }
.status-pill {
  display: inline-flex; align-items: center; padding: 0.1rem 0.55rem; border-radius: 999px;
  background: #ecfdf5; color: #0f766e; font-size: 0.8rem; font-weight: 600;
}
.detail-split {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 1rem;
  width: 100%;
}
.detail-main {
  flex: 65 1 0;
  width: auto;
  max-width: none;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.detail-side {
  flex: 35 1 0;
  width: auto;
  max-width: none;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: sticky;
  top: 0.75rem;
  max-height: calc(100vh - 5.5rem);
  overflow: auto;
  padding-bottom: 0.25rem;
  align-self: flex-start;
}
.detail-panel {
  background: #fff; border: 1px solid var(--slate-200); border-radius: 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04); overflow: hidden;
}
.detail-panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  padding: 0.85rem 1rem; border-bottom: 1px solid var(--slate-200); background: #f8fafc;
}
.detail-panel-head h2 { margin: 0; font-size: 0.95rem; color: var(--slate-800); }
.detail-panel-head h2 .flow-head-meta {
  margin-left: 0.35rem;
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--slate-500);
}
.detail-flow-top .detail-panel-body { padding: 0.65rem 1rem 0.75rem; }
.detail-panel-body { padding: 1rem; }
.detail-panel-body.no-pad { padding: 0; }
.detail-form-body { padding: 1rem 1.1rem 1.25rem; overflow: auto; }

.app-form-sheet {
  font-family: "SimSun", "??", "Songti SC", "Noto Serif SC", serif;
  color: #111;
  font-size: 13px;
  line-height: 1.55;
}
.app-form-title { text-align: center; font-size: 1.15rem; margin: 0 0 0.5rem; letter-spacing: 1px; }
.app-form-no { text-align: right; margin: 0 0 0.75rem; }
.app-form-sheet .slot { display: inline-block; min-width: 3ch; text-align: center; }
.app-form-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.app-form-table th, .app-form-table td {
  border: 1px solid #334155; padding: 0.45rem 0.55rem; vertical-align: top; line-height: 1.55; font-weight: 400;
}
.app-form-table th { width: 8.5rem; min-width: 8.5rem; text-align: center; vertical-align: middle; font-weight: 700; background: #f8fafc; white-space: nowrap; }
.app-form-table th.label-wrap { white-space: normal; }
.app-form-table .opts { line-height: 1.75; }
.app-form-table .mat-line { margin: 0.15rem 0; }
.app-form-table .summary { white-space: pre-wrap; word-break: break-word; min-height: 4rem; }
.app-form-table .block-title { font-weight: 700; margin-bottom: 0.35rem; }
.app-form-table .sign-row {
  display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 0.5rem 2rem; margin-top: 0.75rem;
}

.flow-track {
  display: flex; flex-direction: row; align-items: flex-start; gap: 0;
  overflow-x: auto; padding: 0.35rem 0.15rem 0.75rem; scroll-snap-type: x proximity;
}
.flow-track-item {
  position: relative; display: flex; flex-direction: row; align-items: flex-start;
  flex: 0 0 auto; min-width: 7.5rem; max-width: 9.5rem; scroll-snap-align: start;
}
.flow-track-line {
  position: absolute; left: -0.15rem; top: 0.72rem; width: 0.9rem; height: 2px;
  background: #cbd5e1; transform: translateX(-100%);
}
.flow-track-item.is-done .flow-track-line,
.flow-track-item.is-current .flow-track-line { background: #14b8a6; }
.flow-track-node {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 0.3rem; width: 100%; padding: 0 0.35rem;
}
.flow-track-dot {
  width: 1.15rem; height: 1.15rem; border-radius: 50%;
  border: 2px solid #94a3b8; background: #fff; box-sizing: border-box;
}
.flow-track-item.is-done .flow-track-dot { background: #14b8a6; border-color: #0f766e; }
.flow-track-item.is-current .flow-track-dot {
  background: #fff; border-color: #0d9488; box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.22);
}
.flow-track-name { font-size: 0.8rem; font-weight: 600; color: var(--slate-800); line-height: 1.25; }
.flow-track-state { font-size: 0.72rem; color: var(--slate-500); }
.flow-track-item.is-current .flow-track-state { color: #0f766e; font-weight: 600; }
.flow-track-summary {
  font-size: 0.7rem; color: var(--slate-600); line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.flow-now-banner {
  margin-top: 0.35rem; padding: 0.65rem 0.75rem; border-radius: 8px;
  background: #f0fdfa; border: 1px solid #99f6e4; color: #115e59; font-size: 0.85rem;
}

.flow-node-list { list-style: none; margin: 0; padding: 0; }
.flow-node-list-item {
  padding: 0.85rem 1rem; border-bottom: 1px solid var(--slate-200);
}
.flow-node-list-item:last-child { border-bottom: none; }
.flow-node-list-item.is-current { background: #f0fdfa; }
.flow-node-list-top {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.35rem;
}
.flow-node-badge {
  flex: 0 0 auto; font-size: 0.72rem; padding: 0.1rem 0.45rem; border-radius: 999px;
  background: #e2e8f0; color: #475569;
}
.flow-node-list-item.is-done .flow-node-badge { background: #ccfbf1; color: #0f766e; }
.flow-node-list-item.is-current .flow-node-badge { background: #99f6e4; color: #115e59; }
.flow-node-desc { margin: 0 0 0.35rem; font-size: 0.85rem; color: var(--slate-700); line-height: 1.45; }
.flow-node-meta { margin: 0.15rem 0 0; font-size: 0.8rem; color: var(--slate-500); }
.flow-node-meta .sep { opacity: 0.55; margin: 0 0.15rem; }
.flow-task-mini { margin: 0.4rem 0 0; padding-left: 1.1rem; font-size: 0.78rem; color: var(--slate-600); }

.approval-action-badge {
  flex: 0 0 auto;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  line-height: 1.3;
}
.approval-action-badge.act-ok { background: #ccfbf1; color: #0f766e; }
.approval-action-badge.act-fail { background: #fee2e2; color: #b91c1c; }
.approval-action-badge.act-other { background: #e2e8f0; color: #475569; }
.approval-timeline-item .flow-node-desc {
  margin-top: 0.35rem;
  padding: 0.4rem 0.55rem;
  background: #f8fafc;
  border-radius: 6px;
  border: 1px solid var(--slate-100);
}

@container detail-page (max-width: 780px) {
  .detail-split { flex-direction: column; flex-wrap: wrap; }
  .detail-side {
    flex: none;
    width: 100%;
    max-width: none;
    min-width: 0;
    position: static;
    max-height: none;
    overflow: visible;
  }
}
@media (max-width: 640px) {
  .detail-split { flex-direction: column; }
  .detail-side {
    flex: none;
    width: 100%;
    max-width: none;
    min-width: 0;
    position: static;
    max-height: none;
    overflow: visible;
  }
}

/* ?? ?????? ?? */
.esign-create-page {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 960px;
  margin: 0 auto;
}
.esign-create-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.35rem 1.5rem;
  border-radius: 14px;
  border: 1px solid rgba(15, 118, 110, 0.12);
  background:
    radial-gradient(1200px 220px at 0% 0%, rgba(45, 212, 191, 0.16), transparent 55%),
    linear-gradient(135deg, #f0fdfa 0%, #ffffff 48%, #f8fafc 100%);
}
.esign-create-eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--teal-700, #0f766e);
}
.esign-create-hero h1 {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--slate-900, #0f172a);
  letter-spacing: -0.02em;
}
.esign-create-lead {
  margin: 0.45rem 0 0;
  max-width: 36rem;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--slate-600);
}
.esign-create-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.esign-create-card {
  padding: 1.2rem 1.35rem 1.35rem;
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.esign-create-card-head {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--slate-100);
}
.esign-create-card-head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--slate-800);
}
.esign-create-card-head p {
  margin: 0.2rem 0 0;
  font-size: 0.8125rem;
  color: var(--slate-500);
}
.esign-step-num {
  flex: 0 0 auto;
  width: 1.75rem;
  height: 1.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--teal-600, #0d9488);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 700;
}
.seal-field-span-2 {
  grid-column: span 2;
}
.esign-reason {
  height: auto !important;
  min-height: 6.5rem;
  padding: 0.65rem 0.75rem !important;
  line-height: 1.5;
  resize: vertical;
}
.esign-dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 148px;
  padding: 1.4rem 1rem;
  border: 1.5px dashed var(--slate-300);
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.esign-dropzone:hover,
.esign-dropzone.is-drag {
  border-color: var(--teal-400, #2dd4bf);
  background: var(--teal-50, #f0fdfa);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.1);
}
.esign-dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.esign-dropzone-icon {
  width: 2.75rem;
  height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--slate-200);
  background: #fff;
  color: var(--teal-600, #0d9488);
  margin-bottom: 0.15rem;
}
.esign-dropzone-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--slate-700);
}
.esign-dropzone-hint {
  font-size: 0.75rem;
  color: var(--slate-400);
}
.esign-file-list {
  list-style: none;
  margin: 0.85rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.esign-file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--slate-200);
  border-radius: 10px;
  background: var(--slate-50, #f8fafc);
}
.esign-file-meta {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}
.esign-file-icon {
  flex: 0 0 auto;
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--slate-200);
  color: var(--teal-700, #0f766e);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.esign-file-text { min-width: 0; }
.esign-file-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--slate-800);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.esign-file-size {
  font-size: 0.75rem;
  color: var(--slate-400);
}
.esign-file-remove {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--slate-500);
  font-size: 0.8125rem;
  cursor: pointer;
  padding: 0.25rem 0.4rem;
  border-radius: 6px;
}
.esign-file-remove:hover {
  background: #fee2e2;
  color: #b91c1c;
}
.esign-create-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.95rem 1.15rem;
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  background: #fff;
  position: sticky;
  bottom: 0.75rem;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}
.esign-create-actions-note {
  font-size: 0.8125rem;
  color: var(--slate-500);
}
.esign-create-actions-btns {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}
.esign-stamp-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}
.esign-approve-box {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
}
.esign-approve-box textarea.seal-control {
  height: auto !important;
  min-height: 4rem;
  padding: 0.55rem 0.75rem !important;
}
.esign-doc-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.esign-doc-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--slate-100);
  border-radius: 8px;
  background: var(--slate-50);
  font-size: 0.875rem;
}
.esign-doc-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  flex: 1;
}
.esign-doc-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
  color: var(--slate-800);
}
.esign-doc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  flex: 0 0 auto;
  justify-content: flex-end;
}
.esign-radio-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  padding: 0.35rem 0;
  font-size: 0.875rem;
  color: var(--slate-700);
}
.esign-radio-row label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
}
@media (max-width: 960px) {
  .seal-field-span-2 { grid-column: 1 / -1; }
  .esign-create-hero { flex-direction: column; }
  .esign-create-actions { position: static; }
}

a.js-print-consume.is-busy {
  opacity: 0.65;
  pointer-events: none;
}
[data-print-remaining].print-remaining-flash {
  animation: print-remaining-pulse 0.7s ease;
  font-weight: 700;
  color: #b45309;
}
@keyframes print-remaining-pulse {
  0% { background: #fef3c7; }
  100% { background: transparent; }
}
