/* ===== iOS 27 · Liquid Glass 设计系统 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* 配色：浅色 */
  --bg: #f2f3f7;
  --bg-gradient: radial-gradient(120% 80% at 50% 0%, #e9ecf5 0%, #f5f6fa 45%, #eceef4 100%);
  --glass: rgba(255, 255, 255, 0.55);
  --glass-strong: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.65);
  --glass-shadow: 0 8px 32px rgba(15, 23, 42, 0.08), 0 2px 8px rgba(15, 23, 42, 0.04);
  --fg: #1c1c1e;
  --fg-secondary: #3a3a3c;
  --muted: #8e8e93;
  --separator: rgba(60, 60, 67, 0.12);
  --accent: #0a84ff;
  --accent-grad: linear-gradient(135deg, #0a84ff, #5e5ce6);
  --accent-press: #0066cc;
  --success: #30d158;
  --warning: #ff9f0a;
  --error: #ff453a;
  --fill: rgba(120, 120, 128, 0.12);
  --fill-active: rgba(120, 120, 128, 0.24);
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --radius-pill: 999px;
  --blur: 24px;
  --saturate: 1.8;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --nav-h: 64px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-gradient: radial-gradient(120% 80% at 50% 0%, #1a1a2e 0%, #0d0d1a 45%, #000000 100%);
    --glass: rgba(28, 28, 30, 0.6);
    --glass-strong: rgba(44, 44, 46, 0.78);
    --glass-border: rgba(255, 255, 255, 0.12);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.3);
    --fg: #f5f5f7;
    --fg-secondary: #d1d1d6;
    --muted: #98989f;
    --separator: rgba(84, 84, 88, 0.36);
    --accent: #0a84ff;
    --accent-grad: linear-gradient(135deg, #0a84ff, #5e5ce6);
    --accent-press: #3a9bff;
    --fill: rgba(120, 120, 128, 0.24);
    --fill-active: rgba(120, 120, 128, 0.36);
  }
}

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display', system-ui, sans-serif;
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--fg);
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* ===== 流光背景 ===== */
.aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.aurora::before, .aurora::after {
  content: ''; position: absolute; width: 60vw; height: 60vw; border-radius: 50%;
  filter: blur(80px); opacity: 0.35; animation: drift 24s var(--ease) infinite alternate;
}
.aurora::before { background: radial-gradient(circle, #0a84ff, transparent 70%); top: -20vw; left: -10vw; }
.aurora::after { background: radial-gradient(circle, #5e5ce6, transparent 70%); bottom: -20vw; right: -10vw; animation-delay: -12s; }
@media (prefers-color-scheme: dark) { .aurora::before, .aurora::after { opacity: 0.22; } }
@keyframes drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(8vw, 6vw) scale(1.15); } }

/* ===== 玻璃材质 ===== */
.glass {
  background: var(--glass);
  backdrop-filter: blur(var(--blur)) saturate(var(--saturate));
  -webkit-backdrop-filter: blur(var(--blur)) saturate(var(--saturate));
  border: 0.5px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}

/* ===== 导航栏 ===== */
.navbar {
  position: sticky; top: 0; z-index: 100; height: var(--nav-h);
  display: flex; align-items: center; justify-content: center;
  background: var(--glass);
  backdrop-filter: blur(var(--blur)) saturate(var(--saturate));
  -webkit-backdrop-filter: blur(var(--blur)) saturate(var(--saturate));
  border-bottom: 0.5px solid var(--separator);
}
.nav-inner { width: 100%; max-width: 920px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--fg); font-weight: 600; font-size: 17px; letter-spacing: -0.02em; }
.logo-mark {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  background: var(--accent-grad); color: #fff; font-size: 18px; box-shadow: 0 2px 8px rgba(10, 132, 255, 0.4);
}
.nav-tabs { display: flex; gap: 2px; padding: 3px; border-radius: var(--radius-pill); background: var(--fill); }
.nav-tab {
  appearance: none; border: none; background: transparent; color: var(--muted);
  padding: 7px 16px; border-radius: var(--radius-pill); font-size: 14px; font-weight: 500;
  cursor: pointer; transition: color 0.25s var(--ease), background 0.25s var(--ease);
  white-space: nowrap; font-family: inherit;
}
.nav-tab.active { background: var(--glass-strong); color: var(--fg); box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.nav-tab:not(.active):hover { color: var(--fg-secondary); }

/* ===== 主区域 ===== */
.main { flex: 1; width: 100%; max-width: 920px; margin: 0 auto; padding: 24px 16px 48px; }
.view { display: none; animation: viewIn 0.4s var(--ease); }
.view.active { display: block; }
@keyframes viewIn { from { opacity: 0; transform: translateY(12px) scale(0.99); } to { opacity: 1; transform: none; } }

/* ===== Hero ===== */
.hero { text-align: center; padding: 32px 0 28px; }
.hero-title {
  font-size: clamp(28px, 6vw, 40px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.1;
  background: var(--accent-grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  padding: 0 4px; margin: -4px 0;
}
.hero-sub { margin-top: 10px; color: var(--muted); font-size: 15px; max-width: 540px; margin-inline: auto; }

/* ===== 卡片 ===== */
.card { border-radius: var(--radius-lg); padding: 24px; margin-bottom: 20px; }
.card-title { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 4px; }
.card-desc { color: var(--muted); font-size: 13px; margin-bottom: 18px; }

/* ===== 输入框 ===== */
.field { position: relative; display: flex; gap: 10px; }
.input {
  flex: 1; appearance: none; border: 0.5px solid var(--separator); border-radius: var(--radius-md);
  background: var(--fill); color: var(--fg); padding: 14px 16px; font-size: 16px; font-family: inherit;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), box-shadow 0.2s var(--ease);
  min-width: 0;
}
.input::placeholder { color: var(--muted); }
.input:focus { outline: none; border-color: var(--accent); background: var(--glass-strong); box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.15); }
textarea.input { resize: vertical; min-height: 120px; line-height: 1.6; font-family: ui-monospace, 'SF Mono', monospace; font-size: 14px; }
.label { display: block; font-size: 13px; font-weight: 600; color: var(--fg-secondary); margin-bottom: 8px; padding-left: 4px; }
.help { font-size: 12px; color: var(--muted); margin-top: 6px; padding-left: 4px; }
.form-group { margin-bottom: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ===== 按钮 ===== */
.btn {
  appearance: none; border: none; border-radius: var(--radius-md); font-family: inherit;
  font-size: 16px; font-weight: 600; padding: 14px 24px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform 0.15s var(--ease), background 0.2s var(--ease), opacity 0.2s var(--ease);
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent-grad); color: #fff; box-shadow: 0 4px 14px rgba(10, 132, 255, 0.35); }
.btn-primary:hover { filter: brightness(1.05); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-full { width: 100%; }
.btn-ghost { background: var(--fill); color: var(--fg); }
.btn-ghost:hover { background: var(--fill-active); }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: var(--radius-sm); }

/* ===== 开关 ===== */
.switch { position: relative; display: inline-block; width: 51px; height: 31px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-track { position: absolute; inset: 0; background: var(--fill-active); border-radius: var(--radius-pill); transition: background 0.25s var(--ease); }
.switch-track::after { content: ''; position: absolute; width: 27px; height: 27px; top: 2px; left: 2px; background: #fff; border-radius: 50%; box-shadow: 0 2px 6px rgba(0,0,0,0.2); transition: transform 0.25s var(--ease-spring); }
.switch input:checked + .switch-track { background: var(--success); }
.switch input:checked + .switch-track::after { transform: translateX(20px); }
.switch-row { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.switch-label { font-size: 14px; font-weight: 500; cursor: pointer; }

/* ===== 状态提示 ===== */
.status { padding: 12px 16px; border-radius: var(--radius-md); font-size: 14px; font-weight: 500; margin-bottom: 16px; display: none; }
.status.show { display: block; animation: viewIn 0.25s var(--ease); }
.status-success { background: rgba(48, 209, 88, 0.14); color: var(--success); }
.status-error { background: rgba(255, 69, 58, 0.14); color: var(--error); }
.status-warning { background: rgba(255, 159, 10, 0.14); color: var(--warning); }

/* ===== 输出框 ===== */
.output { margin-top: 18px; }
.output-box {
  background: var(--fill); border: 0.5px solid var(--separator); border-radius: var(--radius-md);
  padding: 14px 16px; font-family: ui-monospace, 'SF Mono', monospace; font-size: 13px;
  word-break: break-all; word-wrap: break-word; overflow-wrap: anywhere; margin-bottom: 12px; line-height: 1.5;
}
.output-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ===== 加载动画 ===== */
.spinner { width: 16px; height: 16px; border: 2px solid transparent; border-top-color: currentColor; border-radius: 50%; animation: spin 0.7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-center { text-align: center; padding: 40px 0; }
.spinner-lg { width: 32px; height: 32px; border: 3px solid var(--fill); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; margin: 0 auto 12px; }

/* ===== Toast（修复：空内容时隐藏） ===== */
.toast {
  position: fixed; top: calc(var(--nav-h) + 12px); left: 50%; transform: translateX(-50%) translateY(-150%);
  background: var(--glass-strong); backdrop-filter: blur(var(--blur)) saturate(var(--saturate)); -webkit-backdrop-filter: blur(var(--blur)) saturate(var(--saturate));
  border: 0.5px solid var(--glass-border); color: var(--fg); padding: 12px 20px; border-radius: var(--radius-pill);
  font-size: 14px; font-weight: 500; box-shadow: var(--glass-shadow); z-index: 200;
  transition: transform 0.4s var(--ease-spring), opacity 0.4s var(--ease), visibility 0.4s var(--ease);
  pointer-events: none; max-width: 90vw; white-space: nowrap;
  opacity: 0; visibility: hidden;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; visibility: visible; }

/* ===== 模态框 ===== */
.modal { position: fixed; inset: 0; z-index: 150; display: none; align-items: flex-end; justify-content: center; background: rgba(0,0,0,0.3); }
.modal.show { display: flex; animation: fadeIn 0.25s var(--ease); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  width: 100%; max-width: 560px; max-height: 85vh; overflow-y: auto; border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 8px 24px calc(24px + env(safe-area-inset-bottom)); margin: 0;
  animation: sheetUp 0.4s var(--ease);
}
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal-grab { width: 36px; height: 5px; border-radius: var(--radius-pill); background: var(--fill-active); margin: 8px auto 16px; }
.modal-title { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 4px; }
.modal-sub { color: var(--muted); font-size: 14px; margin-bottom: 20px; }
.modal-close { position: sticky; top: 0; float: right; margin: -4px -12px 0 0; background: var(--fill); border: none; width: 30px; height: 30px; border-radius: 50%; color: var(--fg); font-size: 16px; cursor: pointer; display: grid; place-items: center; }
.modal-close:hover { background: var(--fill-active); }

/* ===== Docker 示例 ===== */
.example { background: var(--fill); border-radius: var(--radius-md); padding: 12px 14px; font-family: ui-monospace, monospace; font-size: 13px; line-height: 1.7; margin-bottom: 10px; }
.example strong { color: var(--fg); display: block; font-family: inherit; font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.example code { color: var(--accent); word-break: break-all; word-wrap: break-word; overflow-wrap: anywhere; }

/* ===== 搜索结果 ===== */
.result-card { background: var(--glass); backdrop-filter: blur(var(--blur)) saturate(var(--saturate)); -webkit-backdrop-filter: blur(var(--blur)) saturate(var(--saturate)); border: 0.5px solid var(--glass-border); border-radius: var(--radius-md); padding: 16px 18px; margin-bottom: 12px; cursor: pointer; transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease); }
.result-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1); }
.result-card:active { transform: scale(0.99); }
.result-title { font-size: 16px; font-weight: 600; color: var(--accent); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.result-desc { color: var(--muted); font-size: 13px; line-height: 1.5; margin-bottom: 10px; }
.result-meta { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 8px; font-size: 12px; color: var(--muted); }
.meta-stats { display: flex; gap: 14px; flex-wrap: wrap; }
.meta-item { display: inline-flex; align-items: center; gap: 4px; }
.badge { padding: 2px 8px; border-radius: var(--radius-pill); font-size: 11px; font-weight: 600; white-space: nowrap; }
.badge-official { background: rgba(48, 209, 88, 0.18); color: var(--success); }
.badge-org { background: var(--fill-active); color: var(--fg-secondary); }

/* ===== 标签列表 ===== */
.tag-header { margin-bottom: 16px; }
.tag-title { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.tag-desc { color: var(--muted); font-size: 13px; line-height: 1.5; margin-bottom: 12px; }
.tag-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.cmd-box { background: var(--fill); border-radius: var(--radius-sm); padding: 10px 14px; font-family: ui-monospace, monospace; font-size: 13px; position: relative; margin-bottom: 14px; word-break: break-all; overflow-wrap: anywhere; }
.cmd-copy { position: absolute; right: 6px; top: 6px; }
.tag-search { position: relative; margin-bottom: 16px; }
.tag-search-input { width: 100%; padding: 12px 40px 12px 16px; border-radius: var(--radius-md); }
.tag-search-clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: var(--fill); border: none; width: 28px; height: 28px; border-radius: 50%; color: var(--fg); cursor: pointer; font-size: 16px; display: grid; place-items: center; }
.tag-search-clear:hover { background: var(--fill-active); }
.tag-item { border-radius: var(--radius-md); padding: 14px 16px; margin-bottom: 10px; }
.tag-name { font-size: 15px; font-weight: 600; color: var(--accent); margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.tag-info { font-size: 12px; color: var(--muted); margin-bottom: 8px; display: flex; gap: 14px; flex-wrap: wrap; }
.arch-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.arch-chip { background: var(--fill); padding: 3px 10px; border-radius: var(--radius-pill); font-size: 11px; font-family: ui-monospace, monospace; }
.vuln-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.vuln-critical { background: #ff453a; } .vuln-high { background: #ff9f0a; } .vuln-medium { background: #ffd60a; } .vuln-low { background: #30d158; } .vuln-unknown { background: var(--muted); }

/* ===== 分页 ===== */
.pagination { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 20px; flex-wrap: wrap; }
.page-btn { background: var(--fill); color: var(--fg); border: none; border-radius: var(--radius-sm); padding: 8px 16px; font-size: 14px; font-weight: 500; cursor: pointer; font-family: inherit; transition: background 0.2s var(--ease); }
.page-btn:hover:not(:disabled) { background: var(--fill-active); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.page-info { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.page-jump { width: 56px; padding: 6px 8px; border-radius: var(--radius-sm); border: 0.5px solid var(--separator); background: var(--fill); color: var(--fg); font-size: 13px; text-align: center; }
.page-jump:focus { outline: none; border-color: var(--accent); }

/* ===== 特性标签 ===== */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-top: 20px; }
.feature { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-radius: var(--radius-md); font-size: 13px; font-weight: 500; }
.feature-icon { font-size: 18px; }

/* ===== 返回链接 ===== */
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); cursor: pointer; font-size: 14px; font-weight: 500; margin-bottom: 16px; background: none; border: none; font-family: inherit; padding: 0; }
.back-link:hover { text-decoration: underline; }

/* ===== Footer ===== */
.footer { padding: 24px 16px; text-align: center; border-top: 0.5px solid var(--separator); }
.footer a { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-size: 13px; transition: color 0.2s var(--ease); }
.footer a:hover { color: var(--fg); }

.hidden { display: none !important; }

/* ===== 响应式 ===== */
@media (max-width: 640px) {
  .main { padding: 16px 12px 40px; }
  .card { padding: 18px; border-radius: var(--radius-md); }
  .form-row { grid-template-columns: 1fr; }
  .nav-inner { flex-wrap: wrap; justify-content: center; gap: 8px; }
  .nav-tabs { padding: 3px; background: var(--fill-active); display: inline-flex; }
  .nav-tab { padding: 5px 10px; font-size: 12px; }
  .logo { font-size: 14px; }
  .logo-mark { width: 26px; height: 26px; font-size: 14px; }
  .hero { padding: 20px 0 20px; }
  .field { flex-direction: column; }
  .output-actions { flex-direction: column; }
  .output-actions .btn { width: 100%; }
}
@media (max-width: 380px) {
  .nav-tab { padding: 4px 8px; font-size: 11px; }
  .logo span:not(.logo-mark) { display: none; }
}
