:root {
  --color-ink: #15233d;
  --color-ink-soft: #516079;
  --color-ink-muted: #7a879d;
  --color-navy: #101d38;
  --color-navy-soft: #1d3157;
  --color-red: #d44b43;
  --color-red-dark: #ad332e;
  --color-red-soft: #fff1ef;
  --color-blue: #2870c6;
  --color-blue-soft: #edf5ff;
  --color-bg: #f4f6fa;
  --color-surface: #ffffff;
  --color-surface-muted: #f8fafc;
  --color-border: #e4e9f1;
  --color-border-strong: #cbd5e2;
  --color-success: #2c8c69;
  --color-success-soft: #eaf8f2;
  --shadow-card: 0 12px 32px rgba(28, 46, 78, 0.08);
  --shadow-sheet: 0 24px 72px rgba(15, 31, 57, 0.22);
  --radius-card: 18px;
  --radius-control: 12px;
  --motion-fast: 180ms;
  --motion-standard: 240ms;
  --scrollbar-thumb: rgba(40, 112, 198, 0.72);
  --scrollbar-thumb-hover: #1f5ea8;
  --scrollbar-track: rgba(228, 233, 241, 0.62);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  background: var(--color-bg);
  scroll-behavior: smooth;
  scrollbar-color: var(--scrollbar-thumb) transparent;
  scrollbar-width: thin;
}

* {
  scrollbar-color: var(--scrollbar-thumb) transparent;
  scrollbar-width: thin;
}

*::-webkit-scrollbar {
  width: 11px;
  height: 11px;
}

*::-webkit-scrollbar-track {
  border-radius: 999px;
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: linear-gradient(180deg, #4c91dc 0%, var(--color-blue) 100%);
  background-clip: padding-box;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24);
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
  background-clip: padding-box;
}

*::-webkit-scrollbar-corner {
  background: transparent;
}

.package-filters::-webkit-scrollbar,
.message-output::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.package-filters::-webkit-scrollbar-thumb,
.message-output::-webkit-scrollbar-thumb {
  border-width: 2px;
  background: linear-gradient(180deg, #79afe5 0%, var(--color-blue) 100%);
  background-clip: padding-box;
}

.sheet::-webkit-scrollbar-track,
.message-output::-webkit-scrollbar-track,
.package-filters::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--color-ink);
  background: var(--color-bg);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: contain;
}

button,
input {
  font: inherit;
}

button {
  touch-action: manipulation;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(40, 112, 198, 0.35);
  outline-offset: 2px;
}

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

.app-shell {
  width: min(1180px, 100%);
  min-height: 100dvh;
  margin: 0 auto;
  padding: 0 28px calc(28px + env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 74px;
  padding: 12px 0;
}

.brand,
.topbar-actions,
.session-controls,
.hero-actions,
.control-row,
.filter-row,
.section-heading,
.sheet-header,
.sheet-footer,
.settings-actions,
.connection-state {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-logo {
  display: block;
  width: 150px;
  height: 42px;
  object-fit: contain;
  object-position: left center;
}

.brand-divider {
  width: 1px;
  height: 28px;
  background: var(--color-border-strong);
}

.brand-project {
  flex: 0 0 auto;
  white-space: nowrap;
  color: var(--color-navy);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.brand-name,
.brand-caption {
  display: block;
}

.brand-name {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.brand-caption {
  margin-top: 1px;
  color: var(--color-ink-muted);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.topbar-actions {
  gap: 10px;
}

.session-controls {
  gap: 8px;
}

.session-name {
  max-width: 160px;
  overflow: hidden;
  color: var(--color-navy);
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-action {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--color-ink-soft);
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
}

.session-action:hover {
  transform: none;
  color: var(--color-blue);
}

.session-action-login {
  color: var(--color-blue);
}

.source-badge,
.record-count,
.approval-badge,
.package-count,
.filter-chip {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.source-badge {
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.source-badge-demo {
  color: var(--color-blue);
  border-color: #cfe1f7;
  background: var(--color-blue-soft);
}

.source-badge-live {
  color: var(--color-success);
  border-color: #bfe6d6;
  background: var(--color-success-soft);
}

.icon-button {
  display: inline-grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  color: var(--color-ink-soft);
  background: var(--color-surface);
  cursor: pointer;
  transition: border-color var(--motion-fast) ease, color var(--motion-fast) ease, background var(--motion-fast) ease;
}

.icon-button:hover {
  color: var(--color-navy);
  border-color: var(--color-border-strong);
  background: var(--color-surface-muted);
}

.icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  background: currentColor;
  mask: var(--icon-mask) center / contain no-repeat;
  -webkit-mask: var(--icon-mask) center / contain no-repeat;
}

.icon-settings { --icon-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 15.2a3.2 3.2 0 1 0 0-6.4 3.2 3.2 0 0 0 0 6.4Z'/%3E%3Cpath d='m19.4 15 .1.1a1.8 1.8 0 0 1-2.5 2.5l-.1-.1a1.8 1.8 0 0 0-3 1.3v.2a1.8 1.8 0 0 1-3.6 0v-.2a1.8 1.8 0 0 0-3-1.3l-.1.1a1.8 1.8 0 0 1-2.5-2.5l.1-.1a1.8 1.8 0 0 0-1.3-3h-.2a1.8 1.8 0 0 1 0-3.6h.2a1.8 1.8 0 0 0 1.3-3l-.1-.1a1.8 1.8 0 0 1 2.5-2.5l.1.1a1.8 1.8 0 0 0 3-1.3v-.2a1.8 1.8 0 0 1 3.6 0v.2a1.8 1.8 0 0 0 3 1.3l.1-.1a1.8 1.8 0 0 1 2.5 2.5l-.1.1a1.8 1.8 0 0 0 1.3 3h.2a1.8 1.8 0 0 1 0 3.6h-.2a1.8 1.8 0 0 0-1.3 3Z'/%3E%3C/svg%3E"); }
.icon-refresh { --icon-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 11a8.1 8.1 0 0 0-14.8-4.7L3 9'/%3E%3Cpath d='M3 4v5h5'/%3E%3Cpath d='M4 13a8.1 8.1 0 0 0 14.8 4.7L21 15'/%3E%3Cpath d='M21 20v-5h-5'/%3E%3C/svg%3E"); }
.icon-search { --icon-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-4-4'/%3E%3C/svg%3E"); }
.icon-link { --icon-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 13a5 5 0 0 0 7.1.1l2-2a5 5 0 0 0-7.1-7.1l-1.2 1.2'/%3E%3Cpath d='M14 11a5 5 0 0 0-7.1-.1l-2 2a5 5 0 0 0 7.1 7.1l1.2-1.2'/%3E%3C/svg%3E"); }
.icon-check { --icon-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 4.3 4.3L19 6.6'/%3E%3C/svg%3E"); }
.icon-package { --icon-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 7 8-4 8 4-8 4-8-4Z'/%3E%3Cpath d='M4 7v10l8 4 8-4V7'/%3E%3Cpath d='M12 11v10'/%3E%3C/svg%3E"); }
.icon-calendar { --icon-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M16 3v4M8 3v4M3 10h18'/%3E%3C/svg%3E"); }
.icon-copy { --icon-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='8' y='8' width='12' height='12' rx='2'/%3E%3Cpath d='M16 8V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h2'/%3E%3C/svg%3E"); }
.icon-close { --icon-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 6l12 12M18 6 6 18'/%3E%3C/svg%3E"); }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  min-height: 0;
  padding: 28px 34px;
  overflow: hidden;
  border-radius: 20px;
  color: #fff;
  background: var(--color-navy);
  box-shadow: 0 20px 48px rgba(16, 29, 56, 0.16);
}

.hero-copy {
  max-width: 630px;
}

.eyebrow,
.section-overline,
.summary-kicker {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 11px;
  font-weight: 800;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #9db7dd;
}

.status-dot,
.connection-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #69d7a4;
  box-shadow: 0 0 0 4px rgba(105, 215, 164, 0.12);
}

.hero h1 {
  max-width: 620px;
  margin: 8px 0 4px;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.06;
  letter-spacing: -0.045em;
}

.hero-description {
  max-width: 680px;
  margin: 0;
  color: #c5d2e7;
  font-size: 15px;
  line-height: 1.6;
}

.hero-actions {
  gap: 10px;
  margin-top: 18px;
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  cursor: pointer;
  font-size: 14px;
  font-weight: 750;
  line-height: 1;
  transition: transform var(--motion-fast) ease, background var(--motion-fast) ease, border-color var(--motion-fast) ease, color var(--motion-fast) ease, box-shadow var(--motion-fast) ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(0) scale(0.98);
}

.button-primary {
  color: #fff;
  background: var(--color-blue);
  box-shadow: 0 8px 18px rgba(40, 112, 198, 0.22);
}

.button-primary:hover {
  background: #1f5ea8;
  box-shadow: 0 10px 24px rgba(40, 112, 198, 0.3);
}

.button-secondary {
  color: var(--color-ink);
  border-color: var(--color-border);
  background: var(--color-surface);
}

.button-secondary:hover,
.button-quiet:hover {
  border-color: var(--color-border-strong);
  background: var(--color-surface-muted);
}

.button-on-dark {
  color: #d8e4f6;
  border-color: rgba(216, 228, 246, 0.28);
  background: transparent;
}

.button-on-dark:hover {
  color: #fff;
  border-color: rgba(216, 228, 246, 0.55);
  background: rgba(255, 255, 255, 0.07);
}

.button-quiet {
  color: var(--color-ink-soft);
  border-color: var(--color-border);
  background: var(--color-surface);
}

.hero-summary {
  align-self: center;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.065);
}

.summary-kicker {
  color: #95acd0;
}

.summary-title {
  margin-top: 8px;
  overflow: hidden;
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-rule {
  height: 1px;
  margin: 20px 0;
  background: rgba(255, 255, 255, 0.13);
}

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

.summary-grid strong,
.summary-grid span {
  display: block;
}

.summary-grid strong {
  font-size: 24px;
  font-variant-numeric: tabular-nums;
}

.summary-grid span {
  margin-top: 2px;
  color: #9db0cf;
  font-size: 12px;
}

.summary-footnote {
  margin: 4px 0 0;
  color: var(--color-ink-muted);
  font-size: 12px;
}

.control-panel,
.metric-card,
.record-card,
.empty-state {
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
}

.control-panel {
  margin-top: 18px;
  padding: 14px;
  border-radius: var(--radius-card);
}

.control-row {
  gap: 10px;
}

.control-row-top {
  justify-content: space-between;
}

.search-field {
  display: flex;
  min-height: 46px;
  flex: 1;
  align-items: center;
  gap: 10px;
  padding: 0 13px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  color: var(--color-ink-muted);
  background: var(--color-surface-muted);
}

.search-field:focus-within {
  border-color: #8db4e0;
  box-shadow: 0 0 0 3px rgba(40, 112, 198, 0.12);
}

.search-field input {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  color: var(--color-ink);
  background: transparent;
  font-size: 15px;
}

.search-field input::placeholder {
  color: var(--color-ink-muted);
}

.filter-row {
  gap: 12px;
  min-height: 45px;
  margin-top: 12px;
  padding: 8px 2px 2px;
  border-top: 1px solid var(--color-border);
}

.filter-label {
  flex: 0 0 auto;
  color: var(--color-ink-muted);
  font-size: 13px;
  font-weight: 700;
}

.package-filters {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--color-ink-soft);
  background: var(--color-surface-muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  transition: color var(--motion-fast) ease, background var(--motion-fast) ease, border-color var(--motion-fast) ease;
}

.filter-chip:hover {
  color: var(--color-navy);
  border-color: var(--color-border-strong);
}

.filter-chip[aria-selected="true"] {
  color: var(--color-red-dark);
  border-color: #f2c7c3;
  background: var(--color-red-soft);
}

.date-filter-row {
  align-items: center;
}

.date-filter {
  min-width: 180px;
  min-height: 40px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-control);
  outline: 0;
  color: var(--color-ink);
  background-color: var(--color-surface);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
}

.date-filter:focus {
  border-color: var(--color-blue);
  box-shadow: 0 0 0 3px rgba(40, 112, 198, 0.12);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 18px;
}

.metric-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 82px;
  padding: 14px 16px;
  border-radius: 16px;
}

.metric-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 12px;
}

.metric-icon-red { color: var(--color-red); background: var(--color-red-soft); }
.metric-icon-blue { color: var(--color-blue); background: var(--color-blue-soft); }
.metric-icon-slate { color: var(--color-navy-soft); background: #eef1f7; }

.metric-label,
.metric-card strong {
  display: block;
}

.metric-label {
  color: var(--color-ink-muted);
  font-size: 12px;
}

.metric-card strong {
  margin-top: 2px;
  font-size: 17px;
  font-weight: 800;
}

.records-section {
  padding: 38px 0 30px;
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.section-overline {
  color: var(--color-blue);
}

.section-heading h2,
.sheet h2 {
  margin: 4px 0 0;
  font-size: 25px;
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.section-heading-actions {
  display: flex;
  align-items: center;
}

.record-count {
  min-height: 32px;
  padding: 0 11px;
  border-radius: 999px;
  color: var(--color-ink-soft);
  background: #eaeff6;
  font-size: 12px;
  font-weight: 750;
}

.list-summary {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 58px;
  padding: 8px 12px 8px 16px;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  background: var(--color-surface);
  box-shadow: 0 7px 20px rgba(28, 46, 78, 0.06);
}

.summary-view {
  max-width: 130px;
  overflow: hidden;
  color: var(--color-navy);
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-stat {
  display: grid;
  gap: 0;
  min-width: 42px;
}

.summary-stat strong {
  color: var(--color-navy);
  font-size: 18px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.summary-stat small {
  color: var(--color-ink-muted);
  font-size: 11px;
  white-space: nowrap;
}

.feedback-banner {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 14px;
}

.feedback-error {
  border: 1px solid #f0c4c0;
  color: #9c2e2a;
  background: var(--color-red-soft);
}

.group-list {
  display: grid;
  gap: 28px;
}

.group-block {
  display: grid;
  gap: 11px;
}

.group-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 3px;
}

.group-title-wrap {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
}

.group-index {
  display: inline-grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
  color: var(--color-blue);
  background: var(--color-blue-soft);
  font-size: 12px;
  font-weight: 800;
}

.group-title {
  overflow: hidden;
  font-size: 18px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.package-count {
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-ink-muted);
  font-size: 12px;
  font-weight: 700;
}

.record-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  padding: 22px;
  border-radius: var(--radius-card);
  transition: border-color var(--motion-standard) ease, box-shadow var(--motion-standard) ease, transform var(--motion-standard) ease;
}

.date-groups {
  display: grid;
  gap: 15px;
  margin-top: 2px;
}

.date-group {
  display: grid;
  gap: 10px;
}

.date-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 15px;
  border: 1px solid #d9e6f6;
  border-radius: 14px;
  background: linear-gradient(100deg, #f3f8ff, #fbfdff);
}

.date-title-wrap {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.date-icon {
  width: 20px;
  height: 20px;
  color: var(--color-blue);
}

.date-title-wrap h4 {
  margin: 0;
  color: var(--color-navy);
  font-size: 15px;
  line-height: 1.3;
}

.date-title-wrap p {
  margin: 2px 0 0;
  color: var(--color-ink-muted);
  font-size: 12px;
}

.button-compact {
  min-height: 40px;
  padding: 0 13px;
  font-size: 13px;
}

.date-records {
  display: grid;
  gap: 10px;
  padding-left: 16px;
  border-left: 2px solid #dbeaff;
}

.record-label {
  flex: 0 0 auto;
  color: var(--color-blue);
  font-size: 12px;
  font-weight: 750;
}

.record-card:hover {
  border-color: #cbd9eb;
  box-shadow: 0 16px 38px rgba(28, 46, 78, 0.12);
  transform: translateY(-2px);
}

.record-main {
  min-width: 0;
}

.record-topline,
.record-meta,
.record-person,
.record-location,
.record-actions,
.detail-list,
.record-title-row {
  display: flex;
  align-items: center;
}

.record-topline {
  justify-content: space-between;
  gap: 12px;
}

.record-title-row {
  min-width: 0;
  gap: 9px;
}

.record-title {
  overflow: hidden;
  font-size: 17px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.approval-badge {
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--color-success);
  background: var(--color-success-soft);
  font-size: 11px;
  font-weight: 800;
}

.record-date {
  flex: 0 0 auto;
  color: var(--color-ink-muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.record-meta {
  flex-wrap: wrap;
  gap: 8px 17px;
  margin-top: 8px;
  color: var(--color-ink-soft);
  font-size: 13px;
}

.record-person,
.record-location {
  gap: 6px;
}

.record-meta .icon {
  width: 15px;
  height: 15px;
  color: var(--color-blue);
}

.detail-list {
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.detail-list li {
  min-height: 32px;
  padding: 5px 10px;
  border: 1px solid var(--color-border);
  border-radius: 9px;
  color: var(--color-ink-soft);
  background: var(--color-surface-muted);
  font-size: 13px;
}

.detail-list strong {
  color: var(--color-ink);
  font-variant-numeric: tabular-nums;
}

.record-actions {
  justify-content: flex-end;
  align-self: stretch;
}

.record-actions .button {
  align-self: center;
  white-space: nowrap;
}

.empty-state {
  padding: 48px 24px;
  border-radius: var(--radius-card);
  text-align: center;
}

.empty-icon {
  display: inline-block;
  width: 30px;
  height: 30px;
  color: var(--color-blue);
}

.empty-state h3 {
  margin: 12px 0 4px;
  font-size: 18px;
}

.empty-state p {
  margin: 0 auto 18px;
  color: var(--color-ink-muted);
  font-size: 14px;
}

.bottom-bar {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 14px 10px 18px;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 30px rgba(28, 46, 78, 0.08);
  backdrop-filter: blur(12px);
}

.connection-state {
  min-width: 0;
  gap: 9px;
  color: var(--color-ink-soft);
  font-size: 13px;
}

.connection-dot {
  flex: 0 0 auto;
  background: var(--color-blue);
  box-shadow: 0 0 0 4px rgba(40, 112, 198, 0.12);
}

.bottom-bar .button {
  min-width: 94px;
}

.overlay {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  align-items: end;
  padding: 18px;
  background: rgba(7, 17, 35, 0.58);
}

.sheet {
  width: min(650px, 100%);
  max-height: min(88dvh, 780px);
  margin: 0 auto;
  overflow: auto;
  padding: 26px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 22px;
  background: var(--color-surface);
  box-shadow: var(--shadow-sheet);
  animation: sheet-in var(--motion-standard) ease-out both;
}

.settings-sheet {
  width: min(580px, 100%);
}

.login-sheet {
  width: min(430px, 100%);
}

.login-description {
  margin: 14px 0 0;
  color: var(--color-ink-soft);
  font-size: 14px;
  line-height: 1.65;
}

.login-form {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.login-form .button {
  width: 100%;
}

.remember-option {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--color-ink-soft);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.remember-option input {
  width: 17px;
  height: 17px;
  accent-color: var(--color-blue);
}

@keyframes sheet-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.sheet-header {
  justify-content: space-between;
  gap: 18px;
}

.message-context {
  margin-top: 18px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--color-ink-soft);
  background: var(--color-blue-soft);
  font-size: 13px;
}

.message-output {
  max-height: 46dvh;
  margin: 14px 0 0;
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  color: var(--color-ink);
  background: var(--color-surface-muted);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
}

.sheet-footer {
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
}

.sheet-hint,
.settings-description,
.field-help,
.optional-label {
  color: var(--color-ink-muted);
  font-size: 12px;
}

.sheet-hint {
  max-width: 280px;
}

.settings-description {
  margin: 14px 0 0;
  line-height: 1.7;
}

.settings-form {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

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

.form-field label {
  color: var(--color-ink-soft);
  font-size: 13px;
  font-weight: 750;
}

.optional-label {
  margin-left: 4px;
  font-weight: 400;
}

.form-field input {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-control);
  outline: 0;
  color: var(--color-ink);
  background: var(--color-surface);
  font-size: 15px;
}

.form-field input:focus {
  border-color: var(--color-blue);
  box-shadow: 0 0 0 3px rgba(40, 112, 198, 0.12);
}

.field-help {
  line-height: 1.45;
}

.date-range-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-feedback {
  min-height: 20px;
  color: var(--color-red-dark);
  font-size: 13px;
}

.settings-actions {
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
}

.toast {
  position: fixed;
  z-index: 30;
  right: 18px;
  bottom: calc(22px + env(safe-area-inset-bottom));
  max-width: min(360px, calc(100vw - 36px));
  padding: 12px 15px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  color: var(--color-ink);
  background: var(--color-surface);
  box-shadow: var(--shadow-sheet);
  font-size: 14px;
  font-weight: 700;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skeleton-card {
  height: 174px;
  border-radius: var(--radius-card);
  background: linear-gradient(90deg, #eef2f7 25%, #f8fafc 37%, #eef2f7 63%);
  background-size: 400% 100%;
  animation: skeleton 1.4s ease infinite;
}

@keyframes skeleton {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

@media (max-width: 820px) {
  .app-shell {
    padding-right: 18px;
    padding-left: 18px;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 24px 28px 22px;
  }

  .record-card {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .record-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .app-shell {
    padding-right: 12px;
    padding-left: 12px;
  }

  .topbar {
    min-height: 68px;
    flex-wrap: wrap;
    row-gap: 4px;
  }

  .brand {
    gap: 8px;
    min-width: 0;
    flex: 0 0 auto;
  }

  .brand-logo {
    width: 116px;
    height: 34px;
  }

  .brand-divider {
    height: 22px;
  }

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

  .brand-caption {
    display: none;
  }

  .source-badge {
    display: none;
  }

  .session-name {
    max-width: 120px;
    font-size: 12px;
  }

  .session-action {
    min-height: 40px;
    font-size: 12px;
  }

  .topbar-actions {
    margin-left: auto;
  }

  .hero {
    min-height: 0;
    padding: 22px 20px 20px;
    border-radius: 20px;
  }

  .hero h1 {
    font-size: 31px;
  }

  .control-panel {
    padding: 11px;
  }

  .control-row-top {
    align-items: stretch;
    flex-direction: column;
  }

  .control-row-top .button {
    width: 100%;
  }

  .filter-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .date-filter {
    width: 100%;
  }

  .package-filters {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    overscroll-behavior-x: contain;
  }

  .filter-chip {
    flex: 0 0 auto;
  }

  .metrics {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .metric-card {
    min-height: 64px;
  }

  .records-section {
    padding-top: 30px;
  }

  .section-heading {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 12px;
  }

  .section-heading-actions {
    grid-column: 2;
    grid-row: 1;
    align-self: end;
  }

  .section-heading-actions .button {
    white-space: nowrap;
  }

  .list-summary {
    grid-column: 1 / -1;
  }

  .list-summary {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
    padding-left: 12px;
  }

  .summary-view {
    max-width: 88px;
  }

  .date-heading {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .date-heading .button {
    width: 100%;
  }

  .date-records {
    padding-left: 9px;
  }

  .section-heading h2 {
    font-size: 22px;
  }

  .record-card {
    padding: 17px;
    border-radius: 16px;
  }

  .record-topline {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .record-title {
    white-space: normal;
  }

  .record-date {
    font-size: 12px;
  }

  .record-actions,
  .record-actions .button {
    width: 100%;
  }

  .bottom-bar {
    position: sticky;
    z-index: 5;
    bottom: 10px;
    min-height: 58px;
    padding-left: 13px;
  }

  .connection-state {
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .bottom-bar .button {
    min-width: 78px;
    padding-right: 13px;
    padding-left: 13px;
  }

  .overlay {
    padding: 0;
  }

  .sheet {
    max-height: 92dvh;
    padding: 22px 17px calc(18px + env(safe-area-inset-bottom));
    border-radius: 20px 20px 0 0;
  }

  .sheet-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .sheet-hint {
    max-width: none;
  }

  .sheet-footer .button,
  .settings-actions .button {
    width: 100%;
  }

  .settings-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .date-range-row {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
