:root {
  --bg: #f4f7fc;
  --bg-accent: #e8efff;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e9f2;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eff5ff;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --surface: #fbfcff;
  --input-bg: #ffffff;
  --code-bg: #f1f5fb;
  --notice-bg: #fffbeb;
  --notice-border: #fde68a;
  --notice-text: #92400e;
  --notice-icon: #d97706;
  --shadow: 0 10px 30px rgba(37, 99, 235, 0.08);
  --radius: 16px;
}

[data-theme="dark"] {
  --bg: #0b1220;
  --bg-accent: #172033;
  --card: #1e293b;
  --surface: #253247;
  --input-bg: #0f172a;
  --code-bg: #334155;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --border: #334155;
  --primary: #60a5fa;
  --primary-dark: #3b82f6;
  --primary-soft: rgba(59, 130, 246, 0.15);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.12);
  --notice-bg: rgba(251, 191, 36, 0.1);
  --notice-border: rgba(251, 191, 36, 0.3);
  --notice-text: #fcd34d;
  --notice-icon: #fbbf24;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--text);
  background: radial-gradient(1200px 600px at 50% -10%, var(--bg-accent), transparent 70%),
    var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}

.page {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  padding: 56px 0 32px;
}

main {
  flex: 1;
}

.hero {
  position: relative;
  text-align: center;
  margin-bottom: 32px;
}

.theme-toggle {
  position: absolute;
  top: 0;
  right: 0;
  width: 38px;
  height: 38px;
  padding: 0;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.theme-toggle:hover {
  color: var(--primary);
  border-color: var(--primary);
}

.theme-icon {
  display: none;
  width: 18px;
  height: 18px;
}

.theme-toggle[data-mode="system"] .icon-system,
.theme-toggle[data-mode="light"] .icon-light,
.theme-toggle[data-mode="dark"] .icon-dark {
  display: block;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, #4f46e5, #2563eb);
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.28);
}

.brand-name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

h1 {
  margin: 0 0 8px;
  font-size: clamp(26px, 5vw, 38px);
  line-height: 1.25;
  letter-spacing: -0.5px;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px;
  margin-bottom: 20px;
}

.field-label {
  display: block;
  font-weight: 600;
  margin-bottom: 10px;
}

.input-row {
  display: flex;
  gap: 10px;
}

.input-row input {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input-row input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 18px;
  font-size: 14px;
  font-family: inherit;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.primary {
  color: #fff;
  background: var(--primary);
}

.primary:hover:not(:disabled) {
  background: var(--primary-dark);
}

.secondary {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: rgba(37, 99, 235, 0.16);
}

.secondary:hover:not(:disabled) {
  background: #e3edff;
}

.ghost {
  color: var(--muted);
  background: transparent;
  border-color: var(--border);
  padding: 7px 12px;
  font-size: 13px;
}

.ghost:hover:not(:disabled) {
  color: var(--primary);
  border-color: var(--primary);
}

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

code {
  padding: 2px 6px;
  background: var(--code-bg);
  border-radius: 5px;
  font-size: 12px;
}

.error {
  margin: 14px 0 0;
  padding: 10px 12px;
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid #fecaca;
  border-radius: 9px;
  font-size: 14px;
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.result-header h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 18px;
}

.badge {
  padding: 3px 10px;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.file-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.file-item {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.file-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.file-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.file-meta {
  flex: 1;
  min-width: 0;
}

.file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  font-size: 15px;
}

.file-details {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.file-head-actions {
  flex: 0 0 auto;
}

.link-row {
  display: flex;
  gap: 8px;
}

.link-input {
  flex: 1;
  min-width: 0;
  padding: 9px 11px;
  color: var(--muted);
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  outline: none;
}

.link-input:focus {
  color: var(--text);
  border-color: var(--primary);
}

.link-row .button {
  padding: 9px 14px;
}

.empty {
  margin: 0;
  padding: 24px;
  text-align: center;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 10px;
}

.note {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.expiry-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 13px;
  margin-bottom: 18px;
  color: var(--notice-text);
  background: var(--notice-bg);
  border: 1px solid var(--notice-border);
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.6;
}

.expiry-notice svg {
  flex: 0 0 auto;
  margin-top: 2px;
  color: var(--notice-icon);
}

/* 页脚沿用参考站点的运行时间 / 访问统计 / 版权结构，视觉风格与本站统一 */
.site-footer {
  margin-top: 24px;
}

.footer-card {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.footer-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.footer-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 14px;
  color: var(--muted);
  background: var(--primary-soft);
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 9999px;
  font-size: 13px;
}

.footer-badge svg {
  color: var(--primary);
  opacity: 0.85;
}

.stat-num {
  color: var(--primary);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  margin-left: 3px;
}

.visit-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 20px;
}

.footer-line {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  line-height: 1.7;
}

.footer-line a {
  color: var(--primary);
  text-decoration: none;
}

.footer-line a:hover {
  text-decoration: underline;
}

@media (max-width: 380px) {
  .visit-stats {
    font-size: 12px;
    gap: 8px 12px;
  }

  .footer-badge {
    font-size: 12px;
    padding: 5px 11px;
  }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  padding: 10px 18px;
  color: #fff;
  background: #111827;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.25);
  font-size: 14px;
  z-index: 100;
}

@media (max-width: 640px) {
  .page {
    padding-top: 32px;
  }

  .card {
    padding: 18px;
  }

  .input-row {
    flex-direction: column;
  }

  .input-row button {
    width: 100%;
  }

  .result-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .file-head {
    flex-wrap: wrap;
  }

  .file-head-actions {
    margin-left: 56px;
  }

  .link-row {
    flex-wrap: wrap;
  }

  .link-input {
    flex-basis: 100%;
  }
}
