/* GlassCard shares material without adding wrapper nodes to existing components.
   :where keeps layout/component variants authoritative. No blur on repeated panels. */
:where(.glass-card:not([data-glass-variant="selected"]), .panel, .settings-group, .dashboard-stat, .task-progress-card, .dashboard-playing-card,
       .scraper-settings-list, .scraper-task-card, .scraper-log-card, .access-device-card, .files-list,
       body > header, #drawer, .files-toolbar, dialog, .confirm-dialog-card, .fm-pop, .context-menu) {
  --glass-opacity: var(--glass-surface-opacity);
  --glass-filter: none;
  --glass-radius: var(--radius-surface);
  background: var(--surface); /* opaque fallback without backdrop-filter */
  border: 1px solid var(--glass-border);
  border-radius: var(--glass-radius);
  box-shadow: var(--glass-shadow);
}
:where([data-glass-variant="surface"]) {
  --glass-opacity: var(--glass-surface-opacity);
  --glass-filter: none;
}
:where(.login-card:not([data-glass-variant]), [data-glass-variant="card"]) {
  --glass-opacity: var(--glass-card-opacity);
  --glass-filter: blur(var(--glass-card-blur)) saturate(var(--choice-saturation));
  --glass-radius: var(--radius-modal);
}
:where([data-glass-variant="artwork"]) {
  --glass-opacity: var(--glass-art-opacity);
  --glass-filter: blur(var(--glass-card-blur)) saturate(var(--choice-saturation));
}
:where(body > header:not([data-glass-variant]), #drawer:not([data-glass-variant]), .files-toolbar:not([data-glass-variant]), [data-glass-variant="nav"]) {
  --glass-opacity: var(--glass-nav-opacity);
  --glass-filter: blur(var(--glass-nav-blur)) saturate(var(--choice-saturation));
}
:where(dialog:not([data-glass-variant]), .confirm-dialog-card:not([data-glass-variant]), .fm-pop:not([data-glass-variant]), .context-menu:not([data-glass-variant]), [data-glass-variant="dialog"]) {
  --glass-opacity: var(--glass-dialog-opacity);
  --glass-filter: blur(var(--glass-dialog-blur)) saturate(var(--choice-saturation));
  --glass-radius: var(--radius-modal);
}
/* The existing backdrop owns overlay blur; foregrounds and selected lenses stay crisp. */
:where(dialog, #drawer, :is(dialog, .glass-card):has(.ui-choice, .action-sheet-item, .user-menu-item, .account-menu-item), .fm-pop, .context-menu) { --glass-filter: none; --glass-render: none; }
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :where(.glass-card:not([data-glass-variant="selected"]), .panel, .settings-group, .dashboard-stat, .task-progress-card, .dashboard-playing-card,
       .scraper-settings-list, .scraper-task-card, .scraper-log-card, .access-device-card, .files-list,
         body > header, #drawer, .files-toolbar, dialog, .confirm-dialog-card, .fm-pop, .context-menu) {
    background: rgba(var(--glass-tint), var(--glass-opacity));
    -webkit-backdrop-filter: var(--glass-render, var(--glass-filter));
    backdrop-filter: var(--glass-render, var(--glass-filter));
  }
}
/* Shared homepage backdrop fade; card variants supply their current surface. */
.featured-hero {
  --backdrop-fade: linear-gradient(var(--backdrop-fade-direction, 90deg), var(--backdrop-fade-color, rgba(0,0,0,.85)) var(--backdrop-fade-solid, 0%), var(--backdrop-fade-mid-color, rgba(0,0,0,.35)) var(--backdrop-fade-mid, 48%), transparent var(--backdrop-fade-end, 82%));
}
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  flex-shrink: 0;
  padding: 11px;
  list-style: none;
  color: inherit;
  text-decoration: none;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  filter: none;
  -webkit-tap-highlight-color: transparent;
  transition: opacity var(--motion);
}
button.secondary.icon-button {
  border: 0;
  background: transparent;
}
@media (hover: hover) { .icon-button:not(:disabled):hover {
  background: transparent; opacity: .75;
} }
.icon-button:not(:disabled):active { background: transparent; transform: none; opacity: .6; }
.icon-button::before, .icon-button::after { content: none; }
:is(.icon-button, .action-sheet-item, .user-menu-item, .account-menu-item, .account-menu-avatar, .context-menu-item, .fm-pop button, .scraper-setting-row):is(:focus:not(:focus-visible), [data-pointer-focus]:focus) { outline: none; box-shadow: none; }
.icon-button:focus-visible { outline: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }
.icon-button--setting { color: var(--text-secondary); transition: opacity 120ms ease; }
.icon-button--setting:active { opacity: .72; }
.icon-button::-webkit-details-marker {
  display: none;
}
.icon-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.text-button {
  background: transparent;
  color: var(--accent);
  white-space: nowrap;
}
.section-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.section-heading h2 {
  flex: 1;
}
.section-heading > button:last-child {
  margin-left: auto;
}
.panel,
.settings-group {
  padding: var(--space-5);
  margin-bottom: var(--space-5);
}
.row,
.settings-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  font-size: 16px;
}
.row .info,
.settings-row > span {
  flex: 1;
  min-width: 160px;
}
.row .info p {
  font-size: 14px;
  margin: 6px 0;
}
.row input[type="number"] {
  width: 90px;
}
.settings-row small {
  display: block;
}
.bar,
.form {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 20px 0;
}
.bar input:not([type="checkbox"]),
.form input:not([type="checkbox"]) {
  flex: 1;
}
.form input:not([type="checkbox"]) {
  min-width: 140px;
}
.user-menu {
  position: relative;
}
.user-menu > summary.user-menu-trigger {
  margin: 0;
  min-width: 44px;
  min-height: 44px;
  border: 0;
  box-shadow: none;
  outline: none;
  background: transparent;
  border-radius: 12px;
  -webkit-tap-highlight-color: transparent;
}
.user-menu > summary.user-menu-trigger:active { opacity: .8; }
.user-menu > summary.user-menu-trigger:focus:not(:focus-visible) { outline: none; box-shadow: none; }
.user-menu > summary.user-menu-trigger:focus-visible:not([data-pointer-focus]) { outline: 2px solid color-mix(in srgb, var(--accent) 40%, transparent); outline-offset: 3px; }
.user-menu-trigger-image { border: 0; box-shadow: none; display:block; width:26px; height:26px; border-radius:50%; object-fit:cover; }
.build-footer {
  margin-top: 12px;
  border-top: 1px solid var(--border);
}
.github-revision-link {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px;
  border-radius: 9px;
  color: var(--text-secondary);
  text-decoration: none;
}
.github-revision-link:hover, .github-revision-link:focus-visible {
  color: var(--text);
  background: var(--surface-2);
}
.github-brand-icon {
  flex: none;
  width: 19px;
  height: 19px;
  fill: currentColor;
  stroke: none;
  color: #798cea;
  filter: drop-shadow(0 0 4px rgba(107, 110, 221, .38));
}
.github-revision-link small {
  font-size: 11px;
  overflow-wrap: anywhere;
}
.github-revision-link--menu { min-height: 46px; padding: 5px 0; }
.github-revision-text { display: grid; line-height: 1.35; }
.github-revision-text strong { font-size: 13px; font-weight: 600; color: var(--text); }
dialog {
  width: min(760px, calc(100vw - 24px));
  max-height: 90dvh;
  overflow: auto;
  padding: var(--space-5);
  color: var(--text);
}
dialog.settings-sheet {
  width: min(var(--settings-sheet-width, 480px), calc(100vw - var(--space-5)));
  padding: var(--space-5);
  animation: var(--dialog-animation, dialog-enter var(--motion));
}
.settings-sheet button[type="submit"]:not(.icon-button):not(.primary-action) {
  background: var(--surface-2);
  color: var(--text);
}
dialog.confirm-dialog {
  width: min(380px, calc(100vw - var(--space-5)));
  animation: var(--dialog-animation, dialog-enter var(--motion));
}
@media (max-width: 600px) {
  dialog.settings-sheet,
  dialog.confirm-dialog {
    margin: auto auto 0;
    width: 100%;
    max-width: 100%;
    max-height: 90dvh;
    border-radius: var(--radius-modal) var(--radius-modal) 0 0;
    padding-bottom: max(var(--space-5), env(safe-area-inset-bottom));
  }
}
dialog::backdrop, .context-menu::backdrop, .fm-pop::backdrop {
  background: var(--sheet-backdrop);
  backdrop-filter: var(--sheet-backdrop-blur);
  -webkit-backdrop-filter: var(--sheet-backdrop-blur);
}
/* A nested top-layer modal owns the one visible mask. */
dialog[data-background-modal]::backdrop { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
dialog h2 {
  margin-bottom: 20px;
}
dialog .section-heading h2 {
  margin: 0;
}
.glass-dialog {
  box-shadow: none;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
}
.confirm-dialog-card {
  width: 100%;
  padding: var(--space-5);
}
.confirm-dialog-card h3 {
  margin: 0 0 10px;
}
.confirm-dialog-card p {
  margin: 0 0 20px;
  opacity: 0.8;
}
.confirm-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.confirm-dialog-actions .danger {
  background: var(--danger);
  color: white;
}
dialog[aria-label="搜索"] {
  width: min(560px, calc(100vw - 32px));
  padding: 22px;
}
dialog[aria-label="搜索"] .section-heading {
  margin-bottom: 16px;
}
dialog[aria-label="搜索"] .section-heading .icon-button {
  width: 44px;
  height: 44px;
  min-width: 44px;
  padding: 11px;
}
dialog[aria-label="搜索"] .section-heading .icon-button svg {
  display: block;
  width: 22px;
  height: 22px;
  stroke: var(--text);
}
dialog[aria-label="搜索"] .search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}
dialog[aria-label="搜索"] .search-form input {
  width: 100%;
  min-width: 0;
}
dialog[aria-label="搜索"] .search-form button {
  min-width: 88px;
  white-space: nowrap;
}
.segmented {
  display: flex;
  padding: 4px;
  gap: 4px;
  border-radius: 12px;
  background: var(--surface-2);
}
.segmented button {
  background: transparent;
  color: var(--text);
}
.toast-stack {
  position: fixed;
  inset: auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
  right: 20px;
  bottom: calc(20px + env(safe-area-inset-bottom));
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}
.toast-stack:not(:popover-open) { display: none; }
.toast-item {
  --toast-color: var(--accent);
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  padding: 11px 10px 14px 14px;
  overflow: hidden;
  color: var(--text);
  background: color-mix(in srgb, var(--surface) 62%, transparent);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid color-mix(in srgb, var(--toast-color) 35%, var(--border));
  border-radius: 14px;
  box-shadow: var(--shadow);
  pointer-events: auto;
}
.toast-item--success { --toast-color: var(--success); }
.toast-item--info { --toast-color: var(--accent); }
.toast-item--warning { --toast-color: #ef9b24; }
.toast-item--error { --toast-color: var(--danger); }
.toast-icon { display: grid; flex: 0 0 28px; place-items: center; width: 28px; height: 28px; color: var(--toast-color); border: 1px solid currentColor; border-radius: 50%; font-size: 17px; font-weight: 700; }
.toast-content { display: grid; flex: 1; min-width: 0; gap: 2px; }
.toast-title { font-size: 13px; font-weight: 650; line-height: 1.35; overflow-wrap: anywhere; }
.toast-message { color: var(--text-secondary); font-size: 11px; line-height: 1.35; overflow-wrap: anywhere; }
.toast-message:empty { display: none; }
.toast-close { flex: 0 0 44px; width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 0; border: 0; color: var(--text-secondary); background: transparent; font-size: 20px; }
@media (max-width: 600px) { .toast-stack { left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); width: auto; } }
.empty {
  color: var(--text-secondary);
  padding: 24px 0;
  grid-column: 1/-1;
}
.badge {
  display: inline-block;
  font-size: 13px;
  padding: 4px 8px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text-secondary);
}
.search-form {
  display: flex;
  gap: 12px;
}
.search-form input {
  flex: 1;
  width: 100%;
}
.action-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: var(--action-animation, action-spin .7s linear infinite);
}
@keyframes action-spin { to { transform: rotate(360deg); } }
.page-loading {
  padding: 16px 0;
  color: var(--muted);
}
dialog.page-loading--overlay {
  width: min(280px, calc(100vw - 32px));
  box-sizing: border-box;
  text-align: center;
}
.page-loading--overlay .action-spinner { width: 24px; height: 24px; }
.page-loading--overlay .page-loading { padding-bottom: 0; }
.toggle-label {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}
input.switch {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  width: 46px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  flex: 0 0 46px;
  border: 0;
  border-radius: 20px;
  background: var(--text-secondary);
  background-image: none;
  box-shadow: none;
  -webkit-box-shadow: none;
  cursor: pointer;
}
input.switch:before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: none;
  -webkit-box-shadow: none;
  transition: transform var(--motion);
}
input.switch:checked {
  background: var(--success);
  background-image: none;
}
input.switch:checked:before {
  transform: translateX(18px);
}
.login-page {
  isolation: isolate;
  min-height: 70dvh;
  display: grid;
  place-items: center;
}
.login-background-layer { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: -1; }
.login-background-layer::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, rgba(255,255,255,.48), rgba(255,255,255,.16) 48%, rgba(255,255,255,0) 85%); }
.login-background { width: 100%; height: 100%; background-size: cover; background-position: center; background-repeat: no-repeat; transform: none; filter: none; opacity: 0; transition: opacity 220ms ease; }
.login-background.is-loaded { opacity: 1; }
@media (max-width: 768px) and (orientation: portrait) {
  .login-background-layer { inset: 0 0 auto; height: auto; aspect-ratio: 16 / 10; mask-image: linear-gradient(#000 72%, transparent); }
}
.login-submit { display: flex; align-items: center; justify-content: center; gap: 10px; }
.login-spinner { width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: login-spin .7s linear infinite; }
@keyframes login-spin { to { transform: rotate(360deg); } }
.login-card {
  /* Keep the login form and background artwork crisp. */
  --glass-filter: none;
  --glass-shadow: inset 0 1px 0 var(--glass-border);
  min-width: 0;
  box-sizing: border-box;
  width: min(380px, 100%);
  padding: var(--space-6);
}
.login-mark {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 24px;
  text-align: center;
  overflow-wrap: anywhere;
  min-height: 1.5em;
}
.login-mark > span {
  display: inline-block;
  max-width: 100%;
}
.login-form input { font-size: 16px; } /* Prevent iOS focus zoom. */
.login-form {
  display: grid;
  gap: 16px;
}
.login {
  max-width: 430px;
  margin: 8vh auto;
}
.login form {
  display: grid;
  gap: 16px;
}
html:has(dialog.bottom-sheet[open]),
body:has(dialog.bottom-sheet[open]) { overflow: hidden; }
dialog.bottom-sheet {
  --dialog-animation: none;
  touch-action: pan-y pinch-zoom;
  position: fixed;
  inset: auto 0 max(10px, env(safe-area-inset-bottom));
  margin: 0 auto;
  width: min(520px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 24px);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  --glass-radius: var(--radius-sheet);
  padding: 8px 8px max(12px, env(safe-area-inset-bottom));
  transform: translate3d(0,0,0);
  opacity: 1;
  transition: transform var(--sheet-duration) var(--sheet-ease), opacity var(--sheet-duration) var(--sheet-ease);
}
/* Dialog focus must not inherit the global outline; child keyboard focus stays visible. */
dialog.bottom-sheet:focus { outline: 0; }
dialog.bottom-sheet::backdrop {
  animation: sheet-backdrop-enter var(--sheet-duration) var(--sheet-ease) both;
}
dialog.bottom-sheet.is-dragging { transition: none; }
dialog.bottom-sheet.is-entering, dialog.bottom-sheet.is-closing { transform: translate3d(0,100%,0); opacity: 0; }
dialog.bottom-sheet.is-closing::backdrop { animation: sheet-backdrop-exit var(--sheet-duration) var(--sheet-ease) both; }
@keyframes dialog-enter { from { opacity: 0; transform: translateY(32px); } to { opacity: 1; transform: translateY(0); } }
@keyframes sheet-backdrop-enter { from { opacity: 0; transform: translate3d(0,2px,0); } to { opacity: 1; transform: translate3d(0,0,0); } }
@keyframes sheet-backdrop-exit { from { opacity: 1; transform: translate3d(0,0,0); } to { opacity: 0; transform: translate3d(0,2px,0); } }
.sheet-drag-indicator {
  touch-action: none;
  display: block;
  width: 36px;
  height: 4px;
  margin: 0 auto 8px;
  border-radius: 999px;
  background: var(--text-secondary);
  opacity: .48;
}
.sheet-heading {
  touch-action: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px 4px 14px;
}
.sheet-heading h2 { flex: 1; margin: 0; font-size: 17px; font-weight: 600; }
dialog.bottom-sheet--account-menu {
  width: min(360px, calc(100vw - 24px));
  padding: 0;
  --glass-radius: var(--radius-account-menu);
}
.account-menu-content {
  min-width: 0;
  --account-menu-padding: 24px;
  --account-menu-gap: 16px;
  padding: 12px 0 calc(16px + env(safe-area-inset-bottom));
  font: 15px/1.5 var(--font);
}
.account-menu-header {
  touch-action: none;
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  padding: 4px var(--account-menu-padding) 10px;
}
.account-menu-avatar {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--accent);
  font-size: 19px;
  font-weight: 600;
  border: 0;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  outline: 0;
}
.account-menu-avatar-image { border: 0; box-shadow: none; display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.account-menu-avatar:focus-visible { outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 3px; }
.account-menu-identity { min-width: 0; }
.account-menu-close { display: none; margin-left: auto; flex: none; }
.account-menu-identity strong,
.account-menu-identity small {
  display: block;
  overflow-wrap: anywhere;
}
.account-menu-identity strong { margin-bottom: 4px; font-size: 16px; font-weight: 600; }
.account-menu-identity small { font-size: 14px; color: var(--text-secondary); }
.account-menu-list { padding: 4px 0 0; }
.account-menu-item {
  display: flex;
  align-items: center;
  gap: var(--account-menu-gap);
  width: 100%;
  min-height: 52px;
  padding: 10px var(--account-menu-padding);
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 15px;
  font-weight: 400;
  text-align: left;
  touch-action: manipulation;
}

.account-menu-item[hidden] { display: none; }
.account-menu-item--danger {
  color: var(--danger);
  position: relative;
  margin-top: 8px;
}
.account-menu-label { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.account-menu-icon { display: inline-flex; align-items: center; justify-content: center; width: 24px; flex: 0 0 24px; color: var(--text-secondary); }
.account-menu-item--danger .account-menu-icon { color: var(--danger); }
.account-menu-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.account-menu-version {
  padding: 8px var(--account-menu-padding) 0;
  color: var(--text-secondary);
  font-size: 13px;
  overflow-wrap: anywhere;
}
@media (max-width: 600px) {
  dialog.bottom-sheet--account-menu {
    inset: auto 0 0;
    width: 100%;
    max-width: 100%;
    border-radius: 22px 22px 0 0;
  }
}
@media (min-width: 601px) {
  dialog.bottom-sheet--account-menu {
    inset: max(70px, calc(env(safe-area-inset-top) + 66px)) 4vw auto auto;
    margin: 0;
    max-height: calc(100dvh - 90px);
  }
}
@media (prefers-reduced-motion: reduce) {
  dialog.bottom-sheet--account-menu,
  dialog.bottom-sheet--account-menu.is-closing { animation: none; }
}
.user-menu-list, .action-sheet-list { display: flex; flex-direction: column; gap: 4px; padding-bottom: 2px; }
.user-menu-item, .action-sheet-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 50px;
  padding: 0 14px;
  border: 0;
  box-shadow: none;
  outline: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  text-align: left;
  font-size: 16px;
  font-weight: 500;
  touch-action: manipulation;
  transition: transform 150ms ease-out, background 150ms ease-out;
}
.user-menu-item--danger { margin-top: 8px; color: var(--danger); }
.action-sheet-content > p, .action-sheet-content > div:not(.action-sheet-list) { margin: 8px 14px 12px; }
.context-menu { position: fixed; inset: auto; margin: 0; box-sizing: border-box; width: 220px; max-width: calc(100vw - 16px); max-height: calc(100dvh - 16px); overflow: auto; padding: 6px; color: var(--text); border: 1px solid var(--glass-border); border-radius: var(--glass-radius); }
.context-menu-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 42px; padding: 8px 12px; text-align: left; background: transparent; border: 0; color: inherit; }
.context-menu-item--danger { color: var(--danger); }
.action-menu-icon { display: inline-flex; flex: none; width: 20px; height: 20px; }
.action-menu-icon .fm-icon { width: 20px; height: 20px; color: inherit; }
.action-menu-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.action-sheet-item--danger { color: var(--danger); }
.action-sheet-item:not(.action-sheet-item--danger) + .action-sheet-item--danger { margin-top: 8px; }
.action-sheet-item--cancel { margin-top: 8px; }
.action-sheet-content--ordered .action-sheet-item--cancel { position: sticky; bottom: 0; z-index: 1; background: rgba(var(--glass-tint), var(--glass-dialog-opacity)); }
.user-menu-icon, .user-menu-chevron { display: inline-flex; flex: none; align-items: center; justify-content: center; }
.user-menu-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.user-menu-label { flex: 1; min-width: 0; }
.user-menu-chevron { color: var(--text-secondary); }
.user-menu-chevron svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; transform: rotate(180deg); }
.user-menu-item:active, .action-sheet-item:active { transform: none; }
@media (prefers-reduced-motion: reduce) {
  dialog.bottom-sheet, dialog.bottom-sheet::backdrop,
  dialog.bottom-sheet.is-closing, dialog.bottom-sheet.is-closing::backdrop { animation: none; transition: none; }
  .user-menu-item, .action-sheet-item { transition: none; }
  .user-menu-item:active, .action-sheet-item:active { transform: none; }
}

@media (max-width: 600px) {
  dialog {
    padding: 20px;
  }
  .panel {
    padding: 18px;
  }
  .search-form {
    flex-wrap: wrap;
  }
  dialog[aria-label="搜索"] {
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
    padding: 18px;
    border-radius: 22px;
  }
  dialog[aria-label="搜索"] .section-heading {
    gap: 10px;
    margin-bottom: 14px;
  }
  dialog[aria-label="搜索"] .section-heading h2 {
    font-size: 24px;
  }
  dialog[aria-label="搜索"] .search-form {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }
  dialog[aria-label="搜索"] .search-form input {
    min-height: 52px;
    padding-inline: 14px;
  }
  dialog[aria-label="搜索"] .search-form button {
    min-height: 52px;
    min-width: 78px;
    padding-inline: 16px;
  }
}

.image-cropper {
  width: min(390px, calc(100vw - 24px));
  max-height: calc(100dvh - 32px);
  padding: 20px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 21px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.image-cropper h2 { margin: 0 0 16px; font-size: 17px; font-weight: 600; }
.image-cropper-stage { overflow: hidden; border-radius: 13px; background: var(--surface-2); }
.image-cropper-mask { position: relative; }
.image-cropper-canvas { display: block; width: 100%; height: auto; touch-action: none; cursor: grab; }
.image-cropper-canvas:active { cursor: grabbing; }
.image-cropper-zoom { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.image-cropper-zoom input { flex: 1; min-width: 0; accent-color: var(--accent); }
.image-cropper-zoom button { flex: 0 0 44px; min-width: 44px; width: 44px; height: 44px; min-height: 44px; padding: 0; border-radius: 50%; }
.image-cropper-toolbar { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.image-cropper-toolbar button { min-height: 44px; padding: 8px 12px; font-size: 13px; }
.image-cropper-actions { display: flex; gap: 10px; margin-top: 20px; }
.image-cropper-actions button { flex: 1; min-height: 44px; }
.image-cropper-remove { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, var(--border)); background: transparent; }
.image-cropper-remove:hover { background: color-mix(in srgb, var(--danger) 8%, transparent); }
@media (max-width: 600px) {
  .image-cropper--sheet { inset: auto 0 0; margin: auto auto 0; width: 100%; max-height: calc(100dvh - 20px); padding: 20px 20px max(20px, env(safe-area-inset-bottom)); border-radius: 21px 21px 0 0; }
}
