:root {
  color-scheme: dark;
  --bg: #050c0a;
  --header-bg: rgba(7, 18, 15, 0.94);
  --sidebar-bg: #081310;
  --workspace-bg: #07110f;
  --panel: #0b1916;
  --panel-raised: #0d211c;
  --border: #1a3029;
  --border-strong: #285344;
  --text: #eff9f4;
  --muted: #8ba097;
  --faint: #5f756c;
  --accent: #2ce18c;
  --accent-strong: #54f2a6;
  --accent-soft: rgba(44, 225, 140, 0.1);
  --accent-line: rgba(44, 225, 140, 0.22);
  --danger: #ff827a;
  --backdrop: rgba(0, 0, 0, 0.66);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  --focus: #71f6b4;
  --grid-line: rgba(56, 102, 83, 0.08);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #F8EEE8;
  --header-bg: rgba(255, 249, 245, 0.94);
  --sidebar-bg: #FFF8F4;
  --workspace-bg: #FAF0EA;
  --panel: #FFFDFB;
  --panel-raised: #F7E4DA;
  --border: #E8CFC2;
  --border-strong: #D8AE9D;
  --text: #33251F;
  --muted: #756056;
  --faint: #A1887C;
  --accent: #C7674D;
  --accent-strong: #9F4B37;
  --accent-soft: rgba(199, 103, 77, 0.1);
  --accent-line: rgba(199, 103, 77, 0.25);
  --danger: #B84038;
  --backdrop: rgba(63, 42, 35, 0.3);
  --shadow: 0 24px 70px rgba(103, 67, 53, 0.14);
  --focus: #A64F39;
  --grid-line: rgba(152, 103, 82, 0.07);
}

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

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  background: var(--workspace-bg);
  color: var(--text);
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC",
    "Noto Sans SC", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.theme-loading .app-shell {
  visibility: hidden;
}

button,
a {
  color: inherit;
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

a {
  text-decoration: none;
}

svg {
  display: block;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

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

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  padding: 9px 13px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: var(--panel-raised);
  color: var(--text);
  transform: translateY(-150%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  padding: max(20px, env(safe-area-inset-top)) 16px
    max(16px, env(safe-area-inset-bottom));
  overflow-y: auto;
  border-right: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(46, 122, 91, 0.045), transparent 24%),
    var(--sidebar-bg);
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 4px;
}

.brand {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
  border-radius: 12px;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  border: 1px solid var(--accent-line);
  border-radius: 14px;
  background:
    radial-gradient(circle at 35% 25%, rgba(88, 255, 174, 0.2), transparent 46%),
    var(--accent-soft);
  color: var(--accent-strong);
  box-shadow: inset 0 0 20px rgba(44, 225, 140, 0.05);
}

.brand-mark svg {
  width: 31px;
  height: 31px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

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

.brand-copy strong {
  overflow: hidden;
  font-size: 16px;
  font-weight: 760;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-copy small {
  overflow: hidden;
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.primary-nav {
  margin-top: 30px;
}

.nav-item {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 52px;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  transition:
    color 160ms ease,
    border-color 160ms ease,
    background-color 160ms ease,
    transform 160ms ease;
}

.nav-item.is-active {
  border-color: var(--accent-line);
  background:
    linear-gradient(90deg, rgba(44, 225, 140, 0.12), transparent 86%),
    var(--accent-soft);
  color: var(--text);
  box-shadow: inset 3px 0 0 var(--accent);
}

.nav-item:not(:disabled):hover {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.018);
  color: var(--text);
}

.nav-item:not(:disabled):active {
  transform: translateY(1px);
}

.nav-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 9px;
}

.nav-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.nav-text {
  overflow: hidden;
  font-size: 14px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-arrow {
  color: var(--accent);
  opacity: 0;
  transform: translateX(-3px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.nav-arrow svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.nav-item.is-active .nav-arrow {
  opacity: 1;
  transform: translateX(0);
}

.future-nav {
  display: grid;
  gap: 4px;
  margin-top: 24px;
}

.nav-label {
  margin: 0 0 8px;
  padding: 0 13px;
  color: var(--faint);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.06em;
}

.nav-item-muted {
  min-height: 46px;
  opacity: 0.64;
}

.nav-item-muted .nav-icon svg {
  width: 19px;
  height: 19px;
}

.soon-badge {
  padding: 4px 7px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--faint);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.09em;
}

.sidebar-footer {
  display: grid;
  gap: 9px;
  margin-top: auto;
  padding-top: 30px;
}

.theme-toggle {
  display: grid;
  min-height: 68px;
  grid-template-columns: 36px minmax(0, 1fr) 12px;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.018);
  color: var(--text);
  text-align: left;
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    transform 160ms ease;
}

.theme-toggle:hover {
  border-color: var(--border-strong);
  background: var(--accent-soft);
}

.theme-toggle:active {
  transform: translateY(1px);
}

.theme-toggle:disabled {
  opacity: 0.72;
}

.theme-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 10px;
  background: var(--panel-raised);
  color: var(--accent);
}

.theme-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

html[data-theme="dark"] .icon-moon,
html[data-theme="light"] .icon-sun {
  display: none;
}

.theme-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.theme-copy strong,
.theme-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.theme-copy strong {
  font-size: 13px;
  font-weight: 700;
}

.theme-copy small {
  color: var(--muted);
  font-size: 10px;
}

.theme-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.theme-toggle.is-saving .theme-indicator {
  animation: status-pulse 850ms ease-in-out infinite;
}

.server-status {
  display: flex;
  min-height: 28px;
  align-items: center;
  gap: 8px;
  padding: 0 6px;
  color: var(--faint);
  font-size: 10px;
  letter-spacing: 0.02em;
}

.status-dot,
.mobile-status {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--faint);
  box-shadow: 0 0 0 4px rgba(95, 117, 108, 0.08);
}

.server-status.is-online,
.mobile-status.is-online {
  color: var(--accent);
}

.server-status.is-online .status-dot,
.mobile-status.is-online {
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.server-status.is-offline,
.mobile-status.is-offline {
  color: var(--danger);
}

.server-status.is-offline .status-dot,
.mobile-status.is-offline {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(255, 130, 122, 0.1);
}

.drawer-backdrop {
  display: none;
}

.workspace-frame {
  min-width: 0;
  background:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
    radial-gradient(circle at 92% 4%, var(--accent-soft), transparent 30%),
    var(--workspace-bg);
  background-size:
    42px 42px,
    42px 42px,
    auto,
    auto;
}

.mobile-header {
  display: none;
}

.main-content {
  min-width: 0;
  min-height: 100vh;
  min-height: 100dvh;
}

.workspace-view {
  min-height: 100vh;
  min-height: 100dvh;
}

.inspiration-view,
.settings-view {
  min-height: 100vh;
  min-height: 100dvh;
}

.inspiration-view {
  padding: clamp(24px, 4vw, 54px) clamp(18px, 4vw, 58px) 32px;
}

.inspiration-page {
  display: grid;
  width: min(1120px, 100%);
  min-height: calc(100vh - clamp(56px, 8vw, 86px));
  min-height: calc(100dvh - clamp(56px, 8vw, 86px));
  grid-template-rows: auto minmax(420px, 1fr) auto;
  gap: 20px;
  margin: 0 auto;
}

.inspiration-header,
.settings-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.inspiration-header h1,
.settings-header h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 58px);
  font-weight: 780;
  letter-spacing: -0.055em;
  line-height: 1.05;
}

.page-intro {
  margin: 11px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.fragment-counter {
  display: grid;
  min-width: 92px;
  justify-items: end;
  padding: 10px 0 2px;
  color: var(--muted);
}

.fragment-counter strong {
  color: var(--text);
  font-size: 28px;
  font-weight: 760;
  letter-spacing: -0.04em;
}

.fragment-counter span {
  font-size: 10px;
  letter-spacing: 0.08em;
}

.sphere-stage {
  position: relative;
  display: grid;
  min-height: 440px;
  place-items: center;
  overflow: hidden;
  perspective: 1100px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% 46%, var(--accent-soft), transparent 28%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.012), transparent 55%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.018);
}

.sphere-stage::before {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 36px 36px;
  content: "";
  mask-image: radial-gradient(circle at center, black, transparent 74%);
  -webkit-mask-image: radial-gradient(circle at center, black, transparent 74%);
  pointer-events: none;
}

.inspiration-sphere {
  position: relative;
  width: min(720px, 100%);
  height: min(58vh, 600px);
  min-height: 410px;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.inspiration-sphere.is-dragging {
  cursor: grabbing;
}

.sphere-aura {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(62%, 430px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(44, 225, 140, 0.12) 0%,
    rgba(44, 225, 140, 0.035) 42%,
    transparent 72%
  );
  filter: blur(5px);
  transform: translate(-50%, -50%);
  animation: aura-breathe 4.8s ease-in-out infinite;
  pointer-events: none;
}

.sphere-core {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  width: clamp(100px, 15vw, 150px);
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid var(--accent-line);
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, rgba(125, 255, 190, 0.24), transparent 34%),
    radial-gradient(circle at 50% 62%, rgba(18, 97, 66, 0.72), transparent 68%),
    var(--panel-raised);
  box-shadow:
    0 0 42px rgba(44, 225, 140, 0.12),
    0 0 95px rgba(44, 225, 140, 0.07),
    inset 0 0 34px rgba(44, 225, 140, 0.08);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.core-light {
  position: absolute;
  width: 34%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--accent);
  box-shadow:
    0 0 18px var(--accent),
    0 0 45px rgba(44, 225, 140, 0.42);
  opacity: 0.85;
  animation: core-pulse 2.8s ease-in-out infinite;
}

.core-label {
  position: relative;
  z-index: 2;
  color: #effff7;
  font-size: clamp(17px, 2vw, 23px);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.55);
}

.core-ring {
  position: absolute;
  inset: -13%;
  border: 1px solid var(--accent-line);
  border-radius: 50%;
  opacity: 0.65;
}

.core-ring-one {
  transform: rotateX(68deg) rotateZ(12deg);
  animation: ring-spin 12s linear infinite;
}

.core-ring-two {
  transform: rotateY(67deg) rotateZ(38deg);
  animation: ring-spin-reverse 16s linear infinite;
}

.core-ring-three {
  inset: -27%;
  border-style: dashed;
  opacity: 0.28;
  animation: ring-spin 24s linear infinite;
}

.fragment-layer {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  pointer-events: none;
}

.fragment {
  position: absolute;
  top: 50%;
  left: 50%;
  max-width: 170px;
  padding: 7px 11px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-size: clamp(10px, 1vw, 13px);
  font-weight: 620;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.12);
  transform-origin: center;
  will-change: transform, opacity;
  pointer-events: none;
  transition:
    color 120ms linear,
    border-color 120ms linear,
    background-color 120ms linear,
    box-shadow 120ms linear;
}

.fragment.is-front {
  border-color: var(--accent-line);
  background: var(--panel-raised);
  color: var(--text);
  box-shadow:
    0 0 0 1px rgba(44, 225, 140, 0.035),
    0 8px 28px rgba(0, 0, 0, 0.18);
}

.fragment.is-foreground {
  border-color: var(--accent);
  color: var(--accent-strong);
  text-shadow: 0 0 16px rgba(44, 225, 140, 0.28);
}

.fragment.is-new {
  animation: fragment-arrive 520ms cubic-bezier(0.2, 0.9, 0.25, 1.25);
}

.drag-hint {
  position: absolute;
  right: 16px;
  bottom: 14px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel);
  color: var(--faint);
  font-size: 10px;
  pointer-events: none;
}

.drag-hint svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.inspiration-composer {
  display: grid;
  gap: 8px;
}

.inspiration-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.08);
}

.inspiration-input-row input,
.field-group input {
  width: 100%;
  min-width: 0;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font: inherit;
  outline: none;
}

.inspiration-input-row input {
  min-height: 48px;
  padding: 0 13px;
  font-size: 14px;
}

.inspiration-input-row input::placeholder {
  color: var(--faint);
}

.inspiration-input-row:focus-within {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.launch-button,
.save-settings-button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 17px;
  border: 1px solid var(--accent-line);
  border-radius: 11px;
  background:
    linear-gradient(180deg, rgba(89, 255, 174, 0.08), transparent),
    var(--accent-soft);
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    transform 160ms ease;
}

.launch-button:hover,
.save-settings-button:hover {
  border-color: var(--accent);
  background-color: var(--accent-soft);
}

.launch-button:active,
.save-settings-button:active {
  transform: translateY(1px);
}

.launch-button:disabled,
.save-settings-button:disabled {
  opacity: 0.58;
}

.launch-button svg,
.save-settings-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.composer-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 6px;
  color: var(--faint);
  font-size: 10px;
}

.settings-view {
  padding: clamp(30px, 5vw, 70px) clamp(18px, 5vw, 70px);
}

.settings-page {
  width: min(880px, 100%);
  margin: 0 auto;
}

.settings-card {
  display: grid;
  gap: 25px;
  margin-top: 30px;
  padding: clamp(20px, 4vw, 34px);
  border: 1px solid var(--border);
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.02), transparent 45%),
    var(--panel);
  box-shadow: var(--shadow);
}

.settings-card-head {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.provider-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid var(--accent-line);
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
}

.provider-icon svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.provider-copy h2 {
  margin: 0 0 4px;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.provider-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.config-status {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--faint);
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
}

.config-status.is-configured {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
}

.field-group {
  display: grid;
  gap: 8px;
}

.field-group label {
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.field-group input {
  min-height: 48px;
  padding: 0 13px;
  border-color: var(--border);
  border-radius: 10px;
  background: var(--workspace-bg);
  font-size: 13px;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.field-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field-group small {
  color: var(--faint);
  font-size: 10px;
  line-height: 1.55;
}

.settings-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 18px;
}

.settings-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.settings-actions p {
  max-width: 480px;
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.api-nav-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--faint);
}

.api-nav-status.is-loaded {
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

@keyframes aura-breathe {
  0%,
  100% {
    opacity: 0.72;
    transform: translate(-50%, -50%) scale(0.94);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.06);
  }
}

@keyframes core-pulse {
  0%,
  100% {
    opacity: 0.64;
    transform: scale(0.9);
  }
  50% {
    opacity: 1;
    transform: scale(1.08);
  }
}

@keyframes ring-spin {
  to {
    transform: rotateX(68deg) rotateZ(372deg);
  }
}

@keyframes ring-spin-reverse {
  to {
    transform: rotateY(67deg) rotateZ(-322deg);
  }
}

@keyframes fragment-arrive {
  0% {
    opacity: 0;
    filter: brightness(1.8);
  }
  100% {
    opacity: 1;
    filter: brightness(1);
  }
}

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--panel);
  color: var(--muted);
  transition:
    color 160ms ease,
    border-color 160ms ease,
    background-color 160ms ease;
}

.icon-button:hover {
  border-color: var(--border-strong);
  background: var(--panel-raised);
  color: var(--text);
}

.icon-button svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.sidebar-close {
  display: none;
}

.toast {
  position: fixed;
  z-index: 120;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  width: min(360px, calc(100vw - 36px));
  padding: 13px 15px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--panel-raised);
  color: var(--text);
  box-shadow: var(--shadow);
  font-size: 13px;
  line-height: 1.55;
  animation: toast-in 180ms ease-out both;
}

.toast.is-error {
  border-color: rgba(255, 130, 122, 0.38);
}

@keyframes status-pulse {
  0%,
  100% {
    opacity: 0.45;
    transform: scale(0.82);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

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

@media (max-width: 860px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 60;
    width: min(86vw, 308px);
    height: 100vh;
    height: 100dvh;
    border-right-color: var(--border-strong);
    box-shadow: var(--shadow);
    transform: translateX(-102%);
    transition: transform 220ms cubic-bezier(0.22, 0.8, 0.24, 1);
  }

  body.drawer-open {
    overflow: hidden;
  }

  body.drawer-open .sidebar {
    transform: translateX(0);
  }

  .drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border-radius: 0;
    background: var(--backdrop);
    opacity: 0;
    pointer-events: none;
    transition: opacity 220ms ease;
    -webkit-tap-highlight-color: transparent;
  }

  body.drawer-open .drawer-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar-close {
    display: grid;
  }

  .mobile-header {
    position: sticky;
    top: 0;
    z-index: 30;
    display: grid;
    height: calc(60px + env(safe-area-inset-top));
    grid-template-columns: 42px minmax(0, 1fr) 8px;
    align-items: center;
    gap: 10px;
    padding: env(safe-area-inset-top) 15px 0;
    border-bottom: 1px solid var(--border);
    background: var(--header-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }

  .mobile-brand {
    overflow: hidden;
    color: var(--text);
    font-size: 14px;
    font-weight: 740;
    letter-spacing: -0.02em;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .workspace-view {
    min-height: calc(100vh - 60px - env(safe-area-inset-top));
    min-height: calc(100dvh - 60px - env(safe-area-inset-top));
  }

  .inspiration-view,
  .settings-view {
    padding: 24px 14px calc(28px + env(safe-area-inset-bottom));
  }

  .inspiration-page {
    min-height: calc(100vh - 84px - env(safe-area-inset-top));
    min-height: calc(100dvh - 84px - env(safe-area-inset-top));
    grid-template-rows: auto minmax(390px, 1fr) auto;
    gap: 15px;
  }

  .inspiration-header {
    align-items: flex-start;
    gap: 12px;
  }

  .settings-header {
    display: block;
  }

  .settings-header .page-intro {
    max-width: none;
  }

  .inspiration-header h1,
  .settings-header h1 {
    font-size: 36px;
  }

  .page-intro {
    max-width: 250px;
    margin-top: 8px;
    font-size: 12px;
  }

  .fragment-counter {
    min-width: 62px;
  }

  .fragment-counter strong {
    font-size: 24px;
  }

  .sphere-stage {
    min-height: 390px;
    border-radius: 19px;
  }

  .inspiration-sphere {
    width: 100%;
    height: 100%;
    min-height: 380px;
  }

  .sphere-core {
    width: 96px;
  }

  .sphere-aura {
    width: 68%;
  }

  .fragment {
    max-width: 132px;
    padding: 6px 9px;
    font-size: 10px;
  }

  .drag-hint {
    right: 10px;
    bottom: 10px;
    padding: 6px 8px;
  }

  .inspiration-input-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .launch-button {
    width: 100%;
  }

  .composer-meta {
    align-items: flex-start;
  }

  .settings-card {
    gap: 21px;
    margin-top: 23px;
    padding: 18px;
    border-radius: 17px;
  }

  .settings-card-head {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 11px;
  }

  .provider-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
  }

  .config-status {
    width: fit-content;
    grid-column: 2;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .settings-actions {
    display: grid;
    gap: 15px;
  }

  .save-settings-button {
    width: 100%;
  }
  .toast {
    right: 14px;
    bottom: max(14px, env(safe-area-inset-bottom));
    width: min(360px, calc(100vw - 28px));
  }
}

@media (max-width: 390px) {
  .sidebar {
    width: min(90vw, 300px);
    padding-right: 13px;
    padding-left: 13px;
  }

  .brand-copy strong {
    font-size: 15px;
  }

  .inspiration-header h1,
  .settings-header h1 {
    font-size: 33px;
  }
}

@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;
  }
}

/* 子域管理与 AI 灵感基础样式 */
.inspiration-page { display: flex; flex-direction: column; gap: 16px; }
.sphere-stage { flex: 1 1 auto; }
.sphere-tool-button {
  position: absolute; right: 16px; bottom: 14px; z-index: 20; display: inline-flex;
  min-height: 38px; align-items: center; gap: 7px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--panel);
  color: var(--muted); font-size: 11px; font-weight: 700;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
  transition: border-color 160ms ease, color 160ms ease, background-color 160ms ease, transform 160ms ease;
}
.sphere-tool-button:hover { border-color: var(--accent-line); background: var(--panel-raised); color: var(--accent); }
.sphere-tool-button:active { transform: translateY(1px); }
.sphere-tool-button svg, .ai-inspiration-button svg, .test-connection-button svg, .secondary-button svg, .danger-button svg {
  width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8;
}
.subdomain-filter {
  display: grid; gap: 10px; padding: 14px; border: 1px solid var(--border);
  border-radius: 16px; background: rgba(255, 255, 255, 0.012);
}
.subdomain-filter-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.subdomain-filter-head h2 { margin: 0; font-size: 13px; font-weight: 760; }
.subdomain-filter-head p { margin: 4px 0 0; color: var(--faint); font-size: 10px; line-height: 1.5; }
.selection-summary {
  flex: 0 0 auto; padding: 5px 8px; border: 1px solid var(--accent-line);
  border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 9px; font-weight: 750;
}
.subdomain-chip-list { display: flex; flex-wrap: wrap; gap: 7px; }
.subdomain-chip {
  display: inline-flex; min-height: 32px; align-items: center; gap: 7px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--panel);
  color: var(--muted); font-size: 11px; font-weight: 650;
  transition: border-color 150ms ease, color 150ms ease, background-color 150ms ease;
}
.subdomain-chip:hover { border-color: var(--border-strong); color: var(--text); }
.subdomain-chip.is-active { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent-strong); }
.subdomain-chip-check {
  display: grid; width: 15px; height: 15px; place-items: center; border: 1px solid currentColor; border-radius: 4px; font-size: 10px; line-height: 1;
}
.subdomain-empty { padding: 7px 1px; color: var(--faint); font-size: 11px; }
.composer-group-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 5px; }
.composer-group-row > label { color: var(--muted); font-size: 11px; font-weight: 700; }
.select-wrap { position: relative; min-width: 0; }
.select-wrap select {
  width: 100%; min-height: 38px; appearance: none; padding: 0 31px 0 11px;
  border: 1px solid var(--border); border-radius: 9px; background: var(--workspace-bg);
  color: var(--text); font: inherit; font-size: 11px; outline: none;
}
.select-wrap select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.select-wrap select:disabled { color: var(--faint); opacity: 0.7; }
.select-wrap > svg {
  position: absolute; top: 50%; right: 9px; width: 16px; height: 16px; fill: none;
  stroke: var(--muted); stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8;
  transform: translateY(-50%); pointer-events: none;
}
.composer-group-row .select-wrap { width: min(230px, 60%); }
.ai-inspiration-button {
  display: grid; width: 100%; min-height: 66px; grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center; gap: 12px; padding: 9px 14px; border: 1px solid var(--accent-line);
  border-radius: 16px; background: linear-gradient(90deg, var(--accent-soft), transparent 72%), var(--panel);
  color: var(--text); text-align: left; box-shadow: 0 16px 42px rgba(0, 0, 0, 0.08);
  transition: border-color 160ms ease, transform 160ms ease;
}
.ai-inspiration-button:hover { border-color: var(--accent); }
.ai-inspiration-button:active { transform: translateY(1px); }
.ai-inspiration-button:disabled { cursor: not-allowed; opacity: 0.55; }
.ai-button-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.ai-button-icon svg { width: 23px; height: 23px; }
.ai-button-copy { display: grid; min-width: 0; gap: 3px; }
.ai-button-copy strong { font-size: 13px; }
.ai-button-copy small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.ai-button-arrow { color: var(--accent); font-size: 20px; }
.settings-button-group { display: flex; align-items: center; gap: 9px; }
.test-connection-button, .secondary-button {
  display: inline-flex; min-height: 48px; align-items: center; justify-content: center; gap: 8px; padding: 0 15px;
  border: 1px solid var(--border); border-radius: 11px; background: var(--workspace-bg);
  color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap;
}
.test-connection-button:hover, .secondary-button:hover { border-color: var(--border-strong); color: var(--text); }
.test-connection-button:disabled { opacity: 0.58; }
.connection-result {
  padding: 11px 13px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--workspace-bg); color: var(--muted); font-size: 11px; line-height: 1.55;
}
.connection-result.is-success { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent-strong); }
.connection-result.is-error { border-color: rgba(255, 130, 122, 0.36); color: var(--danger); }

/* 弹窗与碎片管理 */
.modal-layer { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 22px; }
.modal-layer-nested { z-index: 230; background: rgba(0, 0, 0, 0.22); }
.modal-backdrop {
  position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 0;
  background: var(--backdrop); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
}
.modal-card {
  position: relative; z-index: 1; display: grid; width: min(920px, 100%);
  max-height: min(86vh, 860px); max-height: min(86dvh, 860px); overflow: hidden;
  border: 1px solid var(--border-strong); border-radius: 22px; background: var(--panel);
  box-shadow: var(--shadow); animation: modal-enter 180ms ease-out both;
}
.modal-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 18px;
  padding: 20px 22px 16px; border-bottom: 1px solid var(--border);
}
.modal-header h2, .confirm-card h2 { margin: 0; font-size: 24px; letter-spacing: -0.035em; }
.fragment-editor-card { width: min(1040px, 100%); }
.fragment-editor-layout { display: grid; min-height: 500px; grid-template-columns: 280px minmax(0, 1fr); }
.group-panel { padding: 18px; overflow-y: auto; border-right: 1px solid var(--border); background: rgba(255, 255, 255, 0.012); }
.panel-title-row, .fragment-panel-head, .ai-results-head, .ai-results-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 15px;
}
.panel-title-row h3, .fragment-panel-head h3, .ai-results-head h3 { margin: 0; font-size: 14px; }
.panel-title-row span, .fragment-panel-head p, .ai-results-head p { margin: 0; color: var(--faint); font-size: 10px; }
.group-create-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; margin-top: 13px; }
.group-create-form input, .group-rename-form input, .confirm-card input, .ai-generation-form textarea, .ai-generation-form input, .ai-field-grid select {
  width: 100%; min-width: 0; border: 1px solid var(--border); border-radius: 9px;
  background: var(--workspace-bg); color: var(--text); font: inherit; font-size: 11px; outline: none;
}
.group-create-form input, .group-rename-form input, .confirm-card input, .ai-generation-form input, .ai-field-grid select {
  min-height: 40px; padding: 0 10px;
}
.ai-generation-form textarea { min-height: 94px; padding: 10px; resize: vertical; line-height: 1.55; }
.group-create-form input:focus, .group-rename-form input:focus, .confirm-card input:focus,
.ai-generation-form textarea:focus, .ai-generation-form input:focus, .ai-field-grid select:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.group-create-form button, .group-rename-form button {
  min-height: 40px; padding: 0 12px; border: 1px solid var(--accent-line);
  border-radius: 9px; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 700;
}
.group-manager-list { display: grid; gap: 7px; margin-top: 14px; }
.group-manager-item {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px;
  padding: 9px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel);
}
.group-manager-item.is-active { border-color: var(--accent-line); background: var(--accent-soft); }
.group-select-button { min-width: 0; color: var(--text); text-align: left; }
.group-select-button strong, .group-select-button small {
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.group-select-button strong { font-size: 11px; }
.group-select-button small { margin-top: 3px; color: var(--faint); font-size: 9px; }
.group-item-actions { display: flex; gap: 4px; }
.group-item-actions button { padding: 5px; border-radius: 6px; color: var(--faint); font-size: 9px; }
.group-item-actions button:hover { background: var(--panel-raised); color: var(--text); }
.group-item-actions .delete-group-trigger:hover { color: var(--danger); }
.group-rename-form {
  display: grid; gap: 7px; margin-top: 14px; padding: 11px;
  border: 1px solid var(--border); border-radius: 11px; background: var(--panel-raised);
}
.group-rename-form label { color: var(--muted); font-size: 10px; font-weight: 700; }
.group-rename-form > div { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 6px; }
.fragment-panel { min-width: 0; padding: 18px 20px 22px; overflow-y: auto; }
.fragment-panel-head { padding-bottom: 13px; border-bottom: 1px solid var(--border); }
.danger-button {
  display: inline-flex; min-height: 38px; align-items: center; justify-content: center; gap: 7px; padding: 0 12px;
  border: 1px solid rgba(255, 130, 122, 0.28); border-radius: 9px;
  background: rgba(255, 130, 122, 0.06); color: var(--danger); font-size: 10px; font-weight: 750;
}
.danger-button:disabled { cursor: not-allowed; opacity: 0.42; }
.fragment-check-list { display: grid; gap: 8px; margin-top: 14px; }
.fragment-check-item {
  display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; gap: 10px;
  padding: 11px 12px; border: 1px solid var(--border); border-radius: 11px;
  background: rgba(255, 255, 255, 0.012); cursor: pointer;
}
.fragment-check-item:hover { border-color: var(--border-strong); }
.fragment-check-item input, .ai-result-check input { width: 16px; height: 16px; accent-color: var(--accent); }
.fragment-check-content { min-width: 0; }
.fragment-check-content strong { display: block; color: var(--text); font-size: 12px; font-weight: 650; line-height: 1.5; }
.fragment-check-content small { display: block; margin-top: 3px; color: var(--faint); font-size: 9px; }
.empty-state { padding: 34px 20px; color: var(--faint); font-size: 11px; line-height: 1.65; text-align: center; }
.confirm-card { width: min(430px, 100%); padding: 24px; }
.confirm-card > p:not(.section-kicker) { margin: 10px 0 18px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.confirm-card label { display: block; margin-bottom: 7px; color: var(--text); font-size: 11px; font-weight: 700; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; }

/* AI 弹窗与移动端 */
.ai-modal-card { width: min(820px, 100%); overflow-y: auto; }
.ai-generation-form { display: grid; gap: 17px; padding: 20px 22px; }
.ai-field-grid { display: grid; grid-template-columns: 1fr 1fr 1.25fr; gap: 13px; }
.ai-field-grid .select-wrap select { min-height: 40px; }
.ai-generate-button {
  display: inline-flex; min-height: 48px; align-items: center; justify-content: center; gap: 9px;
  border: 1px solid var(--accent-line); border-radius: 11px;
  background: linear-gradient(180deg, rgba(89, 255, 174, 0.08), transparent), var(--accent-soft);
  color: var(--accent-strong); font-size: 13px; font-weight: 750;
}
.ai-generate-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.ai-generate-button:disabled { cursor: wait; opacity: 0.58; }
.ai-results-section { display: grid; gap: 13px; padding: 0 22px 22px; }
.ai-results-head { padding-top: 16px; border-top: 1px solid var(--border); }
.check-all-label { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; }
.ai-results-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ai-result-item {
  display: grid; grid-template-columns: 20px minmax(0, 1fr); align-items: start; gap: 9px;
  padding: 11px; border: 1px solid var(--border); border-radius: 10px;
  background: rgba(255, 255, 255, 0.012); cursor: pointer;
}
.ai-result-item:has(input:checked) { border-color: var(--accent-line); background: var(--accent-soft); }
.ai-result-item span { color: var(--text); font-size: 11px; line-height: 1.55; }
.ai-results-footer { padding-top: 13px; border-top: 1px solid var(--border); }
.ai-results-footer span { color: var(--faint); font-size: 10px; }
body.modal-open { overflow: hidden; }
@keyframes modal-enter {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@media (max-width: 860px) {
  .inspiration-page { display: flex; gap: 13px; }
  .subdomain-filter { padding: 12px; }
  .subdomain-filter-head p { display: none; }
  .subdomain-chip { min-height: 31px; }
  .composer-group-row { align-items: stretch; flex-direction: column; gap: 6px; }
  .composer-group-row .select-wrap { width: 100%; }
  .ai-inspiration-button { min-height: 62px; }
  .settings-button-group { display: grid; grid-template-columns: 1fr; width: 100%; }
  .settings-button-group button { width: 100%; }
  .modal-layer { align-items: end; padding: 10px; }
  .modal-card { width: 100%; max-height: 92vh; max-height: 92dvh; border-radius: 19px; }
  .fragment-editor-card { width: 100%; }
  .fragment-editor-layout { display: block; min-height: 0; max-height: calc(92dvh - 80px); overflow-y: auto; }
  .group-panel { border-right: 0; border-bottom: 1px solid var(--border); }
  .fragment-panel { overflow: visible; }
  .fragment-panel-head { align-items: flex-start; flex-direction: column; }
  .fragment-panel-head .danger-button { width: 100%; }
  .ai-field-grid { grid-template-columns: 1fr; }
  .ai-results-grid { grid-template-columns: 1fr; }
  .ai-results-footer { align-items: stretch; flex-direction: column; }
  .ai-results-footer .save-settings-button { width: 100%; }
  .confirm-card { width: 100%; }
}

.group-select-button,
.group-item-actions button {
  border: 0;
  background: transparent;
}
.group-item-actions button {
  min-height: 28px;
  padding: 0 7px;
  border: 1px solid var(--border);
  background: var(--panel-raised);
}
.group-item-actions .delete-group-trigger {
  border-color: rgba(255, 130, 122, 0.2);
}

/* 航行日志 */
.logs-view { padding: clamp(30px, 5vw, 70px) clamp(18px, 5vw, 70px); }
.logs-page { width: min(920px, 100%); margin: 0 auto; }
.logs-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.logs-header h1 { margin: 0; font-size: clamp(34px, 5vw, 58px); font-weight: 780; letter-spacing: -0.055em; line-height: 1.05; }
.log-total-badge { flex: 0 0 auto; padding: 7px 11px; border: 1px solid var(--accent-line); border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 10px; font-weight: 750; }
.log-category-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 26px 0 20px; }
.log-category-chip { display: inline-flex; min-height: 36px; align-items: center; gap: 7px; padding: 0 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--panel); color: var(--muted); font-size: 11px; font-weight: 700; }
.log-category-chip span { color: var(--faint); font-size: 9px; }
.log-category-chip.is-active { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent-strong); }
.navigation-log-list { display: grid; gap: 22px; }
.log-day-group { display: grid; gap: 10px; }
.log-day-header { display: flex; align-items: center; gap: 11px; color: var(--muted); font-size: 12px; font-weight: 760; }
.log-day-header::after { height: 1px; flex: 1; background: var(--border); content: ""; }
.log-day-list { display: grid; gap: 9px; }
.navigation-log-item { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 13px; padding: 13px 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--panel); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.06); }
.log-icon { display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid var(--accent-line); border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.log-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.log-content { min-width: 0; }
.log-message { margin: 0; color: var(--text); font-size: 12px; font-weight: 650; line-height: 1.65; overflow-wrap: anywhere; }
.log-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 6px; color: var(--faint); font-size: 9px; }
.log-category-tag { padding: 3px 6px; border: 1px solid var(--border); border-radius: 5px; color: var(--muted); }
.log-delete-button { display: grid; width: 32px; height: 32px; place-items: center; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--faint); }
.log-delete-button:hover { border-color: rgba(184, 64, 56, 0.24); background: rgba(184, 64, 56, 0.07); color: var(--danger); }
.log-delete-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.logs-empty { padding: 54px 20px; border: 1px dashed var(--border); border-radius: 16px; color: var(--faint); font-size: 12px; line-height: 1.7; text-align: center; }
.ai-save-target { display: grid; grid-template-columns: minmax(220px, 1fr) auto; align-items: end; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 11px; background: var(--workspace-bg); }
.ai-save-target p { margin: 0 0 3px; color: var(--faint); font-size: 10px; }
.ai-save-target.is-disabled { opacity: 0.72; }

/* 浅色暖色派生组件 */
html[data-theme="light"] .sidebar { background: linear-gradient(180deg, rgba(199, 103, 77, 0.055), transparent 24%), var(--sidebar-bg); }
html[data-theme="light"] .brand-mark { background: radial-gradient(circle at 35% 25%, rgba(199, 103, 77, 0.18), transparent 46%), var(--accent-soft); box-shadow: inset 0 0 20px rgba(199, 103, 77, 0.05); }
html[data-theme="light"] .nav-item.is-active { background: linear-gradient(90deg, rgba(199, 103, 77, 0.14), transparent 86%), var(--accent-soft); }
html[data-theme="light"] .sphere-aura { background: radial-gradient(circle, rgba(199, 103, 77, 0.13) 0%, rgba(199, 103, 77, 0.04) 42%, transparent 72%); }
html[data-theme="light"] .sphere-core { background: radial-gradient(circle at 34% 28%, rgba(255, 210, 191, 0.4), transparent 34%), radial-gradient(circle at 50% 62%, rgba(173, 87, 68, 0.72), transparent 68%), var(--panel-raised); box-shadow: 0 0 42px rgba(199, 103, 77, 0.14), 0 0 95px rgba(199, 103, 77, 0.08), inset 0 0 34px rgba(199, 103, 77, 0.09); }
html[data-theme="light"] .core-light { background: #D9785E; box-shadow: 0 0 18px #D9785E, 0 0 45px rgba(199, 103, 77, 0.4); }
html[data-theme="light"] .fragment.is-foreground { color: #A94F39; text-shadow: 0 0 16px rgba(199, 103, 77, 0.28); }
@media (max-width: 860px) {
  .logs-view { padding: 24px 14px calc(28px + env(safe-area-inset-bottom)); }
  .logs-header { align-items: flex-start; }
  .logs-header h1 { font-size: 36px; }
  .navigation-log-item { grid-template-columns: 38px minmax(0, 1fr) auto; align-items: start; gap: 10px; padding: 12px; }
  .log-icon { width: 38px; height: 38px; }
  .ai-save-target { grid-template-columns: 1fr; }
}

/* 专注番茄钟 */
.focus-view { padding: clamp(28px, 5vw, 66px) clamp(18px, 5vw, 66px); }
.focus-page { width: min(1080px, 100%); margin: 0 auto; }
.focus-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.focus-header h1 { margin: 0; font-size: clamp(34px, 5vw, 58px); font-weight: 780; letter-spacing: -0.055em; line-height: 1.05; }
.focus-sync-status { padding: 7px 11px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); font-size: 10px; font-weight: 700; }
.focus-sync-status.is-online { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); }
.focus-layout { display: grid; grid-template-columns: minmax(420px, 1.4fr) minmax(280px, .8fr); gap: 22px; margin-top: 28px; }
.focus-timer-card, .focus-side-panel, .focus-summary-card { border: 1px solid var(--border); border-radius: 22px; background: var(--panel); box-shadow: var(--shadow); }
.focus-timer-card { display: grid; justify-items: center; padding: 28px; }
.focus-timer-shell { display: grid; place-items: center; }
.focus-timer-ring { --focus-progress: 0%; position: relative; display: grid; width: min(360px, 68vw); aspect-ratio: 1; place-items: center; border-radius: 50%; background: conic-gradient(var(--accent) var(--focus-progress), var(--border) 0); }
.focus-timer-ring::before { position: absolute; inset: 12px; border-radius: 50%; background: var(--panel); content: ""; }
.focus-timer-ring::after { position: absolute; inset: 25px; border: 1px solid var(--accent-line); border-radius: 50%; content: ""; }
.focus-time-wrap { position: relative; z-index: 1; display: grid; justify-items: center; }
.focus-phase-label { color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.focus-time-display { margin-top: 8px; color: var(--text); font-size: clamp(42px, 7vw, 72px); font-weight: 780; letter-spacing: -.06em; }
.focus-time-hint { margin-top: 7px; color: var(--faint); font-size: 11px; }
.focus-timer-ring.is-overtime { background: conic-gradient(var(--danger) var(--focus-progress), var(--border) 0); }
.focus-task-display { max-width: 100%; margin-top: 22px; overflow: hidden; color: var(--muted); font-size: 13px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.focus-controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; margin-top: 20px; }
.focus-control-button, .focus-start-button { min-height: 46px; padding: 0 17px; border: 1px solid var(--border); border-radius: 11px; background: var(--workspace-bg); color: var(--text); font-size: 12px; font-weight: 750; }
.focus-control-button.primary, .focus-start-button { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent-strong); }
.focus-control-button.secondary { color: var(--muted); }
.focus-control-button:hover, .focus-start-button:hover { border-color: var(--accent); }
.focus-side-panel { display: grid; align-content: start; gap: 14px; padding: 20px; }
.focus-setup-block { display: grid; gap: 16px; }
.focus-preset-group { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.focus-preset-card { display: grid; min-height: 88px; align-content: center; justify-items: center; gap: 3px; border: 1px solid var(--border); border-radius: 13px; background: var(--workspace-bg); color: var(--muted); }
.focus-preset-card strong { color: var(--text); font-size: 22px; }
.focus-preset-card span, .focus-preset-card small { font-size: 9px; }
.focus-preset-card.is-active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.focus-start-button { width: 100%; }
.focus-audio-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px; border: 1px solid var(--border); border-radius: 13px; background: var(--workspace-bg); }
.focus-audio-card div { display: grid; gap: 4px; }
.focus-audio-card strong { font-size: 11px; }
.focus-audio-card small { color: var(--faint); font-size: 9px; }
.focus-audio-card .secondary-button { min-height: 36px; padding: 0 10px; font-size: 10px; }
.focus-abandon-button { width: 100%; }
.focus-summary-card { display: grid; gap: 18px; margin-top: 22px; padding: 24px; }
.focus-summary-card h2 { margin: 0; font-size: 24px; letter-spacing: -.035em; }
.focus-summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.focus-summary-grid > div { display: grid; gap: 5px; padding: 12px; border: 1px solid var(--border); border-radius: 11px; background: var(--workspace-bg); }
.focus-summary-grid span { color: var(--faint); font-size: 9px; }
.focus-summary-grid strong { font-size: 13px; }
.focus-summary-message { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.65; }
.focus-summary-card .focus-start-button { width: auto; justify-self: start; }
@media (max-width: 860px) {
  .focus-view { padding: 24px 14px calc(28px + env(safe-area-inset-bottom)); }
  .focus-header { align-items: flex-start; }
  .focus-header h1 { font-size: 36px; }
  .focus-layout { grid-template-columns: 1fr; gap: 14px; }
  .focus-timer-card { padding: 18px 12px; }
  .focus-timer-ring { width: min(320px, 78vw); }
  .focus-preset-group { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .focus-preset-card strong { font-size: 19px; }
  .focus-summary-grid { grid-template-columns: 1fr; }
}

/* 回蓝舱 */
.mindfulness-view {
  min-height: 100%;
  padding: clamp(24px, 4.2vw, 62px) clamp(16px, 4.6vw, 68px) calc(42px + env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 22% 18%, rgba(70, 210, 175, 0.11), transparent 34%),
    radial-gradient(circle at 80% 68%, rgba(99, 132, 255, 0.09), transparent 38%),
    linear-gradient(145deg, #06110f 0%, #091714 48%, #07120f 100%);
  color: #edf8f4;
  color-scheme: dark;
}
.mindfulness-page { width: min(1320px, 100%); margin: 0 auto; }
.mindfulness-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.mindfulness-header h1 { margin: 0; color: #f2fbf7; font-size: clamp(38px, 6vw, 68px); font-weight: 780; letter-spacing: -.065em; line-height: 1; }
.mindfulness-header .section-kicker { color: #63deb1; }
.mindfulness-header .page-intro { max-width: 560px; margin: 13px 0 0; color: #8aa79e; font-size: 13px; line-height: 1.7; }
.mindfulness-view .focus-sync-status { border-color: rgba(99, 222, 177, .22); background: rgba(44, 225, 140, .08); color: #8aa79e; }
.mindfulness-view .focus-sync-status.is-online { color: #71f2bd; }
.practice-tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; margin: 28px 0 20px; }
.practice-tab {
  display: grid; min-height: 86px; align-content: center; gap: 6px; padding: 12px 14px;
  border: 1px solid rgba(122, 190, 168, .16); border-radius: 16px;
  background: rgba(12, 31, 27, .72); color: #91a79f; text-align: left; cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease, color 180ms ease;
}
.practice-tab:hover:not(:disabled) { transform: translateY(-2px); border-color: rgba(99, 222, 177, .42); }
.practice-tab strong { color: #dcece6; font-size: 14px; font-weight: 760; }
.practice-tab small { display: -webkit-box; overflow: hidden; color: #718e84; font-size: 9px; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.practice-tab.is-active { border-color: rgba(99, 222, 177, .66); background: linear-gradient(145deg, rgba(42, 177, 137, .18), rgba(15, 39, 33, .84)); color: #7ff1c1; box-shadow: 0 14px 32px rgba(18, 91, 72, .18); }
.practice-tab.is-active strong { color: #b8f9dc; }
.practice-tab:disabled { cursor: not-allowed; opacity: .52; }
.mindfulness-layout { display: grid; grid-template-columns: minmax(420px, 1.18fr) minmax(340px, .82fr); gap: 20px; align-items: start; }
.breathing-card, .sound-mixer { border: 1px solid rgba(122, 190, 168, .15); border-radius: 24px; background: rgba(7, 22, 19, .78); box-shadow: 0 24px 70px rgba(0, 0, 0, .26); backdrop-filter: blur(18px); }
.breathing-card { display: grid; justify-items: center; padding: clamp(18px, 3vw, 34px); }
.breathing-orb-wrap { display: grid; width: min(440px, 72vw); aspect-ratio: 1; place-items: center; }
.breathing-orb {
  --breath-scale: 1;
  position: relative; display: grid; width: 100%; aspect-ratio: 1; place-content: center; justify-items: center; gap: 7px;
  border: 1px solid rgba(102, 231, 188, .32); border-radius: 50%;
  background:
    radial-gradient(circle at 38% 30%, rgba(166, 255, 218, .22), transparent 25%),
    radial-gradient(circle at 50% 55%, rgba(45, 193, 148, .2), transparent 58%),
    rgba(11, 45, 36, .43);
  box-shadow: 0 0 0 18px rgba(46, 209, 156, .025), 0 0 80px rgba(43, 214, 159, .14), inset 0 0 70px rgba(93, 255, 196, .08);
  transform: scale(var(--breath-scale));
  transition: transform 1050ms cubic-bezier(.4, 0, .2, 1), border-color 500ms ease, box-shadow 700ms ease;
}
.breathing-orb::before, .breathing-orb::after { position: absolute; border: 1px solid rgba(104, 236, 192, .16); border-radius: 50%; content: ""; }
.breathing-orb::before { inset: 10%; }
.breathing-orb::after { inset: 20%; border-style: dashed; opacity: .62; }
.breathing-orb.is-inhale { border-color: rgba(105, 246, 197, .7); box-shadow: 0 0 0 22px rgba(46, 209, 156, .035), 0 0 96px rgba(43, 214, 159, .23), inset 0 0 84px rgba(93, 255, 196, .14); }
.breathing-orb.is-hold-in { border-color: rgba(130, 204, 255, .66); box-shadow: 0 0 0 20px rgba(78, 149, 220, .035), 0 0 84px rgba(87, 163, 234, .2), inset 0 0 72px rgba(155, 218, 255, .1); }
.breathing-orb.is-exhale { border-color: rgba(189, 167, 255, .62); box-shadow: 0 0 0 18px rgba(135, 104, 226, .03), 0 0 82px rgba(126, 100, 226, .2), inset 0 0 72px rgba(202, 187, 255, .1); }
.breathing-orb.is-hold-out { border-color: rgba(255, 199, 127, .62); box-shadow: 0 0 0 18px rgba(230, 161, 77, .03), 0 0 82px rgba(222, 151, 76, .18), inset 0 0 72px rgba(255, 218, 170, .1); }
.breathing-orb.is-complete { border-color: rgba(99, 222, 177, .72); box-shadow: 0 0 0 22px rgba(44, 225, 140, .05), 0 0 100px rgba(44, 225, 140, .25); }
.breathing-phase { position: relative; z-index: 1; color: #8de9bf; font-size: 16px; font-weight: 750; letter-spacing: .16em; }
.breathing-timer { position: relative; z-index: 1; color: #f1fff8; font-size: clamp(42px, 7vw, 68px); font-weight: 780; letter-spacing: -.06em; line-height: 1; }
.breathing-orb > small { position: relative; z-index: 1; color: #76958a; font-size: 10px; }
.practice-guidance { max-width: 560px; min-height: 42px; margin: 22px 0 18px; color: #8aa79e; font-size: 11px; line-height: 1.75; text-align: center; }
.mindfulness-duration-group { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.duration-chip { min-height: 38px; padding: 0 16px; border: 1px solid rgba(122, 190, 168, .2); border-radius: 999px; background: rgba(13, 39, 32, .7); color: #8da9a0; font-size: 11px; font-weight: 750; transition: 180ms ease; }
.duration-chip:hover:not(:disabled), .duration-chip.is-active { border-color: rgba(99, 222, 177, .66); background: rgba(44, 225, 140, .12); color: #a9f5d3; }
.duration-chip:disabled { cursor: not-allowed; opacity: .45; }
.mindfulness-controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; margin-top: 20px; }
.mindfulness-controls .focus-start-button { width: auto; min-width: 132px; }
.mindfulness-view .focus-start-button, .mindfulness-view .secondary-button, .mindfulness-view .focus-control-button { border-color: rgba(122, 190, 168, .24); background: rgba(10, 34, 27, .78); color: #c7e6da; }
.mindfulness-view .focus-start-button, .mindfulness-view .focus-control-button.primary { border-color: rgba(99, 222, 177, .48); background: rgba(44, 225, 140, .13); color: #a8f4d2; }
.mindfulness-view .focus-start-button:hover, .mindfulness-view .secondary-button:hover, .mindfulness-view .focus-control-button:hover { border-color: rgba(99, 222, 177, .72); }
.sound-mixer { display: grid; gap: 0; overflow: hidden; }
.mixer-section { display: grid; gap: 13px; padding: 19px; border-bottom: 1px solid rgba(122, 190, 168, .12); }
.mixer-section:last-child { border-bottom: 0; }
.mixer-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mixer-heading h2 { margin: 0; color: #d8ede5; font-size: 14px; font-weight: 760; }
.mixer-heading small { color: #68877c; font-size: 9px; }
.mixer-heading button { min-height: 31px; padding: 0 10px; border: 1px solid rgba(99, 222, 177, .28); border-radius: 8px; background: rgba(44, 225, 140, .09); color: #9eecc8; font-size: 9px; }
.custom-mode-list { display: grid; gap: 7px; }
.custom-mode-empty { margin: 0; padding: 12px; border: 1px dashed rgba(122, 190, 168, .18); border-radius: 10px; color: #647f75; font-size: 10px; text-align: center; }
.custom-mode-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 8px 9px 8px 12px; border: 1px solid rgba(122, 190, 168, .15); border-radius: 10px; background: rgba(12, 34, 28, .62); }
.custom-mode-load { min-width: 0; overflow: hidden; padding: 0; background: transparent; color: #c4e3d6; font-size: 11px; font-weight: 700; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.custom-mode-actions { display: flex; gap: 5px; }
.custom-mode-actions button { padding: 4px 6px; border: 1px solid rgba(122, 190, 168, .16); border-radius: 6px; background: rgba(255, 255, 255, .025); color: #729186; font-size: 9px; }
.custom-mode-actions button:last-child { color: #e0958b; }
.sound-channel-list { display: grid; gap: 8px; }
.sound-channel-row { display: grid; gap: 7px; padding: 10px 11px; border: 1px solid rgba(122, 190, 168, .12); border-radius: 11px; background: rgba(9, 29, 24, .62); }
.sound-channel-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sound-channel-heading strong { color: #cce7dc; font-size: 11px; font-weight: 720; }
.sound-channel-heading span { color: #7fe4b8; font-size: 10px; font-variant-numeric: tabular-nums; }
.sound-channel-note, .brainwave-effect { color: #68877c; font-size: 9px; line-height: 1.45; }
.brainwave-effect { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.sound-channel-row input[type="range"], .focus-binaural-card input[type="range"] { width: 100%; height: 17px; margin: 0; accent-color: #54e8a9; cursor: pointer; }
.brainwave-disclaimer { margin: 0; color: #6e8e83; font-size: 9px; line-height: 1.55; }
.focus-binaural-card { display: grid; gap: 10px; padding: 13px; border: 1px solid var(--border); border-radius: 13px; background: var(--workspace-bg); }
.focus-binaural-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.focus-binaural-head div { display: grid; gap: 3px; }
.focus-binaural-head strong { font-size: 11px; }
.focus-binaural-head small, .focus-binaural-head span { color: var(--faint); font-size: 9px; }
.focus-binaural-card select { width: 100%; min-height: 38px; padding: 0 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--panel); color: var(--text); font-size: 10px; }
.focus-binaural-card p { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.focus-binaural-card .secondary-button { min-height: 34px; font-size: 10px; }
.mindfulness-feedback-card { width: min(560px, 100%); }
.feedback-intro { margin: 0; padding: 0 22px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.mindfulness-feedback-card .field-group { padding: 18px 22px 0; }
.mindfulness-feedback-card textarea { width: 100%; min-height: 120px; resize: vertical; padding: 11px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--workspace-bg); color: var(--text); font: inherit; font-size: 11px; line-height: 1.6; }
.mindfulness-rating { display: flex; justify-content: center; gap: 7px; padding: 24px 22px 6px; }
.mindfulness-rating button { width: 42px; height: 42px; border: 1px solid var(--border); border-radius: 10px; background: var(--workspace-bg); color: var(--faint); font-size: 22px; line-height: 1; transition: 150ms ease; }
.mindfulness-rating button:hover, .mindfulness-rating button.is-active { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); transform: translateY(-2px); }
.feedback-actions { padding: 0 22px 22px; }
@media (max-width: 1040px) {
  .mindfulness-layout { grid-template-columns: 1fr; }
  .breathing-orb-wrap { width: min(410px, 68vw); }
}
@media (max-width: 860px) {
  .mindfulness-view { padding: 24px 13px calc(34px + env(safe-area-inset-bottom)); }
  .mindfulness-header { align-items: flex-start; }
  .mindfulness-header h1 { font-size: 38px; }
  .mindfulness-header .page-intro { font-size: 11px; }
  .practice-tabs { display: flex; margin: 20px -13px 16px; padding: 0 13px 4px; overflow-x: auto; scrollbar-width: none; }
  .practice-tabs::-webkit-scrollbar { display: none; }
  .practice-tab { flex: 0 0 142px; min-height: 76px; }
  .breathing-card, .sound-mixer { border-radius: 18px; }
  .breathing-card { padding: 18px 12px; }
  .breathing-orb-wrap { width: min(330px, 80vw); }
  .breathing-timer { font-size: 48px; }
  .practice-guidance { min-height: 0; margin: 17px 0 14px; font-size: 10px; }
  .mindfulness-controls { width: 100%; }
  .mindfulness-controls .focus-start-button { min-width: 0; flex: 1; }
  .mixer-section { padding: 15px; }
  .mindfulness-feedback-card { border-radius: 18px; }
  .mindfulness-feedback-card .field-group { padding-inline: 16px; }
  .feedback-intro { padding-inline: 16px; }
  .feedback-actions { padding-inline: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .breathing-orb, .practice-tab, .mindfulness-rating button { transition: none; }
}

/* 总结中心 */
.logs-header-actions { display: flex; align-items: center; gap: 10px; }
.log-summary-entry { min-height: 38px; padding: 0 14px; border: 1px solid var(--accent-line); border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); font-size: 11px; font-weight: 760; }
.log-summary-entry:hover { border-color: var(--accent); transform: translateY(-1px); }
.summary-view { min-height: 100%; padding: clamp(24px, 4vw, 60px) clamp(14px, 4vw, 62px) calc(42px + env(safe-area-inset-bottom)); background: radial-gradient(circle at 78% 5%, rgba(44, 225, 140, .08), transparent 34%), var(--workspace-bg); }
.summary-page { width: min(1380px, 100%); margin: 0 auto; }
.summary-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; }
.summary-header h1 { margin: 0; font-size: clamp(34px, 5vw, 58px); letter-spacing: -.06em; line-height: 1; }
.summary-header-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; max-width: 650px; }
.summary-action-button { min-height: 40px; padding: 0 13px; border: 1px solid var(--accent-line); border-radius: 10px; background: var(--accent-soft); color: var(--accent-strong); font-size: 10px; font-weight: 760; }
.summary-action-button.secondary { border-color: var(--border); background: var(--panel); color: var(--muted); }
.summary-action-button:disabled { cursor: not-allowed; opacity: .42; }
.summary-action-button.ai-placeholder { border-style: dashed; color: var(--faint); background: transparent; }
.summary-controls { display: grid; grid-template-columns: 150px 150px auto minmax(220px, 1fr); align-items: end; gap: 10px; margin-top: 28px; padding: 13px; border: 1px solid var(--border); border-radius: 15px; background: rgba(255, 255, 255, .012); }
.summary-date-control { display: grid; gap: 6px; }
.summary-date-control label { color: var(--faint); font-size: 9px; }
.summary-date-control input { min-height: 38px; padding: 0 9px; border: 1px solid var(--border); border-radius: 9px; background: var(--workspace-bg); color: var(--text); font: inherit; font-size: 10px; }
.summary-quick-ranges, .summary-category-filter { display: flex; flex-wrap: wrap; gap: 6px; }
.summary-quick-ranges button, .summary-category-chip { min-height: 34px; padding: 0 11px; border: 1px solid var(--border); border-radius: 999px; background: var(--panel); color: var(--muted); font-size: 10px; font-weight: 700; }
.summary-quick-ranges button:hover, .summary-category-chip:hover, .summary-category-chip.is-active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); }
.summary-status { margin-top: 14px; padding: 11px 13px; border: 1px solid var(--accent-line); border-radius: 10px; background: var(--accent-soft); color: var(--accent-strong); font-size: 11px; }
.summary-status.is-error { border-color: rgba(255, 130, 122, .25); background: rgba(255, 130, 122, .08); color: var(--danger); }
.summary-kpi-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.summary-kpi-card { position: relative; overflow: hidden; display: grid; gap: 8px; min-height: 106px; align-content: center; padding: 15px; border: 1px solid var(--border); border-radius: 16px; background: linear-gradient(145deg, rgba(255, 255, 255, .026), transparent), var(--panel); }
.summary-kpi-card::after { position: absolute; width: 74px; height: 74px; right: -24px; bottom: -28px; border-radius: 50%; background: currentColor; opacity: .08; content: ""; }
.summary-kpi-card small { color: var(--faint); font-size: 10px; }
.summary-kpi-card strong { color: var(--text); font-size: 21px; letter-spacing: -.035em; }
.summary-kpi-card.is-focus { color: var(--accent); }
.summary-kpi-card.is-rest { color: #82a7ff; }
.summary-kpi-card.is-mindfulness { color: #c18cff; }
.summary-kpi-card.is-fragments { color: #ffbd6e; }
.summary-kpi-card.is-days { color: #6ee7e7; }
.summary-chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.summary-chart-card, .summary-detail-card { min-width: 0; border: 1px solid var(--border); border-radius: 18px; background: var(--panel); box-shadow: var(--shadow); }
.summary-chart-card { min-height: 310px; padding: 16px; }
.summary-chart-card.wide { grid-column: span 2; }
.summary-chart-card > header, .summary-detail-card > header { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.summary-chart-card h2, .summary-detail-card h2 { margin: 0; font-size: 13px; letter-spacing: -.02em; }
.summary-chart-card header small, .summary-detail-card header small { color: var(--faint); font-size: 9px; }
.summary-chart { width: 100%; height: 245px; }
.summary-calendar-chart { height: 210px; }
.summary-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.summary-detail-card { padding: 16px; }
.summary-detail-card.wide { grid-column: span 2; }
.summary-detail-list { display: grid; gap: 8px; max-height: 410px; overflow: auto; margin-top: 12px; padding-right: 3px; }
.summary-detail-block { display: grid; gap: 4px; padding: 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--workspace-bg); }
.summary-detail-block strong { color: var(--text); font-size: 11px; }
.summary-detail-block p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.summary-fragment-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin-top: 12px; }
.summary-fragment-group { display: grid; gap: 8px; min-width: 0; padding: 11px; border: 1px solid var(--border); border-radius: 11px; background: var(--workspace-bg); }
.summary-fragment-group strong { color: var(--accent); font-size: 11px; }
.summary-fragment-group div { display: grid; gap: 5px; max-height: 180px; overflow: auto; }
.summary-fragment-group span { padding: 6px 7px; border-radius: 7px; background: var(--panel); color: var(--muted); font-size: 9px; line-height: 1.5; }
@media (max-width: 1020px) {
  .summary-controls { grid-template-columns: 1fr 1fr; }
  .summary-category-filter { grid-column: span 2; }
  .summary-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .summary-fragment-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .summary-view { padding: 22px 12px calc(30px + env(safe-area-inset-bottom)); }
  .summary-header { align-items: flex-start; flex-direction: column; }
  .summary-header h1 { font-size: 38px; }
  .summary-header-actions { justify-content: flex-start; width: 100%; }
  .summary-action-button { flex: 1 1 calc(50% - 6px); }
  .summary-controls { grid-template-columns: 1fr 1fr; margin-top: 19px; }
  .summary-category-filter { grid-column: span 2; }
  .summary-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-kpi-card { min-height: 92px; }
  .summary-chart-grid, .summary-detail-grid { grid-template-columns: 1fr; }
  .summary-chart-card.wide, .summary-detail-card.wide { grid-column: auto; }
  .summary-chart-card { min-height: 280px; padding: 12px; }
  .summary-chart { height: 230px; }
  .summary-fragment-grid { grid-template-columns: 1fr; }
}

/* 驾驶舱 */
.cockpit-view { min-height: 100%; padding: clamp(22px, 3.6vw, 52px) clamp(14px, 4vw, 58px) calc(38px + env(safe-area-inset-bottom)); background: radial-gradient(circle at 78% 8%, rgba(55, 211, 255, .09), transparent 28%), radial-gradient(circle at 16% 30%, rgba(77, 255, 182, .08), transparent 32%), var(--workspace-bg); }
.cockpit-page { width: min(1440px, 100%); margin: 0 auto; }
.cockpit-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.cockpit-header h1 { margin: 0; font-size: clamp(38px, 5vw, 64px); letter-spacing: -.07em; line-height: 1; }
.cockpit-clock { padding: 9px 13px; border: 1px solid var(--accent-line); border-radius: 12px; background: rgba(26, 76, 80, .18); color: var(--accent); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 17px; letter-spacing: .12em; box-shadow: 0 0 28px rgba(68, 222, 195, .12); }
.cockpit-layout { display: grid; grid-template-columns: minmax(0, 1.42fr) minmax(310px, .72fr); gap: 14px; margin-top: 24px; align-items: start; }
.cockpit-panel { min-width: 0; border: 1px solid var(--border); border-radius: 19px; background: linear-gradient(145deg, rgba(255,255,255,.035), transparent 54%), var(--panel); box-shadow: var(--shadow); overflow: hidden; }
.cockpit-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 15px 17px; border-bottom: 1px solid var(--border); background: linear-gradient(90deg, rgba(44, 225, 140, .035), rgba(69, 186, 255, .035)); }
.cockpit-panel-head h2, .cockpit-overview h2 { margin: 4px 0 0; font-size: 18px; letter-spacing: -.035em; }
.cockpit-panel-kicker { color: var(--accent); font-size: 8px; font-weight: 800; letter-spacing: .16em; }
.cockpit-collapse, .cockpit-inspiration-actions button, .cockpit-inspiration-actions a { display: flex; min-height: 40px; align-items: center; justify-content: center; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--workspace-bg); color: var(--muted); font-size: 11px; text-decoration: none; }
.cockpit-panel-body { padding: 14px; transition: max-height 260ms ease, opacity 200ms ease, padding 260ms ease; }
.cockpit-panel.is-collapsed .cockpit-panel-body { max-height: 0; padding-top: 0; padding-bottom: 0; opacity: 0; overflow: hidden; }
.cockpit-sphere-shell { display: grid; height: 310px; place-items: center; overflow: hidden; border: 1px solid var(--border); border-radius: 15px; background: radial-gradient(circle, rgba(44, 225, 140, .09), transparent 58%), var(--workspace-bg); }
.cockpit-sphere { position: relative; display: grid; width: 230px; height: 230px; place-items: center; border: 1px solid rgba(71, 229, 181, .36); border-radius: 50%; box-shadow: 0 0 0 14px rgba(44, 225, 140, .025), 0 0 70px rgba(44, 225, 140, .12), inset 0 0 70px rgba(44, 225, 140, .08); cursor: grab; touch-action: none; }
.cockpit-sphere::before, .cockpit-sphere::after { position: absolute; inset: 18%; border: 1px solid rgba(88, 220, 190, .18); border-radius: 50%; content: ""; }
.cockpit-sphere::after { inset: 34%; border-style: dashed; }
.cockpit-core { position: absolute; width: 58px; height: 58px; border-radius: 50%; background: radial-gradient(circle, rgba(79, 244, 193, .7), rgba(44, 225, 140, .11) 56%, transparent 70%); box-shadow: 0 0 38px rgba(44, 225, 140, .4); animation: cockpit-pulse 2.8s ease-in-out infinite; }
@keyframes cockpit-pulse { 0%,100% { transform: scale(.86); opacity: .72; } 50% { transform: scale(1.16); opacity: 1; } }
#cockpit-fragment-layer { position: absolute; inset: 0; }
.cockpit-fragment { position: absolute; left: 50%; top: 50%; max-width: 132px; overflow: hidden; padding: 5px 8px; border: 1px solid var(--accent-line); border-radius: 7px; background: rgba(12, 47, 44, .84); color: var(--text); font-size: 9px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; pointer-events: none; will-change: transform, opacity; }
.cockpit-subdomains { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; }
.cockpit-subdomain-chip { min-height: 30px; padding: 0 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--workspace-bg); color: var(--muted); font-size: 9px; }
.cockpit-subdomain-chip.is-active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); }
.cockpit-quick-form { display: grid; grid-template-columns: 150px minmax(0,1fr) auto; gap: 7px; margin-top: 11px; }
.cockpit-quick-form select, .cockpit-quick-form input, .cockpit-focus-panel input[type="text"], .cockpit-binaural select, .cockpit-ai-card textarea { min-width: 0; min-height: 39px; padding: 0 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--workspace-bg); color: var(--text); font: inherit; font-size: 10px; }
.cockpit-quick-form input { min-width: 0; }
.cockpit-quick-form button, .cockpit-focus-actions button, .ai-calendar { min-height: 39px; padding: 0 12px; border: 1px solid var(--accent-line); border-radius: 9px; background: var(--accent-soft); color: var(--accent-strong); font-size: 10px; font-weight: 750; }
.cockpit-inspiration-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.cockpit-focus-panel .cockpit-panel-body { display: grid; gap: 11px; }
.cockpit-focus-ring { --focus-progress: 0%; position: relative; display: grid; width: 188px; aspect-ratio: 1; place-content: center; justify-self: center; border-radius: 50%; background: conic-gradient(var(--accent) var(--focus-progress), var(--border) 0); }
.cockpit-focus-ring::before { position: absolute; inset: 8px; border-radius: 50%; background: var(--panel); content: ""; }
.cockpit-focus-ring > * { position: relative; z-index: 1; }
.cockpit-focus-ring span, .cockpit-focus-ring small { color: var(--muted); font-size: 9px; text-align: center; }
.cockpit-focus-ring strong { margin: 5px 0; color: var(--text); font-size: 35px; letter-spacing: -.06em; text-align: center; }
.cockpit-presets { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 6px; }
.cockpit-presets button { min-height: 36px; border: 1px solid var(--border); border-radius: 8px; background: var(--workspace-bg); color: var(--muted); font-size: 9px; }
.cockpit-presets button.is-active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); }
.cockpit-focus-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.cockpit-focus-actions button { flex: 1 1 auto; min-height: 35px; }
.cockpit-binaural { display: grid; gap: 7px; padding-top: 3px; border-top: 1px solid var(--border); }
.cockpit-binaural input[type="range"] { width: 100%; accent-color: var(--accent); }
.cockpit-binaural small { color: var(--faint); font-size: 9px; }
.cockpit-overview { margin-top: 14px; padding: 17px; border: 1px solid var(--border); border-radius: 19px; background: linear-gradient(145deg, rgba(255,255,255,.03), transparent), var(--panel); box-shadow: var(--shadow); }
.cockpit-overview > header { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.cockpit-overview a { color: var(--accent); font-size: 10px; text-decoration: none; }
.cockpit-kpis { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 9px; margin-top: 14px; }
.cockpit-kpi { display: grid; gap: 5px; padding: 11px; border: 1px solid var(--border); border-radius: 11px; background: var(--workspace-bg); }
.cockpit-kpi small { color: var(--faint); font-size: 9px; }
.cockpit-kpi strong { color: var(--text); font-size: 17px; }
.cockpit-activity { display: grid; gap: 5px; max-height: 170px; margin-top: 12px; overflow: auto; }
.cockpit-activity p { margin: 0; padding: 7px 9px; border-radius: 8px; background: var(--workspace-bg); color: var(--muted); font-size: 9px; line-height: 1.5; }
.cockpit-modules { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 9px; margin-top: 14px; }
.cockpit-modules a, .cockpit-modules span { display: grid; gap: 5px; padding: 13px; border: 1px solid var(--border); border-radius: 13px; background: var(--panel); color: var(--text); text-decoration: none; }
.cockpit-modules strong { font-size: 11px; }
.cockpit-modules small { color: var(--faint); font-size: 9px; }
.cockpit-modules .is-future { opacity: .45; }
.summary-ai-card { width: min(920px, 100%); max-height: 94vh; overflow: auto; }
.summary-ai-card > .feedback-intro { padding: 0 22px; }
.summary-ai-card .field-group { padding: 14px 22px 0; }
.summary-ai-card textarea { width: 100%; resize: vertical; padding: 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--workspace-bg); color: var(--text); font: inherit; font-size: 10px; line-height: 1.6; }
.summary-ai-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 14px 22px 0; }
@media (max-width: 860px) {
  .cockpit-view { padding: 22px 12px calc(30px + env(safe-area-inset-bottom)); }
  .cockpit-header { align-items: flex-start; flex-direction: column; }
  .cockpit-header h1 { font-size: 40px; }
  .cockpit-clock { font-size: 14px; }
  .cockpit-layout { grid-template-columns: 1fr; margin-top: 18px; }
  .cockpit-panel-head { padding: 13px; }
  .cockpit-panel-body { padding: 11px; }
  .cockpit-sphere-shell { height: 260px; }
  .cockpit-focus-ring { width: 170px; }
  .cockpit-quick-form { grid-template-columns: 1fr; }
  .cockpit-kpis, .cockpit-modules { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .summary-ai-card { width: 100%; }
  .summary-ai-card .field-group, .summary-ai-actions { padding-inline: 15px; }
  .summary-ai-card > .feedback-intro { padding-inline: 15px; }
}

/* 回蓝舱雾蓝浅色主题 */
html[data-theme="light"] .mindfulness-view {
  background:
    radial-gradient(circle at 20% 12%, rgba(116, 198, 210, .22), transparent 34%),
    radial-gradient(circle at 82% 62%, rgba(143, 177, 221, .18), transparent 38%),
    linear-gradient(145deg, #edf5f7 0%, #e7f0f3 48%, #edf4f5 100%);
  color: #203638;
  color-scheme: light;
}
html[data-theme="light"] .mindfulness-header h1 { color: #1d3538; }
html[data-theme="light"] .mindfulness-header .section-kicker { color: #3f8d99; }
html[data-theme="light"] .mindfulness-header .page-intro { color: #627c80; }
html[data-theme="light"] .mindfulness-view .focus-sync-status { border-color: rgba(64, 139, 150, .25); background: rgba(255, 255, 255, .58); color: #527279; }
html[data-theme="light"] .mindfulness-view .focus-sync-status.is-online { color: #277f89; }
html[data-theme="light"] .practice-tab { border-color: rgba(101, 153, 165, .22); background: rgba(255, 255, 255, .66); color: #647d81; box-shadow: 0 8px 24px rgba(86, 124, 133, .06); }
html[data-theme="light"] .practice-tab strong { color: #244247; }
html[data-theme="light"] .practice-tab small { color: #718b8f; }
html[data-theme="light"] .practice-tab:hover:not(:disabled) { border-color: rgba(65, 149, 160, .48); }
html[data-theme="light"] .practice-tab.is-active { border-color: rgba(56, 150, 162, .65); background: linear-gradient(145deg, rgba(156, 220, 225, .45), rgba(255, 255, 255, .84)); color: #277e89; box-shadow: 0 12px 28px rgba(63, 137, 149, .12); }
html[data-theme="light"] .practice-tab.is-active strong { color: #216c77; }
html[data-theme="light"] .breathing-card,
html[data-theme="light"] .sound-mixer { border-color: rgba(100, 151, 164, .22); background: rgba(255, 255, 255, .76); box-shadow: 0 20px 52px rgba(81, 119, 130, .12); }
html[data-theme="light"] .breathing-orb { border-color: rgba(62, 157, 170, .45); background: radial-gradient(circle at 38% 30%, rgba(255, 255, 255, .9), transparent 27%), radial-gradient(circle at 50% 55%, rgba(132, 211, 218, .42), transparent 58%), rgba(225, 243, 245, .84); box-shadow: 0 0 0 18px rgba(91, 182, 194, .05), 0 0 68px rgba(101, 190, 201, .2), inset 0 0 60px rgba(255, 255, 255, .65); }
html[data-theme="light"] .breathing-orb::before,
html[data-theme="light"] .breathing-orb::after { border-color: rgba(72, 154, 166, .25); }
html[data-theme="light"] .breathing-phase { color: #30838d; }
html[data-theme="light"] .breathing-timer { color: #1f3b40; }
html[data-theme="light"] .breathing-orb > small { color: #5d777b; }
html[data-theme="light"] .practice-guidance { color: #607c82; }
html[data-theme="light"] .duration-chip { border-color: rgba(99, 155, 167, .24); background: rgba(255, 255, 255, .66); color: #5d797f; }
html[data-theme="light"] .duration-chip:hover:not(:disabled),
html[data-theme="light"] .duration-chip.is-active { border-color: rgba(54, 145, 157, .6); background: rgba(143, 214, 220, .25); color: #24757f; }
html[data-theme="light"] .mindfulness-view .focus-start-button,
html[data-theme="light"] .mindfulness-view .secondary-button,
html[data-theme="light"] .mindfulness-view .focus-control-button { border-color: rgba(86, 150, 163, .28); background: rgba(255, 255, 255, .72); color: #3d6870; }
html[data-theme="light"] .mindfulness-view .focus-start-button,
html[data-theme="light"] .mindfulness-view .focus-control-button.primary { border-color: rgba(54, 145, 157, .5); background: rgba(143, 214, 220, .3); color: #24757f; }
html[data-theme="light"] .mixer-section { border-bottom-color: rgba(100, 151, 164, .18); }
html[data-theme="light"] .mixer-heading h2 { color: #244247; }
html[data-theme="light"] .mixer-heading small { color: #71898d; }
html[data-theme="light"] .mixer-heading button { border-color: rgba(56, 144, 156, .28); background: rgba(143, 214, 220, .2); color: #277782; }
html[data-theme="light"] .custom-mode-empty { border-color: rgba(101, 155, 166, .24); color: #6e898e; }
html[data-theme="light"] .custom-mode-card,
html[data-theme="light"] .sound-channel-row { border-color: rgba(100, 151, 164, .2); background: rgba(255, 255, 255, .58); }
html[data-theme="light"] .custom-mode-load,
html[data-theme="light"] .sound-channel-heading strong { color: #294a50; }
html[data-theme="light"] .sound-channel-heading span { color: #2d8490; }
html[data-theme="light"] .sound-channel-note,
html[data-theme="light"] .brainwave-effect,
html[data-theme="light"] .brainwave-disclaimer { color: #6c858b; }
html[data-theme="light"] .custom-mode-actions button { border-color: rgba(101, 155, 166, .22); background: rgba(255, 255, 255, .62); color: #668187; }
html[data-theme="light"] .custom-mode-actions button:last-child { color: #a4514d; }
html[data-theme="light"] .breathing-orb.is-inhale { border-color: rgba(47, 161, 164, .68); box-shadow: 0 0 0 22px rgba(87, 190, 195, .06), 0 0 82px rgba(70, 179, 186, .24), inset 0 0 70px rgba(255, 255, 255, .7); }
html[data-theme="light"] .breathing-orb.is-hold-in { border-color: rgba(72, 133, 205, .6); box-shadow: 0 0 0 20px rgba(105, 155, 212, .05), 0 0 78px rgba(92, 142, 204, .2), inset 0 0 70px rgba(255, 255, 255, .7); }
html[data-theme="light"] .breathing-orb.is-exhale { border-color: rgba(137, 119, 196, .58); box-shadow: 0 0 0 18px rgba(151, 132, 205, .05), 0 0 76px rgba(137, 119, 196, .19), inset 0 0 70px rgba(255, 255, 255, .7); }
html[data-theme="light"] .breathing-orb.is-hold-out { border-color: rgba(198, 145, 83, .56); box-shadow: 0 0 0 18px rgba(210, 162, 101, .05), 0 0 76px rgba(198, 145, 83, .17), inset 0 0 70px rgba(255, 255, 255, .7); }

/* 桌面侧栏折叠 */
.app-shell { --sidebar-width: 272px; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); transition: grid-template-columns 210ms ease; }
.app-shell.sidebar-collapsed { --sidebar-width: 76px; }
.sidebar-collapse { display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; border: 1px solid var(--border); border-radius: 10px; background: var(--workspace-bg); color: var(--muted); }
.sidebar-collapse:hover { border-color: var(--accent); color: var(--accent); }
.sidebar-collapse svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.app-shell.sidebar-collapsed .sidebar { padding-inline: 10px; }
.app-shell.sidebar-collapsed .sidebar-top { justify-content: center; }
.app-shell.sidebar-collapsed .brand { justify-content: center; }
.app-shell.sidebar-collapsed .brand-copy,
.app-shell.sidebar-collapsed .nav-text,
.app-shell.sidebar-collapsed .nav-arrow,
.app-shell.sidebar-collapsed .future-nav,
.app-shell.sidebar-collapsed .theme-copy,
.app-shell.sidebar-collapsed #server-status-text,
.app-shell.sidebar-collapsed .api-nav-status { display: none !important; }
.app-shell.sidebar-collapsed .sidebar-close { display: none; }
.app-shell.sidebar-collapsed .primary-nav,
.app-shell.sidebar-collapsed .utility-nav { align-items: center; }
.app-shell.sidebar-collapsed .nav-item { width: 48px; min-height: 46px; justify-content: center; padding: 0; }
.app-shell.sidebar-collapsed .nav-icon { margin: 0; }
.app-shell.sidebar-collapsed .sidebar-footer { align-items: center; }
.app-shell.sidebar-collapsed .theme-toggle { width: 48px; min-height: 48px; justify-content: center; padding: 0; }
.app-shell.sidebar-collapsed .theme-indicator { position: absolute; top: 5px; right: 5px; }
.app-shell.sidebar-collapsed .server-status { width: 34px; height: 34px; justify-content: center; padding: 0; }
.app-shell.sidebar-collapsed .server-status::after { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); content: ""; }
.app-shell.sidebar-collapsed .server-status.is-online::after { background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.app-shell.sidebar-collapsed .nav-item:hover::after { position: absolute; left: calc(100% + 9px); z-index: 60; padding: 6px 8px; border: 1px solid var(--border); border-radius: 7px; background: var(--panel); color: var(--text); box-shadow: var(--shadow); content: attr(title); font-size: 10px; white-space: nowrap; }
@media (max-width: 860px) {
  .app-shell, .app-shell.sidebar-collapsed { --sidebar-width: 272px; grid-template-columns: minmax(0, 1fr); }
  .sidebar-collapse { display: none; }
  .app-shell.sidebar-collapsed .sidebar-close { display: grid; }
  .app-shell.sidebar-collapsed .sidebar { padding-inline: 16px; }
  .app-shell.sidebar-collapsed .brand-copy,
  .app-shell.sidebar-collapsed .nav-text,
  .app-shell.sidebar-collapsed .nav-arrow,
  .app-shell.sidebar-collapsed .future-nav,
  .app-shell.sidebar-collapsed .theme-copy,
  .app-shell.sidebar-collapsed #server-status-text { display: initial !important; }
}

/* 驾驶舱交互与尺寸优化 */
#cockpit-fragment-layer { pointer-events: none; }
.cockpit-sphere.is-dragging { cursor: grabbing; }
.cockpit-sphere { user-select: none; }
.cockpit-layout { grid-template-columns: minmax(0, 2fr) minmax(360px, 1fr); gap: 18px; }
.cockpit-panel-head { padding: 19px 21px; }
.cockpit-panel-head h2 { font-size: 22px; }
.cockpit-panel-kicker { font-size: 10px; }
.cockpit-panel-body { padding: 18px; }
.cockpit-sphere-shell { height: 390px; }
.cockpit-sphere { width: 320px; height: 320px; }
.cockpit-core { width: 76px; height: 76px; }
.cockpit-fragment { max-width: 150px; padding: 6px 9px; border-radius: 9px; font-size: 10px; }
.cockpit-subdomains { gap: 8px; margin-top: 14px; }
.cockpit-subdomain-chip { min-height: 35px; padding: 0 13px; font-size: 11px; }
.cockpit-quick-form { grid-template-columns: 185px minmax(0,1fr) auto; gap: 9px; margin-top: 14px; }
.cockpit-quick-form select, .cockpit-quick-form input, .cockpit-focus-panel input[type="text"], .cockpit-binaural select { min-height: 45px; padding: 0 13px; border-radius: 11px; font-size: 12px; }
.cockpit-quick-form button, .cockpit-focus-actions button, .cockpit-inspiration-actions button, .cockpit-inspiration-actions a { min-height: 43px; padding: 0 15px; border-radius: 10px; font-size: 11px; }
.cockpit-focus-panel .cockpit-panel-body { gap: 15px; }
.cockpit-focus-ring { width: 232px; }
.cockpit-focus-ring strong { font-size: 43px; }
.cockpit-focus-ring span, .cockpit-focus-ring small { font-size: 11px; }
.cockpit-presets { gap: 8px; }
.cockpit-presets button { min-height: 42px; border-radius: 10px; font-size: 11px; }
.cockpit-focus-actions { gap: 8px; }
.cockpit-focus-actions button { min-height: 42px; }
.cockpit-binaural small { font-size: 11px; }
.cockpit-overview { margin-top: 18px; padding: 21px; }
.cockpit-overview h2 { font-size: 23px; }
.cockpit-kpis { gap: 12px; margin-top: 17px; }
.cockpit-kpi { padding: 15px; }
.cockpit-kpi small { font-size: 11px; }
.cockpit-kpi strong { font-size: 21px; }
.cockpit-activity p { padding: 9px 11px; font-size: 11px; }
.cockpit-modules { gap: 12px; margin-top: 18px; }
.cockpit-modules a, .cockpit-modules span { padding: 17px; border-radius: 15px; }
.cockpit-modules strong { font-size: 13px; }
.cockpit-modules small { font-size: 10px; }
@media (max-width: 1180px) {
  .cockpit-layout { grid-template-columns: minmax(0, 1.7fr) minmax(330px, 1fr); }
  .cockpit-sphere { width: 290px; height: 290px; }
}
@media (max-width: 860px) {
  .cockpit-layout { grid-template-columns: 1fr; }
  .cockpit-sphere-shell { height: 300px; }
  .cockpit-sphere { width: 270px; height: 270px; }
  .cockpit-focus-ring { width: 200px; }
  .cockpit-panel-head { padding: 16px; }
  .cockpit-panel-body { padding: 14px; }
  .cockpit-quick-form { grid-template-columns: 1fr; }
}

.cockpit-binaural-effect { margin: 0; padding: 9px 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--workspace-bg); color: var(--muted); font-size: 10px; line-height: 1.55; }

.cockpit-sphere-shell { position: relative; }
.cockpit-fragment { transform-origin: center; }
.app-shell.sidebar-collapsed .primary-nav, .app-shell.sidebar-collapsed .utility-nav { gap: 6px; }
.app-shell.sidebar-collapsed .nav-item { grid-template-columns: 30px; }
.app-shell.sidebar-collapsed .nav-icon { justify-self: center; }


/* Cockpit v31 redesign */
.cockpit-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; margin-top: 28px; }
.cockpit-inspiration-panel,
.cockpit-focus-panel { border-radius: 23px; }
.cockpit-panel-head-actions { display: flex; align-items: center; gap: 8px; }
.cockpit-tool-toggle {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--accent-line);
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}
.cockpit-tool-toggle:hover { transform: translateY(-1px); background: var(--accent-soft); border-color: var(--accent); }
.cockpit-tool-toggle[aria-expanded="true"] { background: var(--accent); color: var(--panel); }
.cockpit-tool-toggle svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.cockpit-headline-shell {
  position: relative;
  display: grid;
  min-height: 174px;
  place-items: center;
  align-content: center;
  gap: 6px;
  overflow: hidden;
  padding: clamp(18px, 2.6vw, 34px);
  border: 1px solid var(--border);
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 120%, rgba(44, 225, 140, .1), transparent 54%),
    linear-gradient(120deg, rgba(44, 225, 140, .025), transparent 62%),
    var(--workspace-bg);
}
.cockpit-headline-shell::before,
.cockpit-headline-shell::after {
  position: absolute;
  width: 180px;
  height: 180px;
  border: 1px solid var(--accent-line);
  border-radius: 50%;
  content: "";
  opacity: .35;
  pointer-events: none;
}
.cockpit-headline-shell::before { left: -72px; top: -92px; }
.cockpit-headline-shell::after { right: -58px; bottom: -108px; }
.cockpit-headline-label {
  position: relative;
  z-index: 1;
  color: var(--accent);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .22em;
}
.cockpit-headline {
  position: relative;
  z-index: 1;
  display: -webkit-box;
  max-width: min(1040px, 94%);
  min-height: 1.25em;
  margin: 2px 0 0;
  overflow: hidden;
  color: var(--text);
  font-size: clamp(34px, 4.7vw, 74px);
  font-weight: 850;
  letter-spacing: -.065em;
  line-height: 1.14;
  text-align: center;
  text-wrap: balance;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  text-shadow: 0 12px 42px rgba(44, 225, 140, .11);
  transition: opacity 320ms ease, transform 320ms ease, filter 320ms ease;
}
.cockpit-headline.is-fading { opacity: 0; filter: blur(5px); transform: translateY(10px) scale(.985); }
.cockpit-sphere-shell {
  height: clamp(430px, 48vw, 530px);
  margin-top: 16px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 48%, rgba(44, 225, 140, .1), transparent 48%),
    radial-gradient(circle at 50% 50%, transparent 0 23%, rgba(44, 225, 140, .045) 24%, transparent 25%, transparent 37%, rgba(44, 225, 140, .035) 38%, transparent 39%),
    var(--workspace-bg);
  perspective: 1000px;
}
.cockpit-sphere {
  width: clamp(330px, 34vw, 440px);
  height: clamp(330px, 34vw, 440px);
  border-color: var(--accent-line);
  box-shadow:
    0 0 0 16px rgba(44, 225, 140, .025),
    0 0 80px rgba(44, 225, 140, .14),
    inset 0 0 100px rgba(44, 225, 140, .08);
}
.cockpit-sphere::before { inset: 15%; border-color: var(--accent-line); }
.cockpit-sphere::after { inset: 31%; border-color: var(--accent-line); }
.cockpit-core {
  width: clamp(112px, 11vw, 148px);
  height: clamp(112px, 11vw, 148px);
  border-color: var(--accent-line);
  background:
    radial-gradient(circle at 34% 28%, rgba(184, 255, 219, .35), transparent 34%),
    radial-gradient(circle at 50% 60%, rgba(29, 126, 87, .74), transparent 69%),
    var(--panel-raised);
  box-shadow:
    0 0 38px rgba(44, 225, 140, .28),
    0 0 96px rgba(44, 225, 140, .13),
    inset 0 0 42px rgba(44, 225, 140, .14);
}
.cockpit-core::before,
.cockpit-core::after {
  position: absolute;
  inset: -26%;
  border: 1px solid var(--accent-line);
  border-radius: 50%;
  content: "";
  opacity: .48;
  pointer-events: none;
}
.cockpit-core::before { transform: rotateX(67deg) rotateZ(18deg); animation: cockpit-ring-spin 16s linear infinite; }
.cockpit-core::after { inset: -42%; border-style: dashed; opacity: .25; animation: cockpit-ring-spin-reverse 22s linear infinite; }
@keyframes cockpit-ring-spin { to { transform: rotateX(67deg) rotateZ(378deg); } }
@keyframes cockpit-ring-spin-reverse { to { transform: rotateY(66deg) rotateZ(-360deg); } }
#cockpit-fragment-layer { pointer-events: none; }
.cockpit-fragment {
  max-width: 190px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-size: clamp(11px, 1vw, 13px);
  font-weight: 650;
  line-height: 1.3;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .16);
  transform-origin: center;
  will-change: transform, opacity;
  transition: color 120ms linear, border-color 120ms linear, background-color 120ms linear, box-shadow 120ms linear;
}
.cockpit-fragment.is-front {
  border-color: var(--accent-line);
  background: var(--panel-raised);
  color: var(--text);
  box-shadow: 0 0 0 1px rgba(44, 225, 140, .04), 0 12px 34px rgba(0, 0, 0, .22);
}
.cockpit-fragment.is-foreground {
  border-color: var(--accent);
  color: var(--accent-strong);
  text-shadow: 0 0 16px rgba(44, 225, 140, .3);
}
.cockpit-subdomains { gap: 8px; margin-top: 15px; }
.cockpit-subdomain-chip { min-height: 36px; padding: 0 14px; font-size: 11px; }
.cockpit-tool-drawer {
  max-height: 0;
  margin-top: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-7px);
  transition: max-height 260ms ease, margin-top 260ms ease, opacity 180ms ease, transform 260ms ease;
}
.cockpit-tool-drawer.is-open { max-height: 420px; margin-top: 15px; opacity: 1; pointer-events: auto; transform: translateY(0); }
.cockpit-quick-form { grid-template-columns: minmax(180px, .28fr) minmax(0, 1fr) auto; gap: 10px; margin-top: 0; }
.cockpit-quick-form select,
.cockpit-quick-form input,
.cockpit-focus-panel input[type="text"],
.cockpit-binaural select { min-height: 49px; padding: 0 14px; border-radius: 12px; font-size: 12px; }
.cockpit-quick-form button,
.cockpit-inspiration-actions button,
.cockpit-inspiration-actions a,
.cockpit-focus-actions button { min-height: 47px; padding: 0 16px; border-radius: 11px; font-size: 12px; }
.cockpit-inspiration-actions { margin-top: 10px; }
.cockpit-focus-panel .cockpit-panel-body { display: block; padding: clamp(20px, 2.8vw, 34px); }
.cockpit-focus-main {
  display: grid;
  grid-template-columns: minmax(260px, .38fr) minmax(0, .62fr);
  align-items: center;
  gap: clamp(28px, 5vw, 78px);
}
.cockpit-focus-timer { display: grid; place-items: center; }
.cockpit-focus-controls { display: grid; gap: 16px; min-width: 0; }
.cockpit-focus-ring { width: clamp(250px, 22vw, 310px); }
.cockpit-focus-ring::before { inset: 10px; background: var(--panel); }
.cockpit-focus-ring span,
.cockpit-focus-ring small { font-size: 12px; }
.cockpit-focus-ring strong { margin: 7px 0; font-size: clamp(48px, 5.2vw, 70px); }
.cockpit-presets { gap: 9px; }
.cockpit-presets button { min-height: 46px; border-radius: 11px; font-size: 12px; }
.cockpit-focus-actions { gap: 9px; }
.cockpit-focus-actions button { min-height: 46px; }
.cockpit-binaural { gap: 9px; padding-top: 5px; }
.cockpit-binaural-effect { padding: 11px 12px; font-size: 11px; }
.cockpit-binaural small { font-size: 11px; }

html[data-theme="light"] .cockpit-view {
  background:
    radial-gradient(circle at 80% 6%, rgba(199, 103, 77, .12), transparent 27%),
    radial-gradient(circle at 12% 34%, rgba(105, 185, 156, .11), transparent 31%),
    var(--workspace-bg);
}
html[data-theme="light"] .cockpit-clock {
  border-color: var(--border-strong);
  background: rgba(255, 253, 251, .88);
  color: var(--accent-strong);
  box-shadow: 0 12px 32px rgba(128, 86, 70, .12);
}
html[data-theme="light"] .cockpit-panel,
html[data-theme="light"] .cockpit-overview {
  background: linear-gradient(145deg, rgba(255, 255, 255, .72), transparent 60%), var(--panel);
  box-shadow: 0 18px 50px rgba(128, 86, 70, .11);
}
html[data-theme="light"] .cockpit-panel-head {
  background: linear-gradient(90deg, rgba(199, 103, 77, .07), rgba(105, 185, 156, .065));
}
html[data-theme="light"] .cockpit-tool-toggle { background: rgba(199, 103, 77, .09); color: var(--accent-strong); }
html[data-theme="light"] .cockpit-tool-toggle[aria-expanded="true"] { background: var(--accent); color: #fffaf7; }
html[data-theme="light"] .cockpit-headline-shell {
  background:
    radial-gradient(circle at 50% 120%, rgba(105, 185, 156, .18), transparent 56%),
    linear-gradient(120deg, rgba(199, 103, 77, .055), transparent 62%),
    var(--panel);
}
html[data-theme="light"] .cockpit-headline { text-shadow: 0 12px 36px rgba(105, 185, 156, .15); }
html[data-theme="light"] .cockpit-sphere-shell {
  background:
    radial-gradient(circle at 50% 48%, rgba(105, 185, 156, .18), transparent 50%),
    radial-gradient(circle at 50% 50%, transparent 0 23%, rgba(105, 185, 156, .09) 24%, transparent 25%, transparent 37%, rgba(199, 103, 77, .07) 38%, transparent 39%),
    var(--panel);
}
html[data-theme="light"] .cockpit-sphere {
  border-color: rgba(105, 169, 145, .58);
  box-shadow: 0 0 0 16px rgba(105, 185, 156, .055), 0 0 80px rgba(105, 185, 156, .17), inset 0 0 100px rgba(105, 185, 156, .12);
}
html[data-theme="light"] .cockpit-core {
  border-color: rgba(105, 169, 145, .55);
  background: radial-gradient(circle at 34% 28%, rgba(255, 255, 255, .96), transparent 36%), radial-gradient(circle at 50% 60%, rgba(158, 218, 197, .78), transparent 69%), var(--panel-raised);
  box-shadow: 0 0 38px rgba(105, 185, 156, .25), 0 0 96px rgba(105, 185, 156, .16), inset 0 0 42px rgba(105, 185, 156, .16);
}
html[data-theme="light"] .cockpit-fragment {
  background: rgba(255, 253, 251, .96);
  color: var(--muted);
  box-shadow: 0 10px 28px rgba(128, 86, 70, .11);
}
html[data-theme="light"] .cockpit-fragment.is-front { border-color: rgba(105, 169, 145, .56); background: #F7E4DA; color: var(--text); }
html[data-theme="light"] .cockpit-fragment.is-foreground { border-color: #79AE9B; color: #285F52; text-shadow: 0 0 14px rgba(105, 185, 156, .25); }

@media (max-width: 1180px) {
  .cockpit-sphere { width: clamp(300px, 38vw, 390px); height: clamp(300px, 38vw, 390px); }
  .cockpit-focus-main { grid-template-columns: minmax(240px, .42fr) minmax(0, .58fr); gap: 32px; }
}
@media (max-width: 860px) {
  .cockpit-layout { gap: 16px; margin-top: 20px; }
  .cockpit-panel-head { padding: 14px; }
  .cockpit-panel-head-actions { gap: 6px; }
  .cockpit-tool-toggle { width: 42px; height: 42px; }
  .cockpit-headline-shell { min-height: 122px; padding: 17px 14px; border-radius: 15px; }
  .cockpit-headline { max-width: 96%; font-size: clamp(27px, 8.3vw, 44px); }
  .cockpit-sphere-shell { height: 360px; margin-top: 12px; border-radius: 15px; }
  .cockpit-sphere { width: min(292px, 78vw); height: min(292px, 78vw); }
  .cockpit-core { width: 104px; height: 104px; }
  .cockpit-fragment { max-width: 142px; padding: 7px 10px; font-size: 10px; }
  .cockpit-tool-drawer.is-open { max-height: 680px; margin-top: 12px; }
  .cockpit-quick-form { grid-template-columns: 1fr; }
  .cockpit-focus-panel .cockpit-panel-body { padding: 17px 14px 20px; }
  .cockpit-focus-main { grid-template-columns: 1fr; gap: 22px; }
  .cockpit-focus-ring { width: min(232px, 68vw); }
  .cockpit-focus-ring strong { font-size: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .cockpit-headline,
  .cockpit-tool-toggle,
  .cockpit-tool-drawer,
  .cockpit-fragment { transition: none; }
  .cockpit-core,
  .cockpit-core::before,
  .cockpit-core::after { animation: none; }
}

@media (max-width: 1180px) and (min-width: 861px) {
  .cockpit-focus-main { grid-template-columns: minmax(230px, .9fr) minmax(280px, 1.1fr); gap: 24px; }
}


/* Cockpit header and comment refinements */
.cockpit-header { display: block; }
.cockpit-title-row {
  display: grid;
  grid-template-columns: minmax(80px, 1fr) auto minmax(80px, 1fr);
  align-items: center;
  gap: clamp(16px, 3vw, 44px);
  width: min(1080px, 100%);
  margin: 0 auto;
}
.cockpit-title-block { min-width: 0; text-align: center; }
.cockpit-title-block h1 {
  margin: 0;
  background: linear-gradient(135deg, var(--text) 8%, var(--accent-strong) 55%, var(--text) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(50px, 5.8vw, 78px);
  font-weight: 700;
  letter-spacing: -.055em;
  line-height: .98;
  text-shadow: 0 12px 40px rgba(44, 225, 140, .08);
}
.cockpit-title-decoration {
  position: relative;
  display: block;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-line) 38%, var(--accent));
  box-shadow: 0 0 14px rgba(44, 225, 140, .2);
}
.cockpit-title-decoration:last-child { transform: scaleX(-1); }
.cockpit-title-decoration::after {
  position: absolute;
  top: 50%;
  right: -2px;
  width: 8px;
  height: 8px;
  border: 1px solid var(--accent);
  background: var(--workspace-bg);
  content: "";
  transform: translateY(-50%) rotate(45deg);
  box-shadow: 0 0 12px var(--accent-soft);
}
.cockpit-clock {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 15px auto 0;
  padding: 9px 16px;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  background: rgba(26, 76, 80, .18);
  color: var(--accent);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  letter-spacing: .045em;
  box-shadow: 0 0 28px rgba(68, 222, 195, .1);
}
.cockpit-lunar { margin-top: 8px; color: var(--muted); font-size: 13px; letter-spacing: .13em; }
.cockpit-almanac {
  width: min(820px, 100%);
  margin: 20px auto 0;
  padding: 14px 16px 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255,255,255,.035), transparent 58%), var(--panel);
  box-shadow: var(--shadow);
}
.cockpit-almanac-head { display: flex; align-items: baseline; justify-content: center; gap: 10px; margin-bottom: 11px; }
.cockpit-almanac-head span { color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .16em; }
.cockpit-almanac-head small { color: var(--faint); font-size: 10px; letter-spacing: .06em; }
.cockpit-almanac-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; overflow: hidden; border: 1px solid var(--border); border-radius: 12px; background: var(--border); }
.cockpit-almanac-item { display: grid; grid-template-columns: 38px minmax(0, 1fr); align-items: center; gap: 11px; padding: 12px 15px; background: var(--workspace-bg); text-align: left; }
.cockpit-almanac-item > span { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; font-size: 13px; font-weight: 850; }
.cockpit-almanac-item.is-yi > span { background: rgba(44, 225, 140, .13); color: var(--accent-strong); }
.cockpit-almanac-item.is-ji > span { background: rgba(199, 103, 77, .14); color: #D66A50; }
.cockpit-almanac-item p { margin: 0; color: var(--text); font-size: 12px; font-weight: 650; letter-spacing: .035em; line-height: 1.65; }
.cockpit-inspiration-panel .cockpit-panel-head { min-height: 50px; padding: 8px 14px; }
.cockpit-inspiration-panel .cockpit-panel-head h2 { margin: 0; font-size: 18px; letter-spacing: -.025em; }
.cockpit-inspiration-panel .cockpit-collapse { min-height: 34px; padding: 0 11px; font-size: 10px; }
.cockpit-headline-shell { min-height: 112px; padding: 13px 18px; }
.cockpit-headline {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(34px, 4vw, 62px);
  font-weight: 650;
  letter-spacing: -.035em;
  line-height: 1.08;
}
.cockpit-subdomain-row { display: flex; align-items: center; gap: 12px; margin-top: 15px; }
.cockpit-subdomain-row .cockpit-subdomains { flex: 1 1 auto; min-width: 0; margin-top: 0; }
.cockpit-subdomain-row .cockpit-tool-toggle { flex: 0 0 auto; margin-left: auto; }
.cockpit-overview > header h2 { font-size: 30px; font-weight: 820; letter-spacing: -.045em; }
.cockpit-kpi small { color: var(--muted); font-size: 14px; font-weight: 750; letter-spacing: .02em; }
.cockpit-kpi strong { font-size: 28px; letter-spacing: -.035em; }
.cockpit-activity p { padding: 11px 14px; font-size: 13.5px; line-height: 1.7; }

html[data-theme="light"] .cockpit-title-block h1 {
  background: linear-gradient(135deg, #33251F 12%, #9F4B37 52%, #33251F 100%);
  -webkit-background-clip: text;
  background-clip: text;
}
html[data-theme="light"] .cockpit-clock { border-color: var(--border-strong); background: rgba(255, 253, 251, .9); color: var(--accent-strong); box-shadow: 0 10px 30px rgba(128, 86, 70, .1); }
html[data-theme="light"] .cockpit-almanac { background: linear-gradient(145deg, rgba(255,255,255,.72), transparent 58%), var(--panel); box-shadow: 0 18px 45px rgba(128, 86, 70, .1); }
html[data-theme="light"] .cockpit-almanac-item { background: rgba(255, 253, 251, .82); }
html[data-theme="light"] .cockpit-almanac-item.is-yi > span { background: rgba(105, 185, 156, .16); color: #2F7462; }
html[data-theme="light"] .cockpit-almanac-item.is-ji > span { background: rgba(199, 103, 77, .13); color: var(--accent-strong); }

@media (max-width: 860px) {
  .cockpit-title-row { grid-template-columns: 24px minmax(0, 1fr) 24px; gap: 8px; }
  .cockpit-title-block h1 { font-size: clamp(42px, 12vw, 56px); }
  .cockpit-clock { margin-top: 11px; padding: 8px 10px; font-size: 12px; letter-spacing: .02em; }
  .cockpit-lunar { margin-top: 7px; font-size: 11px; letter-spacing: .08em; }
  .cockpit-almanac { margin-top: 14px; padding: 10px; border-radius: 15px; }
  .cockpit-almanac-head { justify-content: flex-start; margin-bottom: 8px; }
  .cockpit-almanac-grid { grid-template-columns: 1fr; }
  .cockpit-almanac-item { padding: 9px 10px; }
  .cockpit-almanac-item p { font-size: 11px; }
  .cockpit-inspiration-panel .cockpit-panel-head { min-height: 45px; padding: 7px 10px; }
  .cockpit-inspiration-panel .cockpit-panel-head h2 { font-size: 17px; }
  .cockpit-headline-shell { min-height: 92px; padding: 11px 12px; }
  .cockpit-headline { font-size: clamp(28px, 8.4vw, 42px); letter-spacing: -.03em; }
  .cockpit-subdomain-row { align-items: flex-start; gap: 8px; }
  .cockpit-subdomain-row .cockpit-tool-toggle { width: 40px; height: 40px; }
  .cockpit-overview > header h2 { font-size: 25px; }
  .cockpit-kpi small { font-size: 12px; }
  .cockpit-kpi strong { font-size: 23px; }
  .cockpit-activity p { font-size: 12.5px; line-height: 1.65; }
}

.cockpit-activity p { font-size: 15px; }
@media (max-width: 860px) { .cockpit-activity p { font-size: 13.5px; } }

.cockpit-headline {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", sans-serif;
  font-weight: 600;
  letter-spacing: -.04em;
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
}

/* Final cockpit feedback round */
.cockpit-title-block h1 { font-size: clamp(38px, 4.4vw, 56px); }
.cockpit-almanac-head { margin-bottom: 13px; }
.cockpit-almanac-head span { font-size: 16px; letter-spacing: .14em; }
.cockpit-almanac-head small { font-size: 12px; }
.cockpit-almanac-item { grid-template-columns: 42px minmax(0, 1fr); gap: 12px; padding: 14px 17px; }
.cockpit-almanac-item > span { width: 38px; height: 38px; font-size: 15px; }
.cockpit-almanac-item p { font-size: 14px; line-height: 1.72; }

.cockpit-subdomain-chip[data-tone="0"] { --chip-hue: 154; }
.cockpit-subdomain-chip[data-tone="1"] { --chip-hue: 190; }
.cockpit-subdomain-chip[data-tone="2"] { --chip-hue: 34; }
.cockpit-subdomain-chip[data-tone="3"] { --chip-hue: 345; }
.cockpit-subdomain-chip[data-tone="4"] { --chip-hue: 272; }
.cockpit-subdomain-chip[data-tone="5"] { --chip-hue: 214; }
.cockpit-subdomain-chip {
  border-color: hsla(var(--chip-hue), 62%, 50%, .5);
  background: hsla(var(--chip-hue), 48%, 17%, .88);
  color: hsla(var(--chip-hue), 88%, 78%, 1);
  font-weight: 760;
  letter-spacing: .015em;
  box-shadow: inset 0 0 0 1px hsla(var(--chip-hue), 70%, 55%, .08);
}
.cockpit-subdomain-chip.is-active {
  border-color: hsla(var(--chip-hue), 82%, 65%, .95);
  background: hsla(var(--chip-hue), 68%, 25%, .95);
  color: hsla(var(--chip-hue), 100%, 88%, 1);
  box-shadow: 0 0 16px hsla(var(--chip-hue), 78%, 55%, .26), inset 0 0 0 1px hsla(var(--chip-hue), 95%, 75%, .14);
}
html[data-theme="light"] .cockpit-subdomain-chip {
  border-color: hsla(var(--chip-hue), 58%, 66%, .72);
  background: hsla(var(--chip-hue), 68%, 95%, 1);
  color: hsla(var(--chip-hue), 58%, 32%, 1);
  box-shadow: none;
}
html[data-theme="light"] .cockpit-subdomain-chip.is-active {
  border-color: hsla(var(--chip-hue), 72%, 47%, .9);
  background: hsla(var(--chip-hue), 76%, 87%, 1);
  color: hsla(var(--chip-hue), 68%, 25%, 1);
  box-shadow: 0 0 15px hsla(var(--chip-hue), 72%, 48%, .18);
}
@media (max-width: 860px) {
  .cockpit-title-block h1 { font-size: clamp(34px, 9.5vw, 44px); }
  .cockpit-almanac-head span { font-size: 15px; }
  .cockpit-almanac-head small { font-size: 11px; }
  .cockpit-almanac-item { padding: 11px 12px; }
  .cockpit-almanac-item p { font-size: 13px; }
}

/* Duration, sidebar and shared subdomain palette */
.app-shell.sidebar-collapsed { --sidebar-width: 88px; }
.app-shell.sidebar-collapsed .sidebar { padding-inline: 14px; }
.app-shell.sidebar-collapsed .sidebar-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  gap: 8px;
  padding-inline: 0;
}
.app-shell.sidebar-collapsed .brand { width: 100%; justify-content: center; }
.app-shell.sidebar-collapsed .sidebar-collapse { width: 34px; height: 34px; flex: 0 0 34px; }
.app-shell.sidebar-collapsed .theme-toggle {
  display: grid;
  width: 48px;
  min-height: 48px;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  position: relative;
  padding: 0;
}
.app-shell.sidebar-collapsed .theme-icon { grid-column: 1; justify-self: center; margin: 0; }
.app-shell.sidebar-collapsed .theme-indicator { position: absolute; top: 5px; right: 5px; }

.cockpit-focus-headline-shell { margin: 0; }
.cockpit-kpi strong { font-size: clamp(20px, 2.1vw, 28px); white-space: nowrap; }
.cockpit-kpi small { white-space: nowrap; }

.subdomain-chip[data-tone="0"],
.cockpit-subdomain-chip[data-tone="0"] { --chip-hue: 154; }
.subdomain-chip[data-tone="1"],
.cockpit-subdomain-chip[data-tone="1"] { --chip-hue: 190; }
.subdomain-chip[data-tone="2"],
.cockpit-subdomain-chip[data-tone="2"] { --chip-hue: 34; }
.subdomain-chip[data-tone="3"],
.cockpit-subdomain-chip[data-tone="3"] { --chip-hue: 345; }
.subdomain-chip[data-tone="4"],
.cockpit-subdomain-chip[data-tone="4"] { --chip-hue: 272; }
.subdomain-chip[data-tone="5"],
.cockpit-subdomain-chip[data-tone="5"] { --chip-hue: 214; }
.subdomain-chip,
.cockpit-subdomain-chip {
  border-color: hsla(var(--chip-hue), 48%, 38%, .42);
  background: hsla(var(--chip-hue), 30%, 13%, .72);
  color: hsla(var(--chip-hue), 48%, 68%, .78);
  font-weight: 720;
  transition: border-color 150ms ease, color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}
.subdomain-chip:hover,
.cockpit-subdomain-chip:hover { border-color: hsla(var(--chip-hue), 65%, 52%, .75); color: hsla(var(--chip-hue), 80%, 82%, 1); }
.subdomain-chip.is-active,
.cockpit-subdomain-chip.is-active {
  border-color: hsla(var(--chip-hue), 82%, 65%, .96);
  background: hsla(var(--chip-hue), 68%, 25%, .96);
  color: hsla(var(--chip-hue), 100%, 90%, 1);
  box-shadow: 0 0 16px hsla(var(--chip-hue), 78%, 55%, .3), inset 0 0 0 1px hsla(var(--chip-hue), 95%, 75%, .16);
}
html[data-theme="light"] .subdomain-chip,
html[data-theme="light"] .cockpit-subdomain-chip {
  border-color: hsla(var(--chip-hue), 40%, 70%, .58);
  background: hsla(var(--chip-hue), 25%, 91%, .85);
  color: hsla(var(--chip-hue), 30%, 44%, .82);
}
html[data-theme="light"] .subdomain-chip.is-active,
html[data-theme="light"] .cockpit-subdomain-chip.is-active {
  border-color: hsla(var(--chip-hue), 72%, 47%, .92);
  background: hsla(var(--chip-hue), 76%, 87%, 1);
  color: hsla(var(--chip-hue), 68%, 25%, 1);
  box-shadow: 0 0 15px hsla(var(--chip-hue), 72%, 48%, .2);
}

.app-shell.sidebar-collapsed .sidebar-top,
.app-shell.sidebar-collapsed .sidebar-footer { width: 100%; }
.app-shell.sidebar-collapsed .sidebar-footer { justify-items: center; }
.app-shell.sidebar-collapsed .theme-toggle { margin-inline: auto; }

/* Tool modal and single-line headline fitting */
.cockpit-headline {
  width: 100%;
  max-width: 94%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: clip;
}
.cockpit-tool-card { width: min(560px, 100%); }
.cockpit-tool-form { display: grid; gap: 16px; padding: 20px 22px 22px; }
.cockpit-tool-form .field-group { display: grid; gap: 8px; }
.cockpit-tool-form label { color: var(--muted); font-size: 12px; font-weight: 700; }
.cockpit-tool-form input,
.cockpit-tool-form select { width: 100%; min-height: 49px; padding: 0 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--workspace-bg); color: var(--text); font: inherit; font-size: 13px; }
.cockpit-tool-form input:focus,
.cockpit-tool-form select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.cockpit-tool-form .confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cockpit-tool-form .confirm-actions button { min-height: 48px; }
.cockpit-tool-link { color: var(--accent); font-size: 12px; text-align: center; text-decoration: none; }
.cockpit-tool-link:hover { color: var(--accent-strong); }
@media (max-width: 860px) {
  .cockpit-tool-form { padding: 16px 14px 18px; }
  .cockpit-tool-form .confirm-actions { grid-template-columns: 1fr; }
}

/* Custom focus preset */
.focus-preset-card[data-focus-preset="custom"] strong { font-size: 18px; letter-spacing: -.035em; }
.cockpit-presets button[data-cockpit-preset="custom"] { font-size: 11px; letter-spacing: -.02em; }
.focus-custom-card { width: min(620px, 100%); }
.focus-custom-form { display: grid; gap: 14px; padding: 4px 22px 0; }
.focus-custom-row { display: grid; grid-template-columns: minmax(110px, 1fr) repeat(2, minmax(100px, .8fr)); align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--border); border-radius: 13px; background: var(--workspace-bg); }
.focus-custom-row > div { display: grid; gap: 4px; }
.focus-custom-row strong { color: var(--text); font-size: 15px; }
.focus-custom-row small { color: var(--faint); font-size: 10px; }
.focus-custom-row label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.focus-custom-row input { width: 82px; min-height: 42px; padding: 0 9px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); color: var(--text); font: inherit; font-size: 14px; text-align: center; }
.focus-custom-row input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.focus-custom-hint { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.focus-custom-card .feedback-actions { padding: 18px 22px 22px; }
@media (max-width: 860px) {
  .focus-custom-form { padding-inline: 14px; }
  .focus-custom-row { grid-template-columns: 1fr 1fr; }
  .focus-custom-row > div { grid-column: 1 / -1; }
  .focus-custom-card .feedback-actions { padding-inline: 14px; }
}

.cockpit-overview { padding: 28px 24px 30px; }
.cockpit-activity { max-height: 230px; }

.cockpit-subdomain-chip { display: inline-flex; align-items: center; gap: 7px; }

/* Summary report modal and header polish */
.summary-header { align-items: center; }
.summary-header-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(132px, 1fr));
  gap: 10px;
  width: min(360px, 100%);
  max-width: none;
}
.summary-action-button {
  min-height: 48px;
  padding: 0 18px;
  border-radius: 12px;
  font-size: 12px;
  white-space: nowrap;
}
.summary-action-button.ai-calendar { border-color: var(--border-strong); background: var(--panel); color: var(--text); }
.summary-report-card {
  width: min(960px, 100%);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.summary-report-meta { margin: 0; padding: 0 22px 12px; color: var(--muted); font-size: 11px; }
.summary-report-content {
  flex: 1 1 auto;
  width: calc(100% - 44px);
  min-height: 360px;
  max-height: 62vh;
  margin: 0 22px;
  padding: 16px;
  resize: none;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--workspace-bg);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
  line-height: 1.7;
  white-space: pre-wrap;
}
.summary-report-content:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.summary-report-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 18px 22px 22px; }
.summary-report-actions button { min-width: 120px; min-height: 46px; }
@media (max-width: 860px) {
  .summary-header { align-items: flex-start; }
  .summary-header-actions { width: 100%; grid-template-columns: 1fr 1fr; }
  .summary-report-card { width: 100%; max-height: 94vh; }
  .summary-report-meta { padding-inline: 14px; }
  .summary-report-content { width: calc(100% - 28px); min-height: 300px; margin-inline: 14px; padding: 12px; }
  .summary-report-actions { padding: 14px; }
  .summary-report-actions button { flex: 1; min-width: 0; }
}

.summary-quick-ranges button.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
  box-shadow: 0 0 0 1px var(--accent-line);
}

.cockpit-almanac-item p { overflow-wrap: anywhere; white-space: normal; }

/* Persisted passcode gate */
body.auth-gate-open {
  overflow: hidden;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 600;
  display: grid;
  place-items: center;
  padding: max(22px, env(safe-area-inset-top)) 22px max(22px, env(safe-area-inset-bottom));
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 18%, rgba(44, 225, 140, 0.13), transparent 34%),
    radial-gradient(circle at 15% 88%, rgba(70, 155, 255, 0.08), transparent 32%),
    var(--workspace-bg);
}

.auth-gate-halo {
  position: absolute;
  width: min(66vw, 720px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid var(--accent-line);
  box-shadow: 0 0 90px var(--accent-soft), inset 0 0 80px var(--accent-soft);
  opacity: 0.72;
  animation: auth-halo-pulse 5s ease-in-out infinite;
  pointer-events: none;
}

.auth-gate-card {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(430px, 100%);
  justify-items: center;
  padding: 34px 34px 28px;
  border: 1px solid var(--border-strong);
  border-radius: 26px;
  background: var(--panel);
  box-shadow: var(--shadow);
  text-align: center;
}

.auth-gate-mark {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  margin-bottom: 17px;
  border: 1px solid var(--accent-line);
  border-radius: 18px;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.auth-gate-mark svg {
  width: 38px;
  height: 38px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.auth-gate-card .section-kicker {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.auth-gate-card h1 {
  margin: 0 0 22px;
  font-size: clamp(25px, 5vw, 31px);
  letter-spacing: -0.04em;
}

.auth-gate-intro {
  max-width: 310px;
  margin: 11px 0 22px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.auth-gate-form {
  display: grid;
  width: 100%;
  gap: 12px;
  text-align: left;
}

.auth-gate-form label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.auth-gate-form input {
  width: 100%;
  height: 56px;
  border: 1px solid var(--border-strong);
  border-radius: 15px;
  background: var(--panel-raised);
  color: var(--text);
  font: 800 24px/1 "SF Pro Display", "PingFang SC", "Microsoft YaHei UI", sans-serif;
  letter-spacing: 0.42em;
  text-align: center;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.auth-gate-form input::placeholder {
  color: var(--faint);
  letter-spacing: 0.28em;
}

.auth-gate-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.auth-gate-form input:disabled {
  opacity: 0.62;
}

.auth-gate-error {
  min-height: 18px;
  margin: -2px 2px 0;
  color: var(--danger);
  font-size: 12px;
  line-height: 1.45;
}

.auth-gate-submit,
.auth-gate-retry {
  min-height: 48px;
  border-radius: 14px;
  font-weight: 800;
  transition: transform 150ms ease, filter 150ms ease, opacity 150ms ease;
}

.auth-gate-submit {
  background: var(--accent);
  color: #04110c;
}

.auth-gate-submit:not(:disabled):hover,
.auth-gate-retry:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.auth-gate-submit:disabled {
  opacity: 0.42;
}

.auth-gate-retry {
  width: 100%;
  margin-top: 12px;
  border: 1px solid var(--border-strong);
  background: var(--panel-raised);
  color: var(--text);
}

.auth-gate-foot {
  margin: 19px 0 0;
  color: var(--faint);
  font-size: 11px;
}

.auth-gate[data-state="loading"] .auth-gate-form {
  pointer-events: none;
  opacity: 0.58;
}

.settings-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.settings-header > div {
  min-width: 0;
}

.settings-header .secondary-button {
  flex: 0 0 auto;
  margin-bottom: 4px;
}

@keyframes auth-halo-pulse {
  0%, 100% { transform: scale(0.92); opacity: 0.5; }
  50% { transform: scale(1.04); opacity: 0.82; }
}

@media (max-width: 560px) {
  .auth-gate {
    padding-inline: 14px;
  }

  .auth-gate-card {
    padding: 29px 21px 23px;
    border-radius: 22px;
  }

  .auth-gate-halo {
    width: 120vw;
  }

  .settings-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .settings-header .secondary-button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-gate-halo {
    animation: none;
  }
}
/* Fragment editor: constrained panel with an explicit scrollbar */
.fragment-editor-layout {
  height: min(72vh, 680px);
  min-height: 480px;
}

.group-panel,
.fragment-panel {
  min-height: 0;
}

.fragment-panel {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.fragment-panel::-webkit-scrollbar {
  width: 8px;
}

.fragment-panel::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: var(--border-strong);
}

.fragment-check-list {
  padding-right: 4px;
}

/* Mindfulness cabin: breathing ring gets a full row, mixer moves below it */
.mindfulness-layout {
  grid-template-columns: 1fr;
}

.breathing-card {
  width: 100%;
}

.breathing-orb-wrap {
  width: min(500px, 72vw);
}

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

.mixer-section {
  border-right: 1px solid rgba(122, 190, 168, .12);
  border-bottom: 0;
}

.mixer-section:last-child {
  border-right: 0;
}

html[data-theme="light"] .mixer-section {
  border-right-color: rgba(100, 151, 164, .18);
}

/* Summary center: category filtering has its own clearly separated control */
.summary-controls {
  grid-template-columns: 150px 150px minmax(260px, auto);
}

.summary-filter-panel {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 10px;
  padding: 12px 13px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: rgba(255, 255, 255, .018);
}

.summary-filter-heading {
  display: grid;
  flex: 0 0 112px;
  gap: 3px;
}

.summary-filter-heading strong {
  color: var(--text);
  font-size: 12px;
}

.summary-filter-heading small {
  color: var(--faint);
  font-size: 9px;
}

.summary-category-filter {
  flex: 1;
}

@media (max-width: 1040px) {
  .breathing-orb-wrap {
    width: min(460px, 68vw);
  }

  .sound-mixer {
    grid-template-columns: 1fr;
  }

  .mixer-section {
    border-right: 0;
    border-bottom: 1px solid rgba(122, 190, 168, .12);
  }

  .mixer-section:last-child {
    border-bottom: 0;
  }

  html[data-theme="light"] .mixer-section {
    border-bottom-color: rgba(100, 151, 164, .18);
  }
}

@media (max-width: 1020px) {
  .summary-controls {
    grid-template-columns: 1fr 1fr;
  }

  .summary-quick-ranges {
    grid-column: span 2;
  }

  .summary-filter-panel {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .summary-filter-heading {
    flex-basis: auto;
  }
}

@media (max-width: 720px) {
  .fragment-editor-layout {
    height: auto;
    min-height: 0;
  }
}

@media (max-width: 600px) {
  .summary-controls {
    grid-template-columns: 1fr;
  }

  .summary-quick-ranges {
    grid-column: auto;
  }
}
/* Focus actions: immediate visual lock while server sync is in flight */
.focus-view button[aria-busy="true"],
.cockpit-focus-panel button[aria-busy="true"] {
  opacity: 0.58;
}
/* Mobile floating navigation orb */
.mobile-nav-orb {
  display: none;
}

@media (max-width: 860px) {
  .mobile-header {
    display: none !important;
  }

  .workspace-frame {
    padding-top: env(safe-area-inset-top);
  }

  .mobile-nav-orb {
    position: fixed;
    z-index: 45;
    display: grid;
    right: 16px;
    bottom: 18px;
    width: 56px;
    height: 56px;
    place-items: center;
    border: 1px solid var(--accent-line);
    border-radius: 50%;
    background:
      radial-gradient(circle at 32% 24%, rgba(255, 255, 255, .18), transparent 28%),
      linear-gradient(145deg, var(--panel-raised), var(--panel));
    color: var(--text);
    box-shadow: 0 14px 35px rgba(0, 0, 0, .22), 0 0 0 7px var(--accent-soft), inset 0 0 22px var(--accent-soft);
    cursor: grab;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    transition: transform 150ms ease, opacity 150ms ease, box-shadow 150ms ease;
  }

  .mobile-nav-orb.is-dragging {
    cursor: grabbing;
    transform: scale(1.06);
    box-shadow: 0 18px 42px rgba(0, 0, 0, .28), 0 0 0 9px var(--accent-soft), inset 0 0 24px var(--accent-soft);
  }

  .mobile-nav-orb-glow {
    position: absolute;
    inset: 7px;
    border: 1px solid var(--accent-line);
    border-radius: 50%;
    opacity: .72;
    animation: mobile-nav-orb-pulse 3.2s ease-in-out infinite;
    pointer-events: none;
  }

  .mobile-nav-orb svg {
    position: relative;
    z-index: 1;
    width: 22px;
    height: 22px;
    fill: none;
    stroke: var(--accent-strong);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    pointer-events: none;
  }

  body.drawer-open .mobile-nav-orb {
    opacity: 0;
    pointer-events: none;
  }
}

@keyframes mobile-nav-orb-pulse {
  0%, 100% { transform: scale(.9); opacity: .48; }
  50% { transform: scale(1.08); opacity: .85; }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-nav-orb-glow {
    animation: none;
  }
}

/* Light theme: warm inspiration palette */
html[data-theme="light"] .sphere-stage {
  background:
    radial-gradient(circle at 50% 46%, rgba(199, 103, 77, .11), transparent 32%),
    linear-gradient(145deg, rgba(255, 255, 255, .58), transparent 62%),
    var(--panel);
}

html[data-theme="light"] .core-ring {
  border-color: rgba(199, 103, 77, .25);
}

html[data-theme="light"] .fragment.is-front {
  border-color: rgba(199, 103, 77, .34);
  background: #F7E4DA;
}

html[data-theme="light"] .fragment.is-foreground {
  text-shadow: 0 0 16px rgba(199, 103, 77, .25);
}

html[data-theme="light"] .cockpit-headline-shell {
  background:
    radial-gradient(circle at 50% 120%, rgba(199, 103, 77, .12), transparent 58%),
    linear-gradient(120deg, rgba(199, 103, 77, .07), transparent 62%),
    var(--panel);
}

html[data-theme="light"] .cockpit-headline {
  text-shadow: 0 12px 36px rgba(199, 103, 77, .14);
}

html[data-theme="light"] .cockpit-sphere-shell {
  background:
    radial-gradient(circle at 50% 48%, rgba(199, 103, 77, .16), transparent 52%),
    radial-gradient(circle at 50% 50%, transparent 0 23%, rgba(199, 103, 77, .10) 24%, transparent 25%, transparent 37%, rgba(120, 154, 139, .10) 38%, transparent 39%),
    var(--panel);
}

html[data-theme="light"] .cockpit-sphere {
  border-color: rgba(199, 103, 77, .50);
  box-shadow: 0 0 0 16px rgba(199, 103, 77, .055), 0 0 80px rgba(199, 103, 77, .15), inset 0 0 100px rgba(199, 103, 77, .10);
}

html[data-theme="light"] .cockpit-sphere::before,
html[data-theme="light"] .cockpit-sphere::after {
  border-color: rgba(199, 103, 77, .22);
}

html[data-theme="light"] .cockpit-core {
  border-color: rgba(199, 103, 77, .48);
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, .98), transparent 36%),
    radial-gradient(circle at 50% 60%, rgba(216, 126, 102, .78), transparent 69%),
    var(--panel-raised);
  box-shadow: 0 0 38px rgba(199, 103, 77, .25), 0 0 96px rgba(199, 103, 77, .14), inset 0 0 42px rgba(199, 103, 77, .14);
}

html[data-theme="light"] .cockpit-fragment.is-front {
  border-color: rgba(199, 103, 77, .42);
  background: #F7E4DA;
}

html[data-theme="light"] .cockpit-fragment.is-foreground {
  border-color: var(--accent);
  color: var(--accent-strong);
  text-shadow: 0 0 14px rgba(199, 103, 77, .24);
}