/* ==========================================================================
   《悦听银龄》· 江苏老年周报制作台 · v2 UI
   现代科技感 + 温暖人文 · 老年友好
   ========================================================================== */

/* ============ Design Tokens ============ */
:root {
  /* 主色调 */
  --brand-primary: #3b82f6;      /* 青蓝 */
  --brand-primary-600: #2563eb;
  --brand-primary-50: #eff6ff;
  --brand-accent: #f97316;       /* 暖橙 */
  --brand-accent-600: #ea580c;
  --brand-accent-50: #fff7ed;
  --brand-gradient: linear-gradient(135deg, #3b82f6 0%, #f97316 100%);
  --brand-gradient-soft: linear-gradient(135deg, rgba(59,130,246,0.10) 0%, rgba(249,115,22,0.10) 100%);

  /* 层次色 */
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-soft: #f1f5f9;
  --border-soft: #e2e8f0;
  --border-strong: #cbd5e1;
  --shadow-card: 0 4px 20px rgba(59,130,246,0.08);
  --shadow-hover: 0 8px 32px rgba(249,115,22,0.15);
  --shadow-brand: 0 12px 32px -8px rgba(59,130,246,0.35);

  /* 文字层次 */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-tertiary: #94a3b8;
  --text-inverse: #ffffff;

  /* 语义色 */
  --success: #10b981;
  --success-bg: #d1fae5;
  --warning: #f59e0b;
  --warning-bg: #fef3c7;
  --danger: #ef4444;
  --danger-bg: #fee2e2;
  --info: #06b6d4;
  --info-bg: #cffafe;

  /* 字体 */
  --font-title: "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: var(--font-title);
  --font-mono: "SF Mono", "Menlo", "Consolas", "Courier New", monospace;

  /* 圆角 */
  --radius-xl: 20px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;

  /* 动效缓动 */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ============ 全局重置 ============ */
* { box-sizing: border-box; }
html, body {
  font-family: var(--font-body);
  background: var(--bg-page);
  color: var(--text-primary);
  min-height: 100vh;
  font-size: 15px;              /* 老年友好基础字号 */
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
[x-cloak] { display: none !important; }

/* ===== API Key 配置弹窗（原生 dialog） ===== */
dialog.settings-dialog {
  border: none;
  border-radius: 16px;
  max-width: 640px;
  width: calc(100% - 40px);
  padding: 0;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  background: #fff;
  overflow: hidden;
}
dialog.settings-dialog::backdrop {
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
}
dialog.settings-dialog[open] {
  animation: dialogFadeIn 0.2s ease-out;
}
/* v3.1 兜底：当 showModal() 失灵时，靠 Alpine 的 x-show 加这个类强制居中显示。
   用 fixed 定位手动居中，并画一层半透明背景板替代 ::backdrop。 */
dialog.settings-dialog.dialog-forced {
  display: block !important;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  z-index: 100000;
  animation: dialogFadeIn 0.2s ease-out;
}
dialog.settings-dialog.dialog-forced::before {
  content: "";
  position: fixed;
  top: -50vh; left: -50vw;
  width: 200vw; height: 200vh;
  background: rgba(15, 23, 42, 0.55);
  z-index: -1;
}
@keyframes dialogFadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}

/* 品牌渐变工具类 */
.brand-gradient {
  background: var(--brand-gradient);
}
.brand-text-gradient {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 6px;
  border: 2px solid var(--bg-page);
}
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ============ 顶部 Header ============ */
.studio-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border-soft);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  position: sticky;
  top: 0;
  z-index: 40;
}
.studio-header .header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-logo .icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--brand-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 22px;
  box-shadow: var(--shadow-brand);
}
.brand-logo .brand-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-primary);
  line-height: 1.1;
}
.brand-logo .brand-title .split {
  color: var(--text-tertiary);
  margin: 0 6px;
  font-weight: 400;
}
.brand-logo .brand-slogan {
  font-size: 12px;
  color: var(--brand-accent);
  margin-top: 2px;
  letter-spacing: 0.4px;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.header-issue-pill {
  padding: 8px 16px;
  background: var(--brand-primary-50);
  color: var(--brand-primary-600);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid #dbeafe;
}
.header-issue-pill b { color: var(--brand-primary); }
.header-version {
  font-size: 12px;
  color: var(--text-tertiary);
  padding: 4px 10px;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
}
.icon-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: all 0.2s;
  cursor: pointer;
  background: transparent;
  border: none;
}
.icon-btn:hover { background: var(--bg-soft); color: var(--brand-primary); }

/* ============ 主布局 ============ */
.studio-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 24px;
}

/* ============ 侧边导航 ============ */
.sidebar {
  position: sticky;
  top: 88px;
  align-self: start;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-card);
  max-height: calc(100vh - 110px);
  display: flex;
  flex-direction: column;
}
.nav-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s var(--ease-out);
  position: relative;
  font-size: 15px;
  min-height: 44px;
}
.nav-item .nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: currentColor;
  opacity: 0.75;
}
.nav-item:hover {
  background: var(--bg-soft);
  color: var(--text-primary);
}
.nav-item.active {
  background: var(--brand-primary-50);
  color: var(--brand-primary-600);
  font-weight: 600;
}
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 10px;
  bottom: 10px;
  width: 3px;
  background: var(--brand-accent);
  border-radius: 0 3px 3px 0;
}
.nav-item.active .nav-icon { opacity: 1; }
.nav-item.disabled { opacity: 0.4; pointer-events: none; }

/* 状态灯 */
.status-panel {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, #ffffff, #f8fafc);
}
.status-title {
  font-size: 11px;
  color: var(--text-tertiary);
  letter-spacing: 1.5px;
  margin-bottom: 8px;
  text-transform: uppercase;
}
.status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  padding: 4px 0;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-tertiary);
  flex-shrink: 0;
}
.status-dot.green { background: var(--success); box-shadow: 0 0 0 3px rgba(16,185,129,0.15); animation: pulse-green 2s infinite; }
.status-dot.gray  { background: var(--text-tertiary); }
.status-dot.red   { background: var(--danger); box-shadow: 0 0 0 3px rgba(239,68,68,0.15); animation: pulse-red 1.5s infinite; }
@keyframes pulse-red {
  0%, 100% { box-shadow: 0 0 0 3px rgba(239,68,68,0.15); }
  50% { box-shadow: 0 0 0 6px rgba(239,68,68,0.05); }
}
@keyframes pulse-green {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16,185,129,0.25); }
  50%       { box-shadow: 0 0 0 6px rgba(16,185,129,0); }
}

/* 日志面板 */
.log-wrap {
  margin-top: 16px;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.log-wrap-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-tertiary);
  margin-bottom: 6px;
  letter-spacing: 1px;
}
.log-panel {
  background: #0f172a;
  color: #94a3b8;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  height: 220px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
}
.log-line { padding: 1px 0; word-break: break-word; }
.log-line.success { color: #4ade80; }
.log-line.error   { color: #f87171; }
.log-line.info    { color: #cbd5e1; }
.log-line.warn    { color: #fbbf24; }

/* ============ 内容区 ============ */
.content-area {
  min-width: 0;
}
.page-section {
  animation: page-in 0.24s var(--ease-out);
}
@keyframes page-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}
.section-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.section-title .title-icon {
  width: 32px;
  height: 32px;
  background: var(--brand-gradient-soft);
  color: var(--brand-primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}
.section-title .title-icon svg { width: 20px; height: 20px; }
.section-subtitle {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-top: 4px;
  font-weight: 400;
  letter-spacing: 0.3px;
}

/* ============ 卡片 ============ */
.studio-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
  border: 1px solid transparent;
  transition: box-shadow 0.24s var(--ease-out), transform 0.24s var(--ease-out);
}
.studio-card.interactive:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(249, 115, 22, 0.15);
}
.studio-card.compact { padding: 16px; }

/* 期刊卡片 · 顶部渐变条 */
.issue-card {
  position: relative;
  overflow: hidden;
}
.issue-card::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 4px;
  background: var(--brand-gradient);
}
.issue-card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}
.issue-card-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 12px;
}
.issue-card-meta .meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.issue-card-meta b { color: var(--text-primary); }

/* 状态徽章 */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.3px;
}
.badge-draft         { background: #f1f5f9; color: #64748b; }
.badge-uploaded      { background: #dbeafe; color: #1d4ed8; }
.badge-pages_ready   { background: #fef3c7; color: #b45309; }
.badge-articles_ready{ background: #ede9fe; color: #6d28d9; }
.badge-audio_ready   { background: var(--success-bg); color: #15803d; }
.badge-archived      { background: var(--info-bg); color: #0e7490; }

/* ============ 进度条 ============ */
.progress-bar {
  height: 8px;
  background: var(--border-soft);
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar > div {
  height: 100%;
  background: var(--brand-gradient);
  background-size: 200% 100%;
  animation: progress-shine 2s linear infinite;
  transition: width 0.3s ease;
}
@keyframes progress-shine {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* 环形进度条（简单版） */
.ring-progress {
  --p: 0;
  --size: 56px;
  --thick: 5px;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background:
    conic-gradient(var(--brand-primary) calc(var(--p) * 1%), var(--border-soft) 0);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.ring-progress::after {
  content: "";
  position: absolute;
  inset: var(--thick);
  border-radius: 50%;
  background: var(--bg-card);
}
.ring-progress .ring-label {
  position: relative;
  font-size: 12px;
  font-weight: 700;
  color: var(--brand-primary-600);
  z-index: 1;
}

/* ============ 按钮 ============ */
.btn-primary,
.btn-ghost,
.btn-success,
.btn-danger,
.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  min-height: 40px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  border: none;
  transition: transform 0.15s var(--ease-out), box-shadow 0.2s, background 0.2s;
  letter-spacing: 0.3px;
  font-family: inherit;
}
.btn-lg { min-height: 48px; padding: 12px 28px; font-size: 15px; }
.btn-sm { min-height: 32px; padding: 6px 14px; font-size: 13px; }
.btn-primary {
  background: var(--brand-gradient);
  color: white;
  box-shadow: 0 6px 20px -6px rgba(59,130,246,0.55);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 10px 24px -6px rgba(249,115,22,0.5);
}
.btn-primary:active:not(:disabled) { transform: scale(0.98); }
.btn-primary:disabled, .btn-ghost:disabled, .btn-success:disabled, .btn-danger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
}
.btn-ghost:hover:not(:disabled) { background: var(--bg-soft); color: var(--text-primary); }
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--brand-primary);
  color: var(--brand-primary-600);
}
.btn-outline:hover:not(:disabled) { background: var(--brand-primary-50); }
.btn-success {
  background: var(--success);
  color: white;
}
.btn-success:hover:not(:disabled) { background: #059669; transform: translateY(-1px); }
.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-danger:hover:not(:disabled) { background: #dc2626; }

/* ============ 表单元素 ============ */
input[type="text"],
input[type="date"],
input[type="email"],
input[type="search"],
select,
textarea {
  font-family: inherit;
  font-size: 14px;
  color: var(--text-primary);
  background: white;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  min-height: 40px;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}
textarea { min-height: 80px; line-height: 1.7; }

/* 上传拖拽区 */
.drop-zone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  transition: all 0.2s;
  background: var(--bg-soft);
  position: relative;
  overflow: hidden;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.drop-zone.dragover, .drop-zone:hover {
  border-color: var(--brand-primary);
  background: var(--brand-primary-50);
}
.drop-zone.done {
  border-style: solid;
  border-color: var(--success);
  background: #f0fdf4;
}
.drop-zone .zone-icon { font-size: 36px; margin-bottom: 8px; }
.drop-zone .zone-title { font-weight: 600; font-size: 15px; color: var(--text-primary); }
.drop-zone .zone-tip { font-size: 12px; color: var(--text-tertiary); margin-top: 4px; }

/* 稿件预览等宽字体 */
.mono {
  font-family: var(--font-mono);
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.75;
  font-size: 13.5px;
}

/* ============ 版面树 ============ */
.page-tree-item {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 40px;
  font-size: 14px;
}
.page-tree-item:hover { background: var(--bg-soft); }
.page-tree-item.active {
  background: var(--brand-primary-50);
  color: var(--brand-primary-600);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--brand-accent);
}

/* ============ 播客分集卡 ============ */
.episode-card {
  border-radius: var(--radius-lg);
  padding: 18px;
  border: 2px solid var(--border-soft);
  background: white;
  transition: all 0.24s var(--ease-out);
  position: relative;
  overflow: hidden;
}
.episode-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(59,130,246,0.4);
}
.episode-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--brand-gradient);
}
.episode-no {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--brand-gradient);
  color: white;
  font-size: 13px;
  font-weight: 700;
  margin-right: 8px;
}
.episode-title-input {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  background: transparent;
  border: none;
  border-bottom: 1px dashed transparent;
  padding: 2px 4px;
  width: calc(100% - 40px);
  min-height: auto;
}
.episode-title-input:focus { border-bottom-color: var(--brand-primary); }
.episode-brief {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 8px 0 12px;
  padding-left: 4px;
}
.episode-meta {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 10px;
  padding-left: 4px;
}
.episode-meta b { color: var(--brand-primary); font-weight: 600; }
.episode-articles {
  border-top: 1px dashed var(--border-soft);
  padding-top: 10px;
  max-height: 220px;
  overflow-y: auto;
}
.episode-article-row {
  padding: 6px 4px;
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: var(--radius-sm);
}
.episode-article-row:hover { background: var(--bg-soft); }
.episode-article-row .page-tag {
  color: var(--text-tertiary);
  font-size: 11px;
  font-weight: 600;
  min-width: 32px;
}

/* 模式选择器（三个大按钮） */
.mode-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}
@media (max-width: 700px) {
  .mode-picker { grid-template-columns: 1fr; }
}
.mode-btn {
  padding: 16px 14px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-soft);
  background: white;
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
  text-align: left;
  font-family: inherit;
  position: relative;
}
.mode-btn:hover { border-color: var(--brand-primary); transform: translateY(-1px); }
.mode-btn.active {
  border-color: var(--brand-primary);
  background: var(--brand-primary-50);
  box-shadow: 0 6px 20px -6px rgba(59,130,246,0.4);
}
.mode-btn.active::after {
  content: "✓";
  position: absolute;
  top: 10px;
  right: 12px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--brand-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}
.mode-btn .mode-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.mode-btn .mode-desc {
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 1.5;
}

/* 波形/音频块占位 */
.waveform-placeholder {
  display: flex;
  align-items: end;
  height: 40px;
  gap: 3px;
  padding: 4px 0;
}
.waveform-placeholder span {
  flex: 1;
  background: var(--brand-gradient);
  border-radius: 2px;
  opacity: 0.35;
  animation: wave 1.2s ease-in-out infinite;
}
.waveform-placeholder span:nth-child(1) { animation-delay: 0.0s; height: 40%; }
.waveform-placeholder span:nth-child(2) { animation-delay: 0.1s; height: 70%; }
.waveform-placeholder span:nth-child(3) { animation-delay: 0.2s; height: 55%; }
.waveform-placeholder span:nth-child(4) { animation-delay: 0.3s; height: 85%; }
.waveform-placeholder span:nth-child(5) { animation-delay: 0.4s; height: 45%; }
.waveform-placeholder span:nth-child(6) { animation-delay: 0.5s; height: 65%; }
.waveform-placeholder span:nth-child(7) { animation-delay: 0.6s; height: 90%; }
.waveform-placeholder span:nth-child(8) { animation-delay: 0.7s; height: 50%; }
.waveform-placeholder span:nth-child(9) { animation-delay: 0.8s; height: 75%; }
.waveform-placeholder span:nth-child(10) { animation-delay: 0.9s; height: 40%; }
@keyframes wave {
  0%, 100% { opacity: 0.35; }
  50%      { opacity: 0.95; }
}

/* ============ 空态 ============ */
.empty-state {
  text-align: center;
  padding: 64px 24px;
}
.empty-emoji {
  font-size: 56px;
  margin-bottom: 12px;
  animation: float 3s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
.empty-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.empty-desc {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-bottom: 20px;
}

/* ============ 骨架屏 ============ */
.skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
  height: 14px;
  margin-bottom: 8px;
}
.skeleton.line-2 { width: 80%; }
.skeleton.line-3 { width: 60%; }
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============ Toast ============ */
.toast-wrap {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  pointer-events: none;
}
.toast {
  background: rgba(15, 23, 42, 0.95);
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  box-shadow: 0 12px 28px rgba(0,0,0,0.25);
  animation: toast-in 0.3s var(--ease-out);
  font-size: 14px;
  max-width: 400px;
  border-left: 4px solid var(--brand-accent);
}
.toast.success { border-left-color: var(--success); }
.toast.error   { border-left-color: var(--danger); }
@keyframes toast-in {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

/* ============ Utility ============ */
.divider {
  height: 1px;
  background: var(--border-soft);
  margin: 16px 0;
}
.text-tertiary { color: var(--text-tertiary); }
.text-secondary { color: var(--text-secondary); }
.text-primary { color: var(--text-primary); }
.text-brand { color: var(--brand-primary-600); }
.text-accent { color: var(--brand-accent); }

/* =========================================================
   v3.0 增强样式：三态徽章 / 真进度上传 / 顶部横条 / 系统诊断
   ========================================================= */

/* ---- 服务状态三态徽章 ---- */
.badge-state {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  font-size: 11px;
  border-radius: 8px;
  font-weight: 500;
  white-space: nowrap;
  line-height: 1.4;
}
.badge-state-off {
  background: rgba(148, 163, 184, 0.15);
  color: #64748b;
  border: 1px solid rgba(148, 163, 184, 0.3);
}
.badge-state-set {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.4);
}
.badge-state-ok {
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
  border: 1px solid rgba(34, 197, 94, 0.4);
}
.badge-state-err {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.5);
  animation: badge-err-blink 1.2s ease-in-out infinite;
}
@keyframes badge-err-blink {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
  50%      { box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15); }
}

/* status-dot 颜色映射（保持与 stateBadge().color 一致）*/
.status-dot.amber { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,.15); }
.status-dot.red   { background: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,.15); animation: badge-err-blink 1.2s ease-in-out infinite; }

/* ---- 顶部横条：黄警告 + 红错误 ---- */
.banner-warn, .banner-error {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  font-size: 13px;
  line-height: 1.5;
  border-bottom: 1px solid transparent;
  animation: slide-down 0.3s ease-out;
}
.banner-warn {
  background: linear-gradient(90deg, rgba(245,158,11,.15), rgba(245,158,11,.08));
  color: #92400e;
  border-color: rgba(245,158,11,.4);
}
.banner-error {
  background: linear-gradient(90deg, rgba(239,68,68,.18), rgba(239,68,68,.08));
  color: #991b1b;
  border-color: rgba(239,68,68,.5);
}
.banner-warn-icon {
  font-size: 16px;
  flex-shrink: 0;
}
.banner-warn-btn {
  margin-left: auto;
  background: rgba(255,255,255,.65);
  border: 1px solid currentColor;
  color: inherit;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
.banner-warn-btn:hover {
  background: rgba(255,255,255,.9);
}
@keyframes slide-down {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* ---- 上传区四态样式 ---- */
.drop-zone.uploading {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.05);
}
.drop-zone.errored {
  border-color: var(--error, #ef4444);
  background: rgba(239, 68, 68, 0.05);
}

.zone-hint {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 4px;
}

/* 真进度条 */
.upload-progress-wrap {
  padding: 4px 8px;
}
.upload-progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(148, 163, 184, 0.2);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
.upload-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #f97316);
  transition: width 0.2s ease-out;
  border-radius: 4px;
  position: relative;
}
.upload-progress-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.5), transparent);
  animation: shimmer-progress 1.2s infinite;
}
@keyframes shimmer-progress {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
.upload-progress-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #3b82f6;
  gap: 8px;
}
.upload-progress-info .text-tertiary {
  font-weight: 400;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 60%;
}

/* ---- 系统诊断弹窗项 ---- */
.diagnose-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.06);
  margin-bottom: 8px;
  border: 1px solid rgba(148, 163, 184, 0.15);
}
.diagnose-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.diagnose-body {
  flex: 1;
  min-width: 0;
}
.diagnose-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.diagnose-hint {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
  word-break: break-all;
}

/* toast info 级别 */
.toast.info { border-left-color: #3b82f6; }
.nav-badge{background:var(--brand-gradient);color:#fff;font-size:10px;padding:1px 6px;border-radius:8px;margin-left:auto;min-width:18px;text-align:center;font-weight:600}
