/*
 * 出发网主页：与 Agent 协作平台共用同一套视觉语言——侧栏工作区、细发光渐变线、橙色主操作、
 * 蓝色交互焦点、薄荷绿状态。调色板只在本页局部定义（--ap-*），不改动共享的 tokens.css。
 * 主题仍由 data-planner-theme 驱动，与旅行规划共用同一组本地存储键。
 */
:root {
  color-scheme: light;
  --ap-bg: #e7ecf3;
  --ap-sidebar: #dde4ee;
  --ap-surface: #f3f6fa;
  --ap-surface-2: #ebf0f6;
  --ap-surface-3: #e1e8f1;
  --ap-field: #f8fafc;
  --ap-hover: rgba(27, 99, 198, .05);
  --ap-line: #d2dbe6;
  --ap-line-strong: #b9c6d6;
  --ap-text: #17202b;
  --ap-text-2: #3a4657;
  --ap-muted: #586476;
  --ap-faint: #7a8698;
  --ap-orange: #b04e0b;
  --ap-orange-fill: #bf560f;
  --ap-accent-hover: #a2470a;
  --ap-orange-soft: rgba(196, 92, 18, .07);
  --ap-blue: #1b62c4;
  --ap-blue-soft: rgba(27, 98, 196, .1);
  --ap-mint: #0a7655;
  --ap-mint-soft: rgba(10, 118, 85, .1);
  --ap-warning: #855400;
  --ap-warning-soft: rgba(176, 116, 0, .12);
  --ap-danger: #b02f3d;
  --ap-danger-soft: rgba(176, 47, 61, .09);
  --ap-on-accent: #fff;
  --ap-shadow: 0 1px 2px rgba(30, 50, 80, .05), 0 .4286rem 1.2857rem rgba(30, 50, 80, .05);
  --ap-shadow-lg: 0 .8571rem 2.5714rem rgba(30, 50, 80, .16);
  --ap-glow-orange: 0 0 0 1px rgba(196, 92, 18, .3), 0 .2857rem 1rem rgba(196, 92, 18, .12);
  --ap-glow-blue: 0 0 0 3px rgba(27, 98, 196, .18);
  --ap-ambient: radial-gradient(64.2857rem 22.8571rem at 85% -8.5714rem, rgba(27, 98, 196, .07), transparent 70%);
  --ap-radius: .7143rem;
  --ap-radius-sm: .5rem;
  --ap-font: "Segoe UI Variable Text", "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", "Yu Gothic UI", "PingFang SC", "Hiragino Sans", sans-serif;
  --ap-mono: "Cascadia Mono", Consolas, "SFMono-Regular", Menlo, monospace;
}

:root[data-planner-theme='dark'] {
  color-scheme: dark;
  --ap-bg: #050608;
  --ap-sidebar: #08090c;
  --ap-surface: #0c0e12;
  --ap-surface-2: #121519;
  --ap-surface-3: #191d23;
  --ap-field: #08090c;
  --ap-hover: rgba(255, 255, 255, .025);
  --ap-line: #1c2028;
  --ap-line-strong: #2b313b;
  --ap-text: #e9ecf1;
  --ap-text-2: #b8c0cc;
  --ap-muted: #8e98a7;
  --ap-faint: #626c7a;
  --ap-orange: #ff9447;
  --ap-orange-fill: #ff9447;
  --ap-accent-hover: #ffac70;
  --ap-orange-soft: rgba(255, 148, 71, .09);
  --ap-blue: #5eaaff;
  --ap-blue-soft: rgba(94, 170, 255, .1);
  --ap-mint: #7debc1;
  --ap-mint-soft: rgba(125, 235, 193, .09);
  --ap-warning: #ffc46b;
  --ap-warning-soft: rgba(255, 196, 107, .1);
  --ap-danger: #ef98a1;
  --ap-danger-soft: rgba(239, 152, 161, .1);
  --ap-on-accent: #160b03;
  --ap-shadow: 0 .7143rem 2.1429rem rgba(0, 0, 0, .45);
  --ap-shadow-lg: 0 2.1429rem 5.7143rem rgba(0, 0, 0, .7);
  --ap-glow-orange: 0 0 0 1px rgba(255, 148, 71, .55), 0 0 1.2857rem rgba(255, 148, 71, .2);
  --ap-glow-blue: 0 0 0 1px rgba(94, 170, 255, .65), 0 0 1.1429rem rgba(94, 170, 255, .28);
  --ap-ambient: radial-gradient(64.2857rem 24.2857rem at 82% -10rem, rgba(94, 170, 255, .07), transparent 70%), radial-gradient(50rem 21.4286rem at 8% -8.5714rem, rgba(255, 148, 71, .05), transparent 70%);
}

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

/* 流式根字号：所有尺寸都用 rem，随分辨率一起放大（手机/笔记本 15px，1440 约 15.4px，1920 约 17.3px，2560 约 19.8px，4K 24px）。 */
html {
  font-size: clamp(15px, 0.4vw + 9.6px, 24px);
  background: var(--ap-bg);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--ap-bg);
  color: var(--ap-text);
  font-family: var(--ap-font);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: color-mix(in srgb, var(--ap-blue) 30%, transparent);
}

a {
  color: var(--ap-blue);
}

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

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

:is(button, a, input, select, [tabindex]):focus-visible {
  outline: 2px solid var(--ap-blue);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.icon {
  width: 1.4286rem;
  height: 1.4286rem;
  flex: 0 0 auto;
}

.icon-small {
  width: 1.2143rem;
  height: 1.2143rem;
}

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

.skip-link {
  position: fixed;
  left: .8571rem;
  top: -5.7143rem;
  z-index: 100;
  padding: .7143rem 1.1429rem;
  border-radius: var(--ap-radius-sm);
  background: var(--ap-surface);
  color: var(--ap-orange);
  box-shadow: var(--ap-glow-orange);
}

.skip-link:focus {
  top: .8571rem;
}

/* ---------- shell ---------- */
.app-shell {
  display: grid;
  grid-template-columns: 17.7143rem minmax(0, 1fr);
  min-height: 100dvh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 1.2857rem;
  min-width: 0;
  height: 100dvh;
  padding: 1.5714rem 1rem 0;
  border-right: 1px solid var(--ap-line);
  background: var(--ap-sidebar);
  color: var(--ap-text-2);
}

.brand {
  display: flex;
  align-items: center;
  gap: .8571rem;
  padding: 0 .4286rem 1.2857rem;
  border-bottom: 1px solid var(--ap-line);
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 2.5714rem;
  height: 2.5714rem;
  border: 1px solid transparent;
  border-radius: .7143rem;
  background:
    linear-gradient(var(--ap-surface), var(--ap-surface)) padding-box,
    linear-gradient(135deg, var(--ap-orange), var(--ap-blue) 55%, var(--ap-mint)) border-box;
  box-shadow: 0 0 1.2857rem color-mix(in srgb, var(--ap-blue) 22%, transparent);
}

.brand-mark img {
  display: block;
  width: 1.5714rem;
  height: 1.5714rem;
  border-radius: .3571rem;
}

.brand-text strong {
  display: block;
  color: var(--ap-text);
  font-size: 1.0714rem;
  font-weight: 650;
}

.brand-text span {
  display: block;
  margin-top: 1px;
  color: var(--ap-muted);
  font-size: .7857rem;
}

.sidebar-user {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: .2857rem .7143rem;
  padding: .7143rem;
  border: 1px solid var(--ap-line);
  border-radius: var(--ap-radius);
  background: var(--ap-surface);
  box-shadow: var(--ap-shadow);
}

.sidebar-user__text {
  min-width: 0;
}

.sidebar-user__text strong,
.sidebar-user__text span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user__text strong {
  color: var(--ap-text);
  font-size: .9286rem;
  font-weight: 600;
}

.sidebar-user__text span {
  color: var(--ap-muted);
  font-family: var(--ap-mono);
  font-size: .7857rem;
}

.sidebar-user .badge {
  grid-column: 2;
  justify-self: start;
}

.sidebar-hint {
  padding: 0 .5714rem;
  color: var(--ap-muted);
  font-size: .8571rem;
  line-height: 1.6;
}

.sidebar-account > .skeleton-line {
  display: block;
  height: 3.8571rem;
  border-radius: var(--ap-radius);
}

.sidebar-nav {
  display: grid;
  gap: .2857rem;
}

.sidebar-heading {
  margin-bottom: .2857rem;
  padding-left: .5714rem;
  color: var(--ap-muted);
  font-size: .8571rem;
  font-weight: 600;
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: .7143rem;
  min-height: 2.7143rem;
  padding: .5714rem .7143rem .5714rem .8571rem;
  border: 1px solid transparent;
  border-radius: var(--ap-radius-sm);
  color: var(--ap-text-2);
  font-size: .9286rem;
  font-weight: 550;
  text-decoration: none;
  transition: background .15s, border-color .15s, box-shadow .15s, color .15s;
}

.nav-link .icon {
  color: var(--ap-faint);
}

.nav-link > span:not(.count) {
  flex: 1 1 auto;
  min-width: 0;
}

.nav-link:hover {
  background: var(--ap-hover);
  color: var(--ap-text);
}

.nav-link.is-active {
  border-color: color-mix(in srgb, var(--ap-orange) 45%, transparent);
  background: var(--ap-orange-soft);
  color: var(--ap-text);
  box-shadow: 0 0 1.1429rem color-mix(in srgb, var(--ap-orange) 12%, transparent);
}

.nav-link.is-active::before {
  content: '';
  position: absolute;
  left: -1px;
  top: .6429rem;
  bottom: .6429rem;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--ap-orange);
  box-shadow: 0 0 .7143rem var(--ap-orange);
}

.nav-link.is-active .icon {
  color: var(--ap-orange);
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: .5714rem;
  margin: auto -1rem 0;
  padding: .9286rem 1.2857rem;
  border-top: 1px solid var(--ap-line);
  color: var(--ap-muted);
  font-size: .7857rem;
}

.connection-dot {
  display: inline-block;
  flex: 0 0 .5rem;
  width: .5rem;
  height: .5rem;
  border-radius: 50%;
  background: var(--ap-warning);
  box-shadow: 0 0 0 3px var(--ap-warning-soft);
  animation: pulse 1.6s ease-in-out infinite;
}

.connection-dot.idle {
  background: var(--ap-faint);
  box-shadow: none;
  animation: none;
}

.connection-dot.connected {
  background: var(--ap-mint);
  box-shadow: 0 0 0 3px var(--ap-mint-soft), 0 0 .7143rem var(--ap-mint);
  animation: pulse 2.4s ease-in-out infinite;
}

.connection-dot.error {
  background: var(--ap-danger);
  box-shadow: 0 0 0 3px var(--ap-danger-soft), 0 0 .7143rem var(--ap-danger);
  animation: none;
}

/* ---------- workspace ---------- */
main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100dvh;
  padding: 2rem 2.2857rem 2rem;
  background-image: var(--ap-ambient);
  background-repeat: no-repeat;
}

main:focus {
  outline: none;
}

#main-busy {
  flex: 1 0 auto;
}

#main-busy,
.time-weather,
.footer {
  width: 100%;
  max-width: 120rem;
  margin-inline: auto;
}

.workspace-header {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.1429rem 1.7143rem;
  margin-bottom: 1.5714rem;
  padding-bottom: 1.4286rem;
}

/* 平台式细发光分隔线 */
.workspace-header::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--ap-orange), var(--ap-blue) 45%, color-mix(in srgb, var(--ap-mint) 40%, transparent) 75%, transparent);
  box-shadow: 0 0 .8571rem color-mix(in srgb, var(--ap-blue) 35%, transparent);
  opacity: .55;
}

.page-heading {
  min-width: 0;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .4286rem;
  color: var(--ap-orange);
  font-size: .7857rem;
  font-weight: 600;
}

.eyebrow::before {
  content: '';
  width: 1rem;
  height: 2px;
  border-radius: 2px;
  background: var(--ap-orange);
  box-shadow: 0 0 .5714rem var(--ap-orange);
}

h1 {
  font-size: 1.7143rem;
  font-weight: 650;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.page-meta {
  margin-top: .2857rem;
  color: var(--ap-muted);
  font-family: var(--ap-mono);
  font-size: .8214rem;
}

.header-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: .7143rem;
  margin-left: auto;
}

/* 主题：一键三段切换（系统 / 浅色 / 深色），写入与旅行规划共用的 planner-color-mode 键。 */
.theme-switch {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 2px;
  height: 2.5714rem;
  padding: 2px;
  border: 1px solid var(--ap-line-strong);
  border-radius: var(--ap-radius-sm);
  background: var(--ap-surface);
}

.theme-switch button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .3571rem;
  min-width: 2.2857rem;
  padding: 0 .6429rem;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ap-muted);
  font-size: .8571rem;
  font-weight: 600;
  transition: background .15s, color .15s, box-shadow .15s;
}

.theme-switch button:hover {
  background: var(--ap-hover);
  color: var(--ap-text);
}

.theme-switch button[aria-pressed='true'] {
  background: var(--ap-orange-soft);
  color: var(--ap-text);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ap-orange) 45%, transparent);
}

.theme-switch button[aria-pressed='true'] .icon {
  color: var(--ap-orange);
}

.account-area {
  display: flex;
  align-items: center;
  gap: .7143rem;
}

/* ---------- buttons ---------- */
.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 2.5714rem;
  padding: .5714rem 1.0714rem;
  border-radius: var(--ap-radius-sm);
  font-size: .8929rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s, border-color .15s, box-shadow .15s, color .15s;
}

.primary-button {
  border: 1px solid var(--ap-orange-fill);
  background: var(--ap-orange-fill);
  color: var(--ap-on-accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--ap-orange) 20%, transparent), 0 .2857rem 1.2857rem color-mix(in srgb, var(--ap-orange) 28%, transparent);
}

.primary-button:hover:not(:disabled) {
  border-color: var(--ap-accent-hover);
  background: var(--ap-accent-hover);
  box-shadow: var(--ap-glow-orange), 0 .4286rem 1.7143rem color-mix(in srgb, var(--ap-orange) 32%, transparent);
}

.secondary-button {
  border: 1px solid var(--ap-line-strong);
  background: var(--ap-surface);
  color: var(--ap-text-2);
}

.secondary-button:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--ap-blue) 55%, var(--ap-line-strong));
  color: var(--ap-text);
  box-shadow: 0 0 .8571rem color-mix(in srgb, var(--ap-blue) 16%, transparent);
}

.secondary-button .icon {
  color: var(--ap-blue);
}

.small-button {
  min-height: 2.1429rem;
  padding: .3571rem .7857rem;
  font-size: .8571rem;
}

.console-button .icon {
  color: var(--ap-orange);
}

.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ap-blue);
  font-size: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---------- account menu ---------- */
.account-placeholder {
  display: inline-block;
  width: 9.4286rem;
  height: 2.5714rem;
  border-radius: var(--ap-radius-sm);
  background: var(--ap-surface-3);
  animation: shimmer 1.4s ease-in-out infinite;
}

.account-menu-wrap {
  position: relative;
}

.account-button {
  gap: .5714rem;
  max-width: 15.7143rem;
  padding: .2857rem .7143rem .2857rem .3571rem;
}

.account-button .icon-chevron {
  width: 1rem;
  height: 1rem;
  color: var(--ap-muted);
  transition: transform .15s;
}

.account-button[aria-expanded='true'] .icon-chevron {
  transform: rotate(180deg);
}

.account-name {
  min-width: 0;
  overflow: hidden;
  color: var(--ap-text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-avatar {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 1.8571rem;
  height: 1.8571rem;
  border: 1px solid transparent;
  border-radius: 50%;
  background:
    linear-gradient(var(--ap-surface-2), var(--ap-surface-2)) padding-box,
    linear-gradient(135deg, var(--ap-orange), var(--ap-blue) 55%, var(--ap-mint)) border-box;
  box-shadow: 0 0 .7143rem color-mix(in srgb, var(--ap-blue) 25%, transparent);
  color: var(--ap-text);
  font-size: .8571rem;
  font-weight: 700;
}

.account-avatar--large {
  width: 2.4286rem;
  height: 2.4286rem;
  font-size: 1rem;
}

.account-menu {
  position: absolute;
  top: calc(100% + .4286rem);
  right: 0;
  z-index: 20;
  display: grid;
  gap: 2px;
  min-width: 15.7143rem;
  padding: .4286rem;
  border: 1px solid var(--ap-line-strong);
  border-radius: var(--ap-radius);
  background: var(--ap-surface);
  box-shadow: var(--ap-shadow-lg);
}

.account-meta {
  display: grid;
  gap: 2px;
  margin-bottom: .2857rem;
  padding: .4286rem .7143rem .6429rem;
  border-bottom: 1px solid var(--ap-line);
  overflow-wrap: anywhere;
}

.account-meta strong {
  font-size: .9286rem;
}

.account-meta span {
  color: var(--ap-muted);
  font-family: var(--ap-mono);
  font-size: .7857rem;
}

.account-menu [role='menuitem'] {
  display: flex;
  align-items: center;
  gap: .6429rem;
  width: 100%;
  padding: .5714rem .7143rem;
  border: 0;
  border-radius: .4286rem;
  background: transparent;
  color: var(--ap-text-2);
  font-size: .9286rem;
  text-align: left;
  text-decoration: none;
}

.account-menu [role='menuitem'] .icon {
  color: var(--ap-muted);
}

.account-menu [role='menuitem']:is(:hover, :focus-visible) {
  outline: none;
  background: var(--ap-hover);
  color: var(--ap-text);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ap-blue) 45%, transparent);
}

.account-menu .menuitem-danger,
.account-menu .menuitem-danger .icon {
  color: var(--ap-danger);
}

.account-menu .menuitem-danger:is(:hover, :focus-visible) {
  background: var(--ap-danger-soft);
  color: var(--ap-danger);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ap-danger) 45%, transparent);
}

/* ---------- notices ---------- */
.notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5714rem .8571rem;
  margin-bottom: 1.2857rem;
  padding: .8571rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--ap-radius);
  font-size: .8929rem;
}

.notice > span {
  flex: 1 1 18.5714rem;
  overflow-wrap: anywhere;
}

.notice a {
  font-weight: 600;
}

.notice-warning {
  border-color: color-mix(in srgb, var(--ap-warning) 40%, transparent);
  background: var(--ap-warning-soft);
  color: var(--ap-text-2);
}

.notice-danger {
  border-color: color-mix(in srgb, var(--ap-danger) 40%, transparent);
  background: var(--ap-danger-soft);
  color: var(--ap-danger);
}

/* ---------- content ---------- */
.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24.2857rem;
  align-items: start;
  gap: 1.7143rem;
}

.primary-pane {
  display: grid;
  gap: 2rem;
  min-width: 0;
}

.section {
  min-width: 0;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .2857rem .8571rem;
  margin-bottom: .8571rem;
}

.section-head h2 {
  display: inline-flex;
  align-items: center;
  font-size: 1rem;
  font-weight: 650;
}

.section-head p {
  color: var(--ap-muted);
  font-size: .8571rem;
}

.count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.4286rem;
  height: 1.2857rem;
  margin-left: .5714rem;
  padding: 0 .4286rem;
  border-radius: 71.3571rem;
  background: var(--ap-surface-3);
  color: var(--ap-muted);
  font-size: .7857rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.nav-link .count {
  margin-left: auto;
}

.nav-link.is-active .count {
  background: color-mix(in srgb, var(--ap-orange) 14%, transparent);
  color: var(--ap-orange);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17.8571rem, 1fr));
  gap: .8571rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cards > li {
  display: flex;
  min-width: 0;
}

.card {
  --tone: var(--ap-blue);
  --tone-soft: var(--ap-blue-soft);
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: .8571rem;
  width: 100%;
  padding: 1.1429rem;
  overflow: hidden;
  border: 1px solid var(--ap-line);
  border-radius: var(--ap-radius);
  background: var(--ap-surface);
  box-shadow: var(--ap-shadow);
  color: inherit;
  text-decoration: none;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}

/* 顶部按服务色调的细发光线 */
.card::before {
  content: '';
  position: absolute;
  left: 1rem;
  right: 1rem;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--tone), transparent);
  box-shadow: 0 0 .8571rem var(--tone);
  opacity: .55;
  transition: opacity .15s;
}

.tone-orange { --tone: var(--ap-orange); --tone-soft: var(--ap-orange-soft); }
.tone-blue { --tone: var(--ap-blue); --tone-soft: var(--ap-blue-soft); }
.tone-mint { --tone: var(--ap-mint); --tone-soft: var(--ap-mint-soft); }
.tone-warning { --tone: var(--ap-warning); --tone-soft: var(--ap-warning-soft); }

a.card:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--tone) 45%, var(--ap-line));
  box-shadow: var(--ap-shadow), 0 0 1.2857rem color-mix(in srgb, var(--tone) 14%, transparent);
}

a.card:hover::before {
  opacity: 1;
}

.card-icon {
  display: grid;
  place-items: center;
  width: 2.7143rem;
  height: 2.7143rem;
  border: 1px solid color-mix(in srgb, var(--tone) 30%, transparent);
  border-radius: .6429rem;
  background: var(--tone-soft);
  color: var(--tone);
}

.card-icon .icon {
  width: 1.4286rem;
  height: 1.4286rem;
}

.card-text {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.card-title {
  color: var(--ap-text);
  font-size: 1rem;
  font-weight: 600;
}

.card-desc {
  color: var(--ap-muted);
  font-size: .8929rem;
  line-height: 1.5;
}

.card-path {
  margin-top: .2857rem;
  color: var(--ap-faint);
  font-family: var(--ap-mono);
  font-size: .7857rem;
}

.card-go {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  color: var(--ap-faint);
  transition: color .15s, transform .15s, background .15s;
}

a.card:hover .card-go {
  transform: translateX(2px);
  background: var(--tone-soft);
  color: var(--tone);
}

.card-locked {
  grid-template-columns: auto minmax(0, 1fr);
  border-style: dashed;
  box-shadow: none;
}

.card-locked::before {
  display: none;
}

.card-locked .card-icon {
  border-color: var(--ap-line);
  background: var(--ap-surface-3);
  color: var(--ap-faint);
}

.card-foot {
  display: inline-flex;
  grid-column: 2;
  align-items: center;
  gap: .4286rem;
  color: var(--ap-warning);
  font-size: .8571rem;
  font-weight: 600;
}

.empty {
  padding: 2rem 1.4286rem;
  border: 1px dashed var(--ap-line-strong);
  border-radius: var(--ap-radius);
  background: var(--ap-surface);
  color: var(--ap-muted);
  font-size: .8929rem;
  text-align: center;
}

/* ---------- guest welcome ---------- */
.welcome {
  position: relative;
  display: grid;
  justify-items: center;
  gap: .7143rem;
  max-width: 40rem;
  margin: 2.8571rem auto 0;
  padding: 2.5714rem 2rem 2.1429rem;
  overflow: hidden;
  border: 1px solid var(--ap-line);
  border-radius: var(--ap-radius);
  background: var(--ap-surface);
  box-shadow: var(--ap-shadow);
  text-align: center;
}

.welcome::before {
  content: '';
  position: absolute;
  left: 1.7143rem;
  right: 1.7143rem;
  top: -1px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--ap-orange), var(--ap-blue) 55%, var(--ap-mint));
  box-shadow: 0 0 1rem color-mix(in srgb, var(--ap-blue) 50%, transparent);
}

.welcome-icon {
  display: grid;
  place-items: center;
  width: 3.4286rem;
  height: 3.4286rem;
  margin-bottom: .2857rem;
  border: 1px solid transparent;
  border-radius: 50%;
  background:
    linear-gradient(var(--ap-surface-2), var(--ap-surface-2)) padding-box,
    linear-gradient(135deg, var(--ap-orange), var(--ap-blue) 55%, var(--ap-mint)) border-box;
  box-shadow: 0 0 1.2857rem color-mix(in srgb, var(--ap-blue) 22%, transparent);
  color: var(--ap-blue);
}

.welcome-icon .icon {
  width: 1.5714rem;
  height: 1.5714rem;
}

.welcome h2 {
  font-size: 1.2857rem;
  font-weight: 650;
}

.welcome p {
  max-width: 30rem;
  color: var(--ap-muted);
  font-size: .9286rem;
  line-height: 1.7;
}

.welcome-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .7143rem;
  margin-top: .7143rem;
}

.welcome-actions > a {
  min-width: 8rem;
}

/* ---------- skeleton ---------- */
.skeleton {
  display: inline-block;
  border-radius: .4286rem;
  background: var(--ap-surface-3);
  animation: shimmer 1.4s ease-in-out infinite;
}

.skeleton-title {
  width: 8.5714rem;
  height: 1.1429rem;
}

.skeleton-icon {
  width: 2.7143rem;
  height: 2.7143rem;
  border-radius: .6429rem;
}

.skeleton-line {
  width: 100%;
  height: .8571rem;
}

.skeleton-line.short {
  width: 60%;
}

.card-skeleton {
  grid-template-columns: auto minmax(0, 1fr);
  box-shadow: none;
}

.card-skeleton::before {
  display: none;
}

.card-skeleton .card-text {
  gap: .5714rem;
  padding-top: .2857rem;
}

/* ---------- profile panel ---------- */
.panel {
  position: sticky;
  top: 1.7143rem;
  min-width: 0;
  padding: 1.1429rem 1.2857rem 1.2857rem;
  overflow: hidden;
  border: 1px solid var(--ap-line);
  border-radius: var(--ap-radius);
  background: var(--ap-surface);
  box-shadow: var(--ap-shadow);
  scroll-margin-top: 1.4286rem;
}

.panel::before {
  content: '';
  position: absolute;
  left: 1.2857rem;
  right: 1.2857rem;
  top: -1px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--ap-orange), var(--ap-blue) 55%, var(--ap-mint));
  box-shadow: 0 0 1rem color-mix(in srgb, var(--ap-blue) 50%, transparent);
  opacity: .8;
}

.panel:focus {
  outline: none;
}

.panel:focus-visible {
  outline: 2px solid var(--ap-blue);
  outline-offset: 2px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8571rem;
  min-height: 2.1429rem;
  margin-bottom: .5714rem;
}

.panel-head h2 {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: 1rem;
  font-weight: 650;
}

.panel-head h2 .icon {
  color: var(--ap-orange);
}

.panel-actions {
  display: flex;
  gap: .5714rem;
}

.fields {
  margin: 0;
}

.field-row {
  display: grid;
  grid-template-columns: 5.4286rem minmax(0, 1fr);
  align-items: baseline;
  gap: .8571rem;
  padding: .7143rem 0;
  border-top: 1px solid var(--ap-line);
}

.field-row:first-child {
  border-top: 0;
}

.field-row dt {
  color: var(--ap-muted);
  font-size: .8571rem;
}

.field-row dd {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4286rem .5714rem;
  min-width: 0;
  margin: 0;
  color: var(--ap-text);
  font-size: .9286rem;
  overflow-wrap: anywhere;
}

.mono {
  font-family: var(--ap-mono);
  font-size: .8214rem;
}

.field-row dd.mono {
  color: var(--ap-text-2);
}

.muted {
  color: var(--ap-faint);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: .4286rem;
  padding: 1px .5714rem;
  border: 1px solid var(--ap-line-strong);
  border-radius: 71.3571rem;
  background: var(--ap-surface-3);
  color: var(--ap-text-2);
  font-size: .7857rem;
  font-weight: 600;
  line-height: 1.2857rem;
  white-space: nowrap;
}

.badge::before {
  content: '';
  width: .4286rem;
  height: .4286rem;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 .5714rem currentColor;
}

.badge-ok {
  border-color: color-mix(in srgb, var(--ap-mint) 40%, transparent);
  background: var(--ap-mint-soft);
  color: var(--ap-mint);
}

.badge-warn {
  border-color: color-mix(in srgb, var(--ap-warning) 40%, transparent);
  background: var(--ap-warning-soft);
  color: var(--ap-warning);
}

.badge-owner {
  border-color: color-mix(in srgb, var(--ap-orange) 45%, transparent);
  background: var(--ap-orange-soft);
  color: var(--ap-orange);
}

.readonly-tag {
  padding: 0 .5rem;
  border: 1px solid var(--ap-line);
  border-radius: 71.3571rem;
  color: var(--ap-faint);
  font-size: .75rem;
  line-height: 1.2143rem;
}

.panel-note {
  margin-top: .4286rem;
  padding-top: .8571rem;
  border-top: 1px solid var(--ap-line);
  color: var(--ap-muted);
  font-size: .8571rem;
  line-height: 1.6;
}

.inline-alert,
.form-alert {
  margin-bottom: .8571rem;
  padding: .6429rem .8571rem;
  border: 1px solid color-mix(in srgb, var(--ap-danger) 40%, transparent);
  border-radius: var(--ap-radius-sm);
  background: var(--ap-danger-soft);
  color: var(--ap-danger);
  font-size: .8929rem;
  overflow-wrap: anywhere;
}

.inline-alert a,
.form-alert a,
.inline-alert .link-button {
  color: inherit;
}

.inline-success {
  margin-bottom: .7143rem;
  padding: .6429rem .8571rem;
  border: 1px solid color-mix(in srgb, var(--ap-mint) 35%, transparent);
  border-radius: var(--ap-radius-sm);
  background: var(--ap-mint-soft);
  color: var(--ap-mint);
  font-size: .8929rem;
}

/* ---------- profile form ---------- */
.profile-form {
  display: grid;
  gap: 1rem;
}

.form-field {
  display: grid;
  gap: .4286rem;
}

.form-field label {
  color: var(--ap-text-2);
  font-size: .8571rem;
  font-weight: 600;
}

.form-field input {
  width: 100%;
  min-width: 0;
  height: 2.7143rem;
  padding: .5714rem .7857rem;
  border: 1px solid var(--ap-line-strong);
  border-radius: var(--ap-radius-sm);
  background: var(--ap-field);
  color: var(--ap-text);
  font-size: .9286rem;
  transition: border-color .15s, box-shadow .15s;
}

.form-field input:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--ap-blue) 40%, var(--ap-line-strong));
}

.form-field input:focus-visible {
  outline: none;
  border-color: var(--ap-blue);
  box-shadow: var(--ap-glow-blue);
}

.form-field input[aria-invalid='true'] {
  border-color: var(--ap-danger);
}

.field-hint {
  color: var(--ap-muted);
  font-size: .8214rem;
}

.field-error {
  color: var(--ap-danger);
  font-size: .8214rem;
  font-weight: 600;
}

.readonly-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4286rem .7143rem;
  padding: .6429rem .8571rem;
  border: 1px solid var(--ap-line);
  border-radius: var(--ap-radius-sm);
  background: var(--ap-surface-2);
  color: var(--ap-muted);
  font-size: .8571rem;
}

.readonly-row strong {
  color: var(--ap-text);
  font-size: .9286rem;
  font-weight: 600;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5714rem;
  padding-top: 2px;
}

/* ---------- footer ---------- */
.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .4286rem 1.1429rem;
  margin-top: 2.8571rem;
  padding-top: 1rem;
  border-top: 1px solid var(--ap-line);
  color: var(--ap-faint);
  font-size: .8214rem;
}

/* ---------- motion ---------- */
@keyframes pulse {
  50% { opacity: .45; }
}

@keyframes shimmer {
  50% { opacity: .55; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------- responsive ---------- */
@media (min-width: 1600px) {
  main {
    padding-left: 3.1429rem;
    padding-right: 3.1429rem;
  }

  .workspace-grid {
    grid-template-columns: minmax(0, 1fr) 27.1429rem;
    gap: 2.1429rem;
  }
}

@media (max-width: 1200px) {
  .app-shell {
    grid-template-columns: 15.4286rem minmax(0, 1fr);
  }

  main {
    padding: 1.7143rem 1.5714rem 1.7143rem;
  }

  .workspace-grid {
    grid-template-columns: minmax(0, 1fr) 21.4286rem;
    gap: 1.2857rem;
  }
}

@media (max-width: 1040px) {
  .workspace-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .panel {
    position: relative;
    top: auto;
  }
}

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

  .sidebar {
    position: static;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: .7143rem .8571rem;
    height: auto;
    padding: .8571rem 1.1429rem;
    border-right: 0;
    border-bottom: 1px solid var(--ap-line);
  }

  .brand {
    padding: 0;
    border: 0;
  }

  .brand-mark {
    width: 2.1429rem;
    height: 2.1429rem;
    border-radius: .5714rem;
  }

  .brand-mark img {
    width: 1.2857rem;
    height: 1.2857rem;
  }

  .brand-text strong {
    font-size: 1rem;
  }

  .brand-text span,
  .sidebar-account,
  .sidebar-heading {
    display: none;
  }

  .sidebar-footer {
    grid-column: 2;
    grid-row: 1;
    margin: 0;
    padding: 0;
    border: 0;
    font-size: .75rem;
  }

  .sidebar-nav {
    display: flex;
    grid-column: 1 / -1;
    gap: .4286rem;
    margin: 0 -.2857rem;
    padding: 2px .2857rem 2px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .sidebar-nav:empty {
    display: none;
  }

  .nav-link {
    flex: 0 0 auto;
    min-height: 2.9286rem;
    padding: .3571rem .8571rem;
    font-size: .9286rem;
  }

  .nav-link.is-active::before {
    display: none;
  }

  main {
    min-height: 0;
    padding: 1.2857rem 1.1429rem 1.7143rem;
  }

  .workspace-header {
    margin-bottom: 1.2857rem;
    padding-bottom: 1.1429rem;
  }

  h1 {
    font-size: 1.5rem;
  }

  .header-actions {
    flex: 1 1 100%;
    justify-content: flex-start;
    gap: .5714rem;
    margin-left: 0;
  }

  .account-area {
    margin-left: auto;
    gap: .5714rem;
  }

  .theme-switch {
    height: 2.9286rem;
  }

  .theme-switch button {
    min-width: 2.7143rem;
    padding: 0;
  }

  .theme-switch .theme-label {
    display: none;
  }

  .header-actions .secondary-button {
    min-height: 2.9286rem;
    padding: .3571rem .7857rem;
    font-size: .9286rem;
  }

  .account-button {
    max-width: 12rem;
    padding: 3px .5714rem 3px .2857rem;
  }

  .console-button .button-label {
    display: none;
  }

  .cards {
    grid-template-columns: minmax(0, 1fr);
    gap: .7143rem;
  }

  .card {
    padding: 1rem;
  }

  .welcome {
    margin-top: .8571rem;
    padding: 2.1429rem 1.2857rem 1.7143rem;
  }

  .panel {
    padding: 1rem 1rem 1.1429rem;
  }

  .footer {
    flex-direction: column;
    margin-top: 2rem;
  }
}

@media (max-width: 380px) {
  .account-button .account-name {
    max-width: 5.1429rem;
  }
}

/* ---------- 顶部时间天气轴（移植自 MXSG 桌面顶栏，按平台配色重绘） ---------- */
.time-weather {
  --wx-sun: #e8a21a;
  --wx-moon: #b9b0ff;
  --wx-snow: #8fd6ff;
  --wx-sunrise: #f2b84b;
  --wx-sunset: #ff8a4c;
  position: relative;
  margin-bottom: 1.5714rem;
  padding: 1.0714rem 1.2857rem 1rem;
  border: 1px solid var(--ap-line);
  border-radius: var(--ap-radius);
  background: var(--ap-surface);
  box-shadow: var(--ap-shadow);
}

:root[data-planner-theme='light'] .time-weather {
  --wx-sun: #d48806;
  --wx-moon: #6d5bd0;
  --wx-snow: #0284c7;
  --wx-sunrise: #b7791f;
  --wx-sunset: #d9480f;
}

.time-weather::before {
  content: '';
  position: absolute;
  left: 1.2857rem;
  right: 1.2857rem;
  top: -1px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--ap-orange), var(--ap-blue) 55%, var(--ap-mint));
  box-shadow: 0 0 1rem color-mix(in srgb, var(--ap-blue) 45%, transparent);
  opacity: .8;
}

.tw-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .8571rem 2.2857rem;
}

.tw-date {
  color: var(--ap-muted);
  font-size: .8571rem;
  font-weight: 600;
}

.tw-digits {
  display: inline-flex;
  align-items: baseline;
  margin-top: .2857rem;
  color: var(--ap-text);
  font-family: var(--ap-mono);
  font-size: 2.7143rem;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  line-height: .95;
  white-space: nowrap;
}

.tw-char {
  display: inline-block;
  min-width: .62em;
  text-align: center;
  transform-origin: 50% 72%;
  animation: tw-digit 360ms cubic-bezier(.18, .9, .2, 1) both;
}

.tw-char--sep {
  min-width: .3em;
  color: var(--ap-faint);
  transform: translateY(-.03em) scale(.82);
  animation: none;
}

@keyframes tw-digit {
  0% { opacity: .68; filter: blur(2px); transform: translateY(.18em) scale(.97); }
  58% { opacity: 1; filter: blur(0); transform: translateY(-.035em) scale(1.01); }
  100% { opacity: 1; filter: blur(0); transform: none; }
}

.tw-summary {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: .8571rem;
  min-width: 0;
  flex: 0 1 34rem;
}

.time-weather--compact .tw-summary {
  grid-template-columns: minmax(0, 1fr);
}

.tw-place {
  position: relative;
}

.tw-place-button {
  display: inline-flex;
  align-items: center;
  gap: .4286rem;
  min-height: 2.5714rem;
  max-width: 13rem;
  padding: 0 .7857rem 0 .6429rem;
  border: 1px solid var(--ap-line-strong);
  border-radius: 999px;
  background: var(--ap-surface-2);
  color: var(--ap-text-2);
  font-size: .8571rem;
  font-weight: 600;
  transition: border-color .15s, box-shadow .15s, color .15s;
}

.tw-place-button > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tw-place-button:hover {
  border-color: color-mix(in srgb, var(--ap-blue) 55%, var(--ap-line-strong));
  color: var(--ap-text);
  box-shadow: 0 0 .8571rem color-mix(in srgb, var(--ap-blue) 16%, transparent);
}

.tw-glyph {
  width: 1.1429rem;
  height: 1.1429rem;
  flex: 0 0 auto;
}

.tw-place-button .tw-glyph:first-child {
  color: var(--ap-orange);
}

.tw-glyph--chevron {
  color: var(--ap-muted);
  transition: transform .15s;
}

.tw-place-button[aria-expanded='true'] .tw-glyph--chevron {
  transform: rotate(180deg);
}

.tw-place-menu {
  position: absolute;
  top: calc(100% + .4286rem);
  left: 0;
  z-index: 30;
  display: grid;
  gap: 2px;
  width: max-content;
  min-width: 15rem;
  padding: .4286rem;
  border: 1px solid var(--ap-line-strong);
  border-radius: var(--ap-radius);
  background: var(--ap-surface);
  box-shadow: var(--ap-shadow-lg);
}

.tw-place-menu button {
  display: flex;
  align-items: center;
  gap: .5rem;
  min-height: 2.5714rem;
  padding: 0 .7143rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ap-text-2);
  font-size: .9286rem;
  text-align: left;
}

.tw-place-menu button:is(:hover, :focus-visible) {
  outline: none;
  background: var(--ap-hover);
  color: var(--ap-text);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ap-blue) 45%, transparent);
}

.tw-place-menu button[aria-checked='true'] {
  background: var(--ap-orange-soft);
  color: var(--ap-text);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ap-orange) 45%, transparent);
}

.tw-place-menu button .tw-glyph {
  color: var(--ap-blue);
}

.tw-menu-heading {
  margin: .4286rem .7143rem .1429rem;
  padding-top: .4286rem;
  border-top: 1px solid var(--ap-line);
  color: var(--ap-muted);
  font-size: .7857rem;
  font-weight: 600;
}

.tw-menu-cities {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2px;
}

.tw-menu-cities button {
  justify-content: center;
}

.tw-now-icon .wx-icon {
  width: 3.1429rem;
  height: 3.1429rem;
}

.tw-now-icon:empty {
  display: none;
}

.tw-now-text {
  display: grid;
  gap: .2143rem;
  min-width: 0;
}

.tw-now-text strong {
  color: var(--ap-text);
  font-size: 1.6429rem;
  font-weight: 650;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.tw-now-text strong:empty {
  display: none;
}

.tw-now-text span {
  overflow: hidden;
  color: var(--ap-muted);
  font-size: .8571rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.time-weather--compact .tw-now-text span {
  white-space: normal;
}

/* 天气图标：线性图标 + 按天气着色 */
.wx-icon {
  width: 1.7143rem;
  height: 1.7143rem;
  flex: 0 0 auto;
  overflow: visible;
}

.wx-icon * {
  stroke: var(--ap-text-2);
}

.wx-icon .wx-sun,
.wx-icon .wx-sun * {
  stroke: var(--wx-sun);
}

.wx-icon .wx-sun circle {
  fill: color-mix(in srgb, var(--wx-sun) 22%, transparent);
}

.wx-icon .wx-moon {
  stroke: var(--wx-moon);
  fill: color-mix(in srgb, var(--wx-moon) 18%, transparent);
}

.wx-icon .wx-cloud {
  fill: var(--ap-surface);
}

.wx-icon .wx-cloud--back {
  fill: none;
  stroke: var(--ap-muted);
}

.wx-icon .wx-rain {
  stroke: var(--ap-blue);
}

.wx-icon .wx-bolt {
  stroke: var(--ap-warning);
}

.wx-icon .wx-snow {
  stroke: var(--wx-snow);
  stroke-width: 2.6;
}

.wx-icon .wx-mist {
  stroke: var(--ap-muted);
}

/* ---------- console ---------- */
.tw-console {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 3.4286rem;
  gap: .7143rem;
  margin-top: .8571rem;
}

.tw-scroll {
  position: relative;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  border-radius: var(--ap-radius-sm);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent);
}

.tw-scroll::-webkit-scrollbar {
  display: none;
}

.tw-scroll:focus-visible {
  outline: 2px solid var(--ap-blue);
  outline-offset: 2px;
}

.tw-timeline {
  position: relative;
  min-width: 100%;
  padding-top: .2857rem;
  cursor: crosshair;
  touch-action: pan-x;
}

.tw-now-line {
  position: absolute;
  top: 0;
  bottom: 2px;
  z-index: 6;
  width: 2px;
  border-radius: 999px;
  background: linear-gradient(180deg, transparent, var(--ap-orange) 12%, color-mix(in srgb, var(--ap-orange) 55%, var(--ap-blue)) 86%, transparent);
  box-shadow: 0 0 1.1429rem color-mix(in srgb, var(--ap-orange) 50%, transparent);
  transform: translateX(-1px);
  pointer-events: none;
}

.tw-now-line span {
  position: absolute;
  top: 0;
  left: 50%;
  border-top: .7857rem solid var(--ap-orange);
  border-right: .4286rem solid transparent;
  border-left: .4286rem solid transparent;
  transform: translateX(-50%);
  filter: drop-shadow(0 0 .4286rem var(--ap-orange));
}

.tw-hover-line {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 7;
  width: 1px;
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--ap-blue) 85%, transparent) 12%, var(--ap-blue) 88%, transparent);
  box-shadow: 0 0 .8571rem color-mix(in srgb, var(--ap-blue) 50%, transparent);
  pointer-events: none;
}

.tw-hover-line span {
  position: absolute;
  top: -1px;
  left: .5rem;
  padding: 2px .5rem;
  border: 1px solid color-mix(in srgb, var(--ap-blue) 40%, transparent);
  border-radius: 999px;
  background: var(--ap-surface);
  color: var(--ap-text);
  font-size: .7143rem;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: var(--ap-shadow);
}

.tw-ruler {
  position: relative;
  height: 3rem;
  margin-bottom: 1.4286rem;
}

.tw-tick {
  position: absolute;
  bottom: 0;
  width: 1px;
  height: .7143rem;
  border-radius: 999px;
  background: var(--ap-line-strong);
  transform: translateX(-.5px);
}

.tw-tick--half {
  height: 1.2143rem;
  background: color-mix(in srgb, var(--ap-muted) 55%, transparent);
}

.tw-tick--hour {
  height: 1.7143rem;
  background: var(--ap-muted);
}

.tw-tick--date {
  width: 2px;
  height: 2.2857rem;
  background: var(--ap-text-2);
  box-shadow: 0 0 .8571rem color-mix(in srgb, var(--ap-text-2) 25%, transparent);
}

.tw-tick b {
  position: absolute;
  bottom: -1.3571rem;
  left: 0;
  color: var(--ap-muted);
  font-size: .7857rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  transform: translateX(-50%);
  white-space: nowrap;
}

.tw-tick--date b {
  bottom: -1.5rem;
  color: var(--ap-text);
  font-size: .8571rem;
}

.tw-sun {
  position: absolute;
  top: 0;
  z-index: 3;
  display: inline-grid;
  grid-template-rows: 1.1429rem 1fr;
  justify-items: center;
  height: 3rem;
  color: var(--wx-sunrise);
  transform: translateX(-50%);
}

.tw-sun--sunset {
  color: var(--wx-sunset);
}

.tw-sun::after {
  content: '';
  width: 1px;
  height: 100%;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 .8571rem currentColor;
}

.tw-sun .tw-glyph {
  width: 1.1429rem;
  height: 1.1429rem;
  filter: drop-shadow(0 0 .4286rem currentColor);
}

.tw-types {
  position: relative;
  height: 2.2857rem;
}

.tw-type {
  position: absolute;
  top: -.2857rem;
  display: inline-flex;
  align-items: center;
  gap: .3571rem;
  max-width: 9rem;
  padding: 2px .5714rem 2px .2857rem;
  border: 1px solid var(--ap-line);
  border-radius: 999px;
  background: var(--ap-surface-2);
  color: var(--ap-text-2);
  transform: translateX(-50%);
}

.tw-type .wx-icon {
  width: 1.5714rem;
  height: 1.5714rem;
}

.tw-type span {
  min-width: 0;
  overflow: hidden;
  font-size: .7857rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tw-type--compact {
  padding-right: .2857rem;
}

.tw-type--compact span {
  display: none;
}

.tw-type--current {
  z-index: 2;
  border-color: color-mix(in srgb, var(--ap-orange) 45%, transparent);
  background: var(--ap-orange-soft);
  color: var(--ap-text);
  box-shadow: 0 0 1rem color-mix(in srgb, var(--ap-orange) 14%, transparent);
  transform: translate(calc(-100% - .5714rem), .2857rem);
}

.tw-temps {
  position: relative;
  height: 4.5714rem;
  margin-top: -.2857rem;
}

.tw-temp-curve {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.tw-temp-curve path {
  fill: none;
  stroke: url(#tw-temp-gradient);
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 .5rem color-mix(in srgb, var(--wx-sun) 30%, transparent));
}

.tw-temp-label {
  position: absolute;
  z-index: 2;
  color: var(--ap-text);
  font-size: .8214rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 .3571rem var(--ap-surface), 0 0 .5714rem var(--ap-surface);
  transform: translate(-50%, -118%);
  pointer-events: none;
}

.tw-temp-label--current {
  color: var(--ap-orange);
}

.tw-temp-hover {
  position: absolute;
  z-index: 8;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.tw-temp-hover b {
  display: block;
  padding: 2px .5rem;
  border: 1px solid color-mix(in srgb, var(--wx-sun) 35%, transparent);
  border-radius: 999px;
  background: var(--ap-surface);
  color: var(--ap-text);
  font-size: .7857rem;
  font-weight: 700;
  box-shadow: var(--ap-shadow);
}

.tw-pops {
  position: relative;
  height: 2.8571rem;
  padding-top: .2857rem;
}

.tw-pop-bars {
  display: grid;
  align-items: end;
  gap: 1px;
  height: 100%;
}

.tw-pop-bars span {
  display: grid;
  justify-items: center;
  height: 100%;
}

.tw-pop-bars i {
  align-self: end;
  display: block;
  width: 100%;
  max-width: 5px;
  border-radius: 999px 999px 1px 1px;
  background: linear-gradient(180deg, var(--ap-blue), color-mix(in srgb, var(--ap-blue) 45%, transparent));
  box-shadow: 0 0 .5rem color-mix(in srgb, var(--ap-blue) 28%, transparent);
}

.tw-pop-hover {
  position: absolute;
  bottom: 0;
  z-index: 8;
  display: grid;
  justify-items: center;
  width: 1rem;
  height: 100%;
  transform: translateX(-50%);
  pointer-events: none;
}

.tw-pop-hover i {
  align-self: end;
  width: 7px;
  border-radius: 999px 999px 1px 1px;
  background: var(--ap-blue);
  box-shadow: 0 0 1rem color-mix(in srgb, var(--ap-blue) 70%, transparent);
}

.tw-pop-hover b {
  position: absolute;
  top: -1.1rem;
  padding: 1px .4286rem;
  border-radius: 999px;
  background: var(--ap-surface);
  color: var(--ap-blue);
  font-size: .7143rem;
  font-weight: 700;
  box-shadow: var(--ap-shadow);
}

.tw-daily {
  display: grid;
  grid-template-columns: repeat(8, minmax(8.5714rem, 1fr));
  gap: .7143rem;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

.tw-daily article {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: .4286rem;
  min-height: 9.2857rem;
  padding: .7143rem;
  border: 1px solid var(--ap-line);
  border-radius: var(--ap-radius);
  background: var(--ap-surface-2);
  text-align: center;
}

.tw-daily .wx-icon {
  width: 2.8571rem;
  height: 2.8571rem;
}

.tw-daily span,
.tw-daily small {
  color: var(--ap-muted);
  font-size: .7857rem;
  font-weight: 600;
}

.tw-daily strong {
  color: var(--ap-text);
  font-size: 1.0714rem;
  font-variant-numeric: tabular-nums;
}

.tw-empty {
  display: grid;
  place-items: center;
  min-height: 7.1429rem;
  border: 1px dashed var(--ap-line-strong);
  border-radius: var(--ap-radius);
  color: var(--ap-muted);
  font-size: .8571rem;
}

.tw-controls {
  display: grid;
  align-content: start;
  justify-items: center;
  gap: .5714rem;
}

.tw-mode {
  position: relative;
  display: grid;
  gap: 2px;
  width: 3.2857rem;
  height: 5.4286rem;
  padding: 3px;
  border: 1px solid var(--ap-line-strong);
  border-radius: 999px;
  background: var(--ap-surface-2);
  color: var(--ap-muted);
}

.tw-mode i {
  position: absolute;
  top: 3px;
  right: 3px;
  left: 3px;
  height: calc(50% - 4px);
  border-radius: 999px;
  background: var(--ap-orange-soft);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ap-orange) 50%, transparent), 0 0 .8571rem color-mix(in srgb, var(--ap-orange) 18%, transparent);
  transition: transform .2s ease;
}

.tw-mode.is-daily i {
  transform: translateY(calc(100% + 2px));
}

.tw-mode span {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  font-size: .7143rem;
  font-weight: 700;
}

.tw-mode:not(.is-daily) span:first-of-type,
.tw-mode.is-daily span:last-of-type {
  color: var(--ap-text);
}

.tw-zoom {
  display: grid;
  gap: .4286rem;
}

.tw-zoom button {
  display: grid;
  place-items: center;
  width: 2.4286rem;
  height: 2.2857rem;
  border: 1px solid var(--ap-line-strong);
  border-radius: var(--ap-radius-sm);
  background: var(--ap-surface-2);
  color: var(--ap-text-2);
  font-size: 1.1429rem;
  font-weight: 700;
  line-height: 1;
}

.tw-zoom button:hover:not(:disabled),
.tw-mode:hover {
  border-color: color-mix(in srgb, var(--ap-blue) 55%, var(--ap-line-strong));
  color: var(--ap-text);
}

.tw-zoom button:disabled {
  cursor: default;
  opacity: .35;
}

.tw-collapse {
  position: absolute;
  bottom: -.6429rem;
  left: 50%;
  z-index: 9;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 1.2857rem;
  padding: 0;
  border: 1px solid var(--ap-line-strong);
  border-radius: 999px;
  background: var(--ap-surface);
  color: var(--ap-muted);
  opacity: 0;
  transform: translateX(-50%);
  transition: opacity .2s, color .15s, box-shadow .15s;
}

.tw-collapse .tw-glyph {
  width: .9286rem;
  height: .9286rem;
  transform: rotate(180deg);
  transition: transform .18s;
}

.tw-collapse.is-collapsed .tw-glyph {
  transform: none;
}

.time-weather:hover .tw-collapse,
.tw-collapse:focus-visible,
.tw-collapse.is-collapsed {
  opacity: .85;
}

.tw-collapse:hover {
  color: var(--ap-text);
  opacity: 1;
  box-shadow: 0 0 1rem color-mix(in srgb, var(--ap-blue) 30%, transparent);
}

@media (hover: none) {
  .tw-collapse {
    opacity: .85;
  }
}

@media (max-width: 720px) {
  .time-weather {
    margin-bottom: 1.2857rem;
    padding: .9286rem;
  }

  .tw-bar {
    gap: .7143rem 1rem;
  }

  .tw-digits {
    font-size: 2.2857rem;
  }

  .tw-summary {
    flex: 1 1 100%;
  }

  .tw-place-button {
    min-height: 2.9286rem;
  }

  .tw-console {
    grid-template-columns: minmax(0, 1fr) 3.1429rem;
    gap: .5rem;
  }

  .tw-mode {
    width: 3rem;
  }

  .tw-zoom button {
    width: 2.7143rem;
    height: 2.7143rem;
  }

  .tw-daily {
    grid-template-columns: repeat(8, minmax(7.1429rem, 1fr));
  }

  .tw-place-menu {
    min-width: min(19rem, calc(100vw - 2.5rem));
  }
}

@media (prefers-reduced-motion: reduce) {
  .tw-char {
    animation: none;
  }
}

/* ---------- 手机：紧凑时间轴 + 应用图标式服务入口 ---------- */
/* 应用图标配色与主题无关（像手机桌面图标一样固定），白色图形在两种主题下都清晰。 */
.tone-orange { --app-a: #ff9a4d; --app-b: #d9500c; }
.tone-blue { --app-a: #5cabff; --app-b: #1c5bcc; }
.tone-mint { --app-a: #3ed29c; --app-b: #0a7f5b; }
.tone-warning { --app-a: #ffc04d; --app-b: #cf7f00; }

@media (max-width: 720px) {
  /* 时间天气轴：更矮、横向更密 */
  .time-weather {
    margin-bottom: 1rem;
    padding: .7143rem .8rem .7rem;
  }

  .tw-bar {
    gap: .3333rem .8rem;
  }

  .tw-date {
    font-size: .7333rem;
  }

  .tw-digits {
    margin-top: .0667rem;
    font-size: 1.8rem;
  }

  .tw-summary {
    gap: .5rem;
  }

  .tw-place-button {
    min-height: 2.3333rem;
    max-width: 11rem;
    padding: 0 .5333rem 0 .4667rem;
    font-size: .8rem;
  }

  .tw-now-icon .wx-icon {
    width: 2.1333rem;
    height: 2.1333rem;
  }

  .tw-now-text strong {
    font-size: 1.2667rem;
  }

  .tw-now-text span {
    font-size: .7333rem;
  }

  .tw-console {
    grid-template-columns: minmax(0, 1fr);
    margin-top: .4rem;
  }

  /* 控件移到时钟同一行的右上角，不再占一整列 */
  .tw-controls {
    position: absolute;
    top: .7143rem;
    right: .8rem;
    display: flex;
    align-items: center;
    gap: .3333rem;
  }

  .tw-mode {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: none;
    width: 5.3333rem;
    height: 2.4rem;
  }

  .tw-mode i {
    top: 3px;
    bottom: 3px;
    right: auto;
    width: calc(50% - 4px);
    height: auto;
  }

  .tw-mode.is-daily i {
    transform: translateX(calc(100% + 2px));
  }

  .tw-zoom {
    display: flex;
    gap: .3333rem;
  }

  .tw-zoom button {
    width: 2.4rem;
    height: 2.4rem;
  }

  .tw-ruler {
    height: 1.7333rem;
    margin-bottom: 1rem;
  }

  .tw-tick {
    height: .4rem;
  }

  .tw-tick--half {
    height: .6rem;
  }

  .tw-tick--hour {
    height: .9333rem;
  }

  .tw-tick--date {
    height: 1.2667rem;
  }

  .tw-tick b {
    bottom: -1.1333rem;
    font-size: .6667rem;
  }

  .tw-tick--date b {
    bottom: -1.2rem;
    font-size: .7333rem;
  }

  .tw-sun {
    grid-template-rows: .9333rem 1fr;
    height: 1.7333rem;
  }

  .tw-sun .tw-glyph {
    width: .9333rem;
    height: .9333rem;
  }

  .tw-types {
    height: 1.4667rem;
  }

  .tw-type {
    top: -.1333rem;
    gap: 0;
    padding: 1px;
  }

  .tw-type span {
    display: none;
  }

  .tw-type .wx-icon {
    width: 1.2rem;
    height: 1.2rem;
  }

  .tw-type--current {
    transform: translate(calc(-100% - .3333rem), .1333rem);
  }

  .tw-temps {
    height: 2.6667rem;
    margin-top: -.1333rem;
  }

  .tw-temp-label {
    font-size: .6667rem;
  }

  .tw-pops {
    height: 1.3333rem;
    padding-top: .1333rem;
  }

  .tw-hover-line span,
  .tw-temp-hover b,
  .tw-pop-hover b {
    font-size: .6667rem;
  }

  .tw-daily {
    grid-template-columns: repeat(8, minmax(5.2rem, 1fr));
    gap: .4rem;
  }

  .tw-daily article {
    gap: .2667rem;
    min-height: 6.4rem;
    padding: .4667rem .3333rem;
  }

  .tw-daily .wx-icon {
    width: 2rem;
    height: 2rem;
  }

  .tw-daily strong {
    font-size: .8667rem;
  }

  .tw-daily span,
  .tw-daily small {
    font-size: .6667rem;
  }

  .tw-empty {
    min-height: 4.2667rem;
  }

  /* 服务入口：手机桌面式应用图标，一行四个 */
  .section-head {
    margin-bottom: .8rem;
  }

  .section-head p {
    display: none;
  }

  .primary-pane {
    gap: 1.3333rem;
  }

  .cards {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.0667rem .4rem;
  }

  .cards > li {
    display: block;
  }

  .card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .4667rem;
    padding: .2667rem 0;
    overflow: visible;
    border: 0;
    border-radius: var(--ap-radius);
    background: none;
    box-shadow: none;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
  }

  .card::before,
  .card-desc,
  .card-path,
  .card-go {
    display: none;
  }

  a.card:hover {
    transform: none;
    box-shadow: none;
  }

  .card-icon {
    width: 3.7333rem;
    height: 3.7333rem;
    border: 0;
    border-radius: 1.0667rem;
    background: linear-gradient(150deg, var(--app-a, var(--ap-blue)), var(--app-b, var(--ap-blue)));
    color: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), inset 0 -1px 0 rgba(0, 0, 0, .12), 0 .4rem .9333rem color-mix(in srgb, var(--app-b, var(--ap-blue)) 32%, transparent);
    transition: transform .15s ease, box-shadow .15s ease;
  }

  .card-icon .icon {
    width: 1.8667rem;
    height: 1.8667rem;
    stroke-width: 1.9;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .25));
  }

  a.card:active .card-icon {
    transform: scale(.93);
  }

  a.card:focus-visible {
    outline-offset: 3px;
  }

  .card-text {
    justify-items: center;
    gap: 0;
    width: 100%;
  }

  .card-title {
    display: -webkit-box;
    max-width: 100%;
    overflow: hidden;
    font-size: .8rem;
    font-weight: 600;
    line-height: 1.3;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .card-locked {
    border: 0;
  }

  .card-locked .card-icon {
    background: var(--ap-surface-3);
    color: var(--ap-faint);
    box-shadow: inset 0 0 0 1px var(--ap-line-strong);
  }

  .card-foot {
    gap: .2rem;
    font-size: .6667rem;
  }

  .card-foot .icon {
    width: .8rem;
    height: .8rem;
  }

  .card-skeleton {
    align-items: center;
  }

  .card-skeleton .skeleton-icon {
    width: 3.7333rem;
    height: 3.7333rem;
    border-radius: 1.0667rem;
  }

  .card-skeleton .card-text {
    width: 70%;
  }

  .card-skeleton .skeleton-line.short {
    display: none;
  }
}

@media (max-width: 380px) {
  .tw-zoom {
    display: none !important;
  }

  .cards {
    gap: .9333rem .2667rem;
  }

  .card-icon {
    width: 3.4667rem;
    height: 3.4667rem;
  }
}
