/* ==========================================================================
   售后反馈协作台 - 现代清爽协作工作台样式（Feishu / Linear 蓝白体系）
   纯净冷灰底 + 纯白表面 + 克制钴蓝强调色，零外部资源
   ========================================================================== */

:root {
  color-scheme: light;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-ink: #1e40af;
  --accent-soft: #eff6ff;
  --accent-subtle: #f5f9ff;
  --accent-border: #bfdbfe;
  --accent-soft-hover: #dbeafe;
  --focus-ring: #3b82f6;
  --focus-ring-on-dark: #dbeafe;
  --focus-glow: 0 0 0 3px rgba(37, 99, 235, 0.14);
  --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");

  --bg-page: #f7f8fa;
  --bg-surface: #ffffff;
  --bg-subtle: #f9fafb;
  --bg-hover: #f8fafc;
  --bg-selected: #eff6ff;
  --bg-muted: #f1f5f9;
  --bg-disabled: #f3f4f6;
  --bg-inverse: #0f172a;
  --table-head-bg: #f8fafc;

  --border-light: #e5e7eb;
  --border-medium: #d1d5db;
  --border-strong: #9ca3af;
  --border-row: #eef2f6;
  --border-on-dark: rgba(255, 255, 255, 0.22);
  --surface-on-dark: rgba(255, 255, 255, 0.10);
  --surface-on-dark-hover: rgba(255, 255, 255, 0.18);

  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;
  --text-disabled: #9ca3af;
  --text-on-dark: #ffffff;
  --text-on-dark-muted: #cbd5e1;

  --danger-700: #dc2626;
  --danger-600: #ef4444;
  --danger-100: #fef2f2;
  --danger-50: #fff5f5;
  --danger-border: #fecaca;
  --danger-surface-dark: #7f1d1d;
  --danger-on-dark: #fca5a5;

  --warn-700: #b45309;
  --warn-100: #fffbeb;
  --warn-50: #fffdf5;
  --warn-border: #fde68a;
  --warn-on-dark: #fcd34d;

  --success-700: #15803d;
  --success-50: #f0fdf4;
  --success-border: #bbf7d0;
  --success-on-dark: #86efac;

  --overlay-backdrop: rgba(15, 23, 42, 0.40);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 48px rgba(15, 23, 42, 0.16);

  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --section-nav-height: calc(52px + env(safe-area-inset-top, 0px));
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

:where(input, textarea) {
  caret-color: var(--accent);
}

input {
  accent-color: var(--accent);
}

::selection {
  background: var(--accent-soft);
  color: var(--text-primary);
}

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

.topbar :is(button, a, select):focus-visible {
  outline-color: var(--focus-ring-on-dark);
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   统一轻顶栏（日常工作 & 系统管理共用）
   ========================================================================== */

.app-topbar {
  --nav-gutter: clamp(12px, 1.6vw, 24px);
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-block-size: var(--section-nav-height);
  padding-block-start: env(safe-area-inset-top, 0px);
  padding-inline: max(var(--nav-gutter), env(safe-area-inset-left, 0px))
    max(var(--nav-gutter), env(safe-area-inset-right, 0px));
  border-block-end: 1px solid var(--border-light);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
}

.app-topbar-left,
.app-topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.app-topbar-right {
  gap: 8px;
  flex-shrink: 0;
}

.app-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.app-brand-mark {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  flex-shrink: 0;
}

.app-brand-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.section-nav {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 8px;
  background: var(--bg-muted);
}

.section-nav > * {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 11px;
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.14s, color 0.14s, box-shadow 0.14s;
}

.section-nav > [aria-current="page"] {
  background: var(--bg-surface);
  color: var(--accent);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.section-nav > a:hover {
  color: var(--text-primary);
}

.section-nav > a:focus-visible {
  outline-offset: 2px;
}

.topbar-actor-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.topbar-actor-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 8px 0 10px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  background: var(--bg-subtle);
  color: var(--text-primary);
  transition: border-color 0.14s, background-color 0.14s;
}

.topbar-actor-pill:hover,
.topbar-actor-pill:focus-within {
  border-color: var(--accent-border);
  background: var(--bg-surface);
}

.topbar-actor-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.topbar-actor-select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  border: none;
  background-color: transparent;
  background-image: var(--select-chevron);
  background-position: right 2px center;
  background-repeat: no-repeat;
  background-size: 14px;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  padding: 2px 20px 2px 2px;
  min-width: 0;
  max-width: 196px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  outline: none;
}

.topbar-actor-select option {
  color: var(--text-primary);
  background: var(--bg-surface);
}

.topbar-auth-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-logout-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 500;
  padding: 2px 4px;
  border-radius: 4px;
  cursor: pointer;
}

.topbar-logout-btn:hover {
  color: var(--danger-700);
  background: var(--danger-100);
}

.login-gate {
  min-height: calc(100dvh - var(--section-nav-height, 52px));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.login-gate-card {
  width: min(380px, 100%);
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  padding: 32px 28px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.login-gate-mark {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--accent);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.24);
}

.login-gate-card h1 {
  margin: 4px 0 0;
  font-size: 19px;
  font-weight: 700;
  color: var(--text-primary);
}

.login-gate-desc {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-secondary);
}

.btn-wecom-login {
  width: 100%;
  margin-top: 8px;
  height: 42px;
  font-size: 14.5px;
  justify-content: center;
  text-decoration: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg-inverse);
  color: var(--text-on-dark);
  border-bottom: 1px solid var(--surface-on-dark);
  box-shadow: var(--shadow-sm);
}

.topbar-inner {
  max-width: 1720px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--surface-on-dark);
  border: 1px solid var(--border-on-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-on-dark);
  flex-shrink: 0;
}

.brand-text {
  min-width: 0;
}

.brand-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-on-dark);
  white-space: nowrap;
}

.brand-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--surface-on-dark);
  border: 1px solid var(--border-on-dark);
  color: var(--text-on-dark-muted);
  white-space: nowrap;
}

.brand-sub {
  margin: 1px 0 0;
  font-size: 12px;
  color: var(--text-on-dark-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px 4px 10px;
  border-radius: 999px;
  background: var(--surface-on-dark);
  border: 1px solid var(--border-on-dark);
  font-size: 12px;
  color: var(--text-on-dark-muted);
  white-space: nowrap;
}

.sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success-on-dark);
}

.sync-pill.is-error .sync-dot {
  background: var(--danger-on-dark);
}

.sync-pill.is-loading .sync-dot {
  background: var(--text-on-dark-muted);
  animation: pulseDot 1s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

.icon-btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: var(--surface-on-dark);
  color: var(--text-on-dark);
  cursor: pointer;
  transition: background 0.15s;
}

.icon-btn-ghost:hover {
  background: var(--surface-on-dark-hover);
}

.icon-btn-ghost.spinning svg {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.actor-switcher {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 8px 4px 11px;
  border-radius: var(--radius-sm);
  background: var(--surface-on-dark);
  border: 1px solid var(--border-on-dark);
}

.actor-switcher-label {
  font-size: 12px;
  color: var(--text-on-dark-muted);
  white-space: nowrap;
}

.actor-select {
  border: none;
  background: transparent;
  color: var(--text-on-dark);
  font-size: 13px;
  font-weight: 600;
  padding: 2px 4px;
  outline: none;
  cursor: pointer;
  max-width: 220px;
}

.actor-select option {
  color: var(--text-primary);
  background: var(--bg-surface);
}

/* ==========================================================================
   按钮体系
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s, transform 0.15s;
  white-space: nowrap;
}

:is(.btn, .icon-btn):disabled {
  background: var(--bg-disabled);
  color: var(--text-disabled);
  border-color: var(--border-light);
  cursor: not-allowed;
}

.btn-accent, .btn-teal {
  background: var(--accent);
  color: var(--text-on-dark);
}

:is(.btn-accent, .btn-teal):hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn-primary {
  border-radius: 8px;
  color: var(--text-on-dark);
}

.btn-primary:not(:disabled) {
  background: linear-gradient(180deg, var(--accent), var(--accent-hover));
  box-shadow: 0 1px 2px rgba(29, 78, 216, 0.22);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #2b67ee, var(--accent));
  box-shadow: 0 2px 5px rgba(29, 78, 216, 0.22);
  transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
  box-shadow: 0 1px 1px rgba(29, 78, 216, 0.16);
  transform: translateY(1px);
}

.btn-primary:disabled {
  box-shadow: none;
}

.btn-teal-soft {
  background: var(--accent-subtle);
  color: var(--accent-ink);
  border-color: var(--accent-soft-hover);
  border-radius: 8px;
}

.btn-teal-soft:hover:not(:disabled) {
  background: var(--accent-soft);
  border-color: var(--accent-border);
}

.btn-outline {
  background: var(--bg-surface);
  color: var(--text-secondary);
  border-color: #dbe2ea;
  border-radius: 8px;
}

.btn-outline:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: #cbd5e1;
  color: var(--text-primary);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 14px;
}

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: var(--bg-surface);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.icon-btn:hover:not(:disabled) {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

/* ==========================================================================
   主工作区布局
   ========================================================================== */

.workspace {
  max-width: 1720px;
  margin: 0 auto;
  padding: 16px 20px 40px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.error-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--danger-50);
  border: 1px solid var(--danger-border);
  color: var(--danger-700);
}

.error-banner-body {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: baseline;
  font-size: 13px;
}

.role-context {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.role-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.role-desc {
  font-size: 13px;
  color: var(--text-secondary);
}

.view-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.view-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-light);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.view-tab:hover {
  border-color: var(--focus-ring);
  color: var(--accent-ink);
}

.view-tab.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--text-on-dark);
}

.view-tab .tab-count {
  font-size: 11px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--bg-muted);
  font-variant-numeric: tabular-nums;
}

.view-tab.is-active .tab-count {
  background: var(--surface-on-dark-hover);
  color: var(--text-on-dark);
}

/* 筛选条 */
.filter-bar {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  flex: 1 1 240px;
  min-width: 200px;
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 34px;
  padding: 0 10px 0 32px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-input:focus {
  border-color: var(--focus-ring);
  box-shadow: var(--focus-glow);
}

.filter-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-select {
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
  cursor: pointer;
}

.filter-select:focus {
  border-color: var(--focus-ring);
  box-shadow: var(--focus-glow);
}

select:is(.filter-select, .form-control) {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: var(--select-chevron);
  background-position: right 8px center;
  background-repeat: no-repeat;
  background-size: 14px;
  padding-block: 0;
  padding-inline-end: 28px;
  line-height: 34px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

select:is(.filter-select, .form-control, .topbar-actor-select, .admin-input)::picker-icon {
  display: none;
}

@media (forced-colors: active) {
  select:is(.filter-select, .form-control) {
    -webkit-appearance: auto;
    appearance: auto;
    background-image: none;
    padding-inline-end: 10px;
  }
}

.list-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px;
  font-size: 12.5px;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.calendar-hint {
  font-size: 12px;
  color: var(--accent-ink);
}

/* ==========================================================================
   桌面表格（列表优先）
   ========================================================================== */

.table-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.table-scroll {
  overflow-x: auto;
}

.ticket-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  min-width: 1240px;
}

.ticket-table:has(.col-support-handler:not([hidden])) {
  min-width: 1320px;
}

.ticket-table th {
  text-align: left;
  padding: 10px 9px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--table-head-bg);
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}

.ticket-table td {
  padding: 10px 9px;
  border-bottom: 1px solid var(--border-row);
  vertical-align: middle;
  font-size: 13.5px;
}

.ticket-table tbody tr {
  cursor: pointer;
  transition: background 0.12s;
}

.ticket-table tbody tr[data-ticket-id] {
  height: 64px;
}

.ticket-table tbody td {
  padding-block: 8px;
}

.ticket-table .ticket-image-slot + .clamp-2 {
  -webkit-line-clamp: 1;
}

.ticket-table tbody tr:hover {
  background: var(--bg-hover);
}

.ticket-table tbody tr.is-selected {
  background: var(--bg-selected);
}

.col-select { width: 34px; text-align: center; }
.col-date { width: 92px; }
.col-project { width: 78px; }
.col-channel { width: 84px; text-align: center; }
.col-order { width: 196px; }
.col-phone { width: 138px; }
.col-author { width: 62px; }
.col-tutor, .col-support-handler { width: 68px; }
.col-status { width: 136px; }
.col-handling { width: 10%; }
.col-review { width: 10%; }

.ticket-table thead th.col-channel,
.ticket-table tbody td.col-channel-cell {
  text-align: center;
}

.ticket-person {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.date-stack {
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}

.date-main {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}

.date-sub {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
}

.channel-platform-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}

.channel-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* 平台彩色文字标签配底色（柔色高辨识度，与蓝白工作台和谐统一） */
.platform-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  border: 1px solid transparent;
  white-space: nowrap;
}

.platform-douyin {
  background: #f1f5f9;
  color: #1e293b;
  border-color: #cbd5e1;
}

.platform-kuaishou {
  background: #fff7ed;
  color: #c2410c;
  border-color: #fed7aa;
}

.platform-shipinhao {
  background: #f0fdf4;
  color: #15803d;
  border-color: #bbf7d0;
}

.platform-xiaohongshu {
  background: #fff1f2;
  color: #e11d48;
  border-color: #fecdd3;
}

.platform-other {
  background: #f8fafc;
  color: #475569;
  border-color: #e2e8f0;
}

.order-cell-main {
  display: block;
  max-width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: -0.01em;
  font-weight: 600;
  color: var(--accent-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.phone-cell {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: -0.02em;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  line-height: 1.4;
}

.cell-muted {
  color: var(--text-muted);
}

.list-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.timing-text {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  border: 1px solid transparent;
}

.row-overdue .timing-text {
  background: var(--danger-100);
  color: var(--danger-700);
  border-color: var(--danger-border);
}

.row-due-soon .timing-text {
  background: var(--warn-100);
  color: var(--warn-700);
  border-color: var(--warn-border);
}

.status-alerts-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.ticket-image-slot {
  margin-bottom: 4px;
}

.ticket-image-slot:empty {
  display: none;
}

#feedback-image-picker {
  padding: 9px 10px;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-md);
  background: var(--bg-hover);
}

#feedback-image-picker .shot-link {
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

#feedback-image-picker .shot-link:not(:disabled) {
  border-color: transparent;
  background: var(--bg-surface);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

#feedback-image-picker .shot-link:hover:not(:disabled) {
  border-color: var(--accent-border);
  background: var(--accent-soft);
}

#feedback-image-picker .shot-hint {
  color: var(--text-muted);
  line-height: 1.4;
}

#feedback-image-picker .shot-previews {
  gap: 8px 12px;
}

#feedback-image-picker .shot-previews:empty {
  display: none;
}

.optional-details > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 8px 11px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: var(--bg-hover);
  color: var(--text-secondary);
  list-style: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  user-select: none;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.optional-details > summary::-webkit-details-marker {
  display: none;
}

.optional-details > summary::before {
  content: "";
  flex: 0 0 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.15s ease-out;
}

.optional-details > summary:hover {
  background: var(--accent-subtle);
  border-color: var(--accent-border);
  color: var(--accent-hover);
}

.optional-details[open] > summary::before {
  transform: rotate(45deg);
}

.check-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: var(--bg-hover);
  line-height: 1.4;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.check-inline:hover {
  border-color: #cbd5e1;
}

.check-inline:has(input:checked) {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--accent-ink);
}

.check-inline input {
  flex: none;
  width: 14px;
  height: 14px;
  margin: 0;
  cursor: inherit;
}

.form-control-wide {
  font-family: var(--font-mono);
  letter-spacing: 0.01em;
}

.ticket-id-line {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.mono-id {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-ink);
}

.order-code {
  margin-top: 3px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  word-break: break-all;
}

.meta-sub-row {
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.mini-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-muted);
  color: var(--text-secondary);
}

.mini-tag.tag-revisit {
  background: var(--warn-100);
  color: var(--warn-700);
}

.mini-tag.tag-same-order {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.project-name {
  font-weight: 700;
  color: var(--text-primary);
}

.kind-name {
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-secondary);
}

.summary-text {
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.contact-hint {
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--text-muted);
}

/* 状态胶囊（按业务语义柔和区分，一眼可扫） */
.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

.status-待分派 {
  background: #f1f5f9;
  color: #475569;
  border-color: #e2e8f0;
}

.status-支持待分派 {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}

.status-待处理 {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.status-跟进中 {
  background: #ecfeff;
  color: #0e7490;
  border-color: #a5f3fc;
}

.status-支持处理中 {
  background: #eef2ff;
  color: #4338ca;
  border-color: #c7d2fe;
}

.status-待核实 {
  background: #f5f3ff;
  color: #6d28d9;
  border-color: #ddd6fe;
}

.status-已处理 {
  background: #f0fdf4;
  color: #15803d;
  border-color: #bbf7d0;
}

.status-已撤回 {
  background: #f3f4f6;
  color: #4b5563;
  border-color: #d1d5db;
}

.role-loading,
.workspace[data-changing] > :not(.role-loading, #global-error-banner),
.workspace[data-changing]:has(#global-error-banner:not(.hidden)) .role-loading { display: none; }
.workspace[data-changing] .role-loading { display: block; color: var(--text-secondary); }

/* SLA 时效胶囊 */
.sla-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.sla-overdue { background: var(--danger-100); color: var(--danger-700); }
.sla-dueSoon { background: var(--warn-100); color: var(--warn-700); }
.sla-normal { background: var(--accent-subtle); color: var(--accent-ink); }
.sla-replied { background: var(--success-50); color: var(--success-700); }
.sla-repliedLate { background: var(--bg-muted); color: var(--text-secondary); }

.time-detail {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.time-detail strong {
  color: var(--text-secondary);
  font-weight: 600;
}

.row-action-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}

.action-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent-ink);
  background: var(--accent-subtle);
  border: 1px solid var(--accent-border);
  padding: 2px 8px;
  border-radius: 999px;
}

.empty-cell, .empty-card {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 13.5px;
}

/* ==========================================================================
   移动端卡片列表
   ========================================================================== */

.mobile-only {
  display: none;
}

.mobile-list {
  flex-direction: column;
  gap: 10px;
}

.ticket-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 13px 14px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
}

.ticket-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.ticket-card-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.ticket-card-summary {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.45;
  word-break: break-word;
}

.ticket-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  font-size: 12px;
  color: var(--text-secondary);
}

.ticket-card-notes {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  color: var(--text-secondary);
}

.ticket-card-note-line {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ticket-card-foot {
  padding-top: 8px;
  border-top: 1px solid var(--border-row);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

.ticket-card-people {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 10px;
  min-width: 0;
}

.ticket-card-person {
  display: inline-flex;
  gap: 3px;
  min-width: 0;
  white-space: nowrap;
}

.ticket-card-person strong {
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
  font-weight: 600;
}

.ticket-card-foot .action-count-badge {
  flex-shrink: 0;
  white-space: nowrap;
}

/* ==========================================================================
   详情抽屉 & 新建弹窗
   ========================================================================== */

.drawer-overlay, .modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
}

.drawer-overlay {
  justify-content: flex-end;
}

.modal-overlay {
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: var(--overlay-backdrop);
  backdrop-filter: blur(2px);
}

.drawer-panel {
  position: relative;
  z-index: 1;
  width: min(560px, 100vw);
  height: 100%;
  background: var(--bg-surface);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(640px, 100%);
  max-height: min(92vh, 860px);
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.drawer-header, .modal-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-subtle);
  flex-shrink: 0;
}

.drawer-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.drawer-title, .modal-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.drawer-title, .modal-title, .shot-heading, .admin-dialog-heading h2 {
  line-height: 1.35;
}

.drawer-subtitle, .modal-subtitle {
  margin: 3px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

.modal-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.drawer-body, .modal-body {
  padding: 16px 18px 28px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* 详情分区 */
.detail-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px;
}

.detail-section-title {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.summary-callout {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
}

.refund-callout {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--warn-50);
  border: 1px solid var(--warn-border);
  color: var(--warn-700);
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.refund-callout-title {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  color: inherit;
  margin-bottom: 3px;
}

.due-alert-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.due-alert {
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.due-alert-danger {
  background: var(--danger-50);
  border: 1px solid var(--danger-border);
  color: var(--danger-700);
}

.due-alert-warn {
  background: var(--warn-50);
  border: 1px solid var(--warn-border);
  color: var(--warn-700);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
  margin-top: 12px;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.info-label {
  font-size: 11.5px;
  color: var(--text-muted);
}

.info-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-word;
}

.info-value.mono {
  font-family: var(--font-mono);
}

/* 详情操作区 */
.action-section {
  background: var(--accent-subtle);
  border-color: var(--accent-border);
}

.action-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.action-pill-btn {
  padding: 6px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-medium);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.14s;
}

.action-pill-btn:hover {
  border-color: var(--focus-ring);
  background: var(--accent-subtle);
  color: var(--accent-ink);
}

.action-pill-btn.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--text-on-dark);
}

.action-pill-btn.is-active:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.action-help {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--text-secondary);
}

.version-notice {
  margin-bottom: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--warn-50);
  border: 1px solid var(--warn-border);
  color: var(--warn-700);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.readonly-action-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

/* 时间线 */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.timeline-item {
  position: relative;
  padding-left: 16px;
  border-left: 2px solid var(--border-light);
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.timeline-item:first-child {
  border-left-color: var(--focus-ring);
}

.timeline-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.timeline-actor {
  font-weight: 700;
  color: var(--text-primary);
}

.timeline-text {
  margin: 3px 0 0;
  font-size: 13px;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
}

/* 同订单历史卡片 */
.order-history-box {
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  background: var(--accent-subtle);
  border: 1px solid var(--accent-border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.order-history-head {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent-ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.related-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.related-item {
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent-border);
  background: var(--bg-surface);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: border-color 0.14s, background 0.14s;
}

.related-item:hover {
  border-color: var(--accent);
  background: var(--accent-subtle);
}

.related-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}

.related-item-summary {
  font-size: 12.5px;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ==========================================================================
   表单样式
   ========================================================================== */

.safety-notice {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--warn-50);
  border: 1px solid var(--warn-border);
  color: var(--warn-700);
  font-size: 12.5px;
  line-height: 1.5;
}

.safety-notice svg {
  flex-shrink: 0;
  margin-top: 2px;
}

.ticket-form {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.req {
  color: var(--danger-600);
}

.form-control {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  background-color: var(--bg-surface);
  font-size: 16px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus {
  border-color: var(--focus-ring);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.form-control:disabled {
  background-color: var(--bg-disabled);
  color: var(--text-disabled);
  cursor: not-allowed;
}

.custom-select-native[hidden], .custom-select-menu[hidden] {
  display: none;
}

:is(.form-control, .admin-input).custom-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  border-radius: 8px;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
}

.custom-select-trigger:disabled {
  background: var(--bg-disabled);
  color: var(--text-disabled);
  cursor: not-allowed;
}

:is(.form-control, .admin-input).custom-select-trigger:is(:focus, [aria-expanded="true"]) {
  border-color: var(--focus-ring);
  box-shadow: var(--focus-glow);
  outline: none;
}

.custom-select-caption {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-select-trigger:not(:disabled) .is-placeholder {
  color: var(--text-muted);
}

.custom-select-arrow {
  flex: 0 0 14px;
  height: 14px;
  background: var(--select-chevron) center / contain no-repeat;
  transition: transform 0.15s ease;
}

.custom-select-trigger[aria-expanded="true"] .custom-select-arrow {
  transform: rotate(180deg);
}

.custom-select-menu {
  position: fixed;
  z-index: 5;
  max-height: 280px;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 4px;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  background: var(--bg-surface);
  box-shadow: var(--shadow-md);
  font-size: 14px;
}

.custom-select-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 8px;
  border-radius: 6px;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.custom-select-option:not([aria-disabled="true"]):is(:hover, .is-active) {
  background: var(--bg-muted);
}

.custom-select-option[aria-selected="true"] {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.custom-select-option[aria-selected="true"].is-active {
  background: var(--accent-soft-hover);
}

.custom-select-option[aria-selected="true"]::after {
  content: "";
  flex: 0 0 6px;
  height: 10px;
  margin-inline: 4px;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg) translate(-1px, -1px);
}

.custom-select-option[aria-disabled="true"] {
  color: var(--text-muted);
  cursor: default;
}

@media (prefers-reduced-motion: reduce) {
  .custom-select-arrow {
    transition: none;
  }
}

:is(.form-control, .search-input)::placeholder {
  color: var(--text-muted);
  opacity: 1;
}

.form-textarea {
  resize: vertical;
  min-height: 82px;
  line-height: 1.5;
}

.field-hint {
  font-size: 13px;
  color: var(--text-muted);
}

.label-with-presets {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.preset-chips {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.chip-btn {
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--accent-border);
  background: var(--accent-subtle);
  color: var(--accent-ink);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}

.chip-btn:hover {
  background: var(--accent-soft);
}

.chip-btn.chip-clear {
  background: var(--bg-surface);
  border-color: var(--border-medium);
  color: var(--text-muted);
}

.inline-error {
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: var(--danger-50);
  border: 1px solid var(--danger-border);
  color: var(--danger-700);
  font-size: 12.5px;
}

.form-footer {
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid var(--border-light);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.form-footer .btn {
  min-height: 36px;
  padding: 0 18px;
  border-radius: 8px;
}

.admin-dialog-footer {
  align-items: center;
}

/* ==========================================================================
   Toast 通知
   ========================================================================== */

.toast-container {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(360px, calc(100vw - 32px));
}

.toast {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-inverse);
  color: var(--text-on-dark);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-on-dark);
  animation: slideUp 0.18s ease-out;
}

.toast.toast-success { border-color: var(--success-on-dark); }
.toast.toast-error { border-color: var(--danger-on-dark); background: var(--danger-surface-dark); }
.toast.toast-warn { border-color: var(--warn-on-dark); }

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

/* ==========================================================================
   响应式适配（平板 & 手机同 URL）
   ========================================================================== */

@media (max-width: 899px) {
  .desktop-only {
    display: none !important;
  }

  .mobile-only {
    display: flex;
  }

  .topbar-inner {
    padding: 10px 12px;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .topbar-actions {
    justify-content: space-between;
    gap: 8px;
  }

  .sync-pill {
    padding: 4px 6px;
  }

  #sync-text {
    display: none;
  }

  .actor-switcher {
    flex: 1;
    min-width: 0;
  }

  .actor-select {
    width: 100%;
    max-width: none;
  }

  .workspace {
    padding: 12px 12px 32px;
  }

  .filter-controls {
    width: 100%;
  }

  .filter-select {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
  }

  .form-grid-2, .info-grid {
    grid-template-columns: 1fr;
  }

  .form-footer .btn {
    min-height: 40px;
  }

  .drawer-panel {
    width: 100vw;
  }

  .modal-overlay {
    padding: 0;
    align-items: flex-end;
  }

  .modal-panel {
    width: 100%;
    max-height: 94vh;
    border-radius: 16px 16px 0 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn-primary,
  .optional-details > summary::before {
    transition: none;
  }

  .btn-primary:is(:hover, :active):not(:disabled) {
    transform: none;
  }

  .sync-pill.is-loading .sync-dot,
  .icon-btn-ghost.spinning svg,
  .toast {
    animation: none;
  }
}
