:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --primary-soft: #eef2ff;
  --success: #2ecc71;
  --danger: #e74c3c;
  --warning: #f39c12;
  --text: #1e293b;
  --text2: #475569;
  --text3: #94a3b8;
  --bg: #f8fafc;
  --card: #ffffff;
  --border: #e2e8f0;
  --radius: 16px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* 保证 hidden 属性优先于任何 display 样式，避免遮罩/弹窗/角标异常显示 */
[hidden] {
  display: none !important;
}

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

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

a:hover {
  text-decoration: underline;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input,
textarea,
select {
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 12px;
  background: #fff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 110, 247, 0.14);
}

textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.7;
}

.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s, transform 0.08s, box-shadow 0.15s;
  user-select: none;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.98);
}

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

.btn-primary:hover {
  background: var(--primary-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-ghost {
  background: #fff;
  color: var(--text2);
  border: 1px solid var(--border);
}

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

.btn-danger-ghost {
  background: #fff;
  color: var(--danger);
  border: 1px solid #f4c7c2;
}

.btn-danger-ghost:hover {
  background: #fef2f1;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 8px;
}

.btn-block {
  width: 100%;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text2);
}

.field .hint {
  font-size: 12px;
  color: var(--text3);
  margin-top: 5px;
}

.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.site-header .container {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 60px;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 17px;
  color: var(--text);
}

.site-logo:hover {
  text-decoration: none;
}

.site-logo img {
  width: 30px;
  height: 30px;
}

.site-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
}

.site-nav a {
  color: var(--text2);
}

.site-nav a:hover {
  color: var(--primary);
  text-decoration: none;
}

.site-footer {
  margin-top: auto;
  padding: 26px 0 34px;
  color: var(--text3);
  font-size: 13px;
  text-align: center;
}

.site-footer a {
  color: var(--text3);
  margin: 0 6px;
}

.site-footer a:hover {
  color: var(--primary);
}

.toast-wrap {
  position: fixed;
  top: 74px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}

.toast {
  background: rgba(31, 36, 48, 0.92);
  color: #fff;
  font-size: 14px;
  padding: 9px 18px;
  border-radius: 999px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.25s, transform 0.25s;
  max-width: min(90vw, 420px);
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.error {
  background: var(--danger);
}

.disk-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 4px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
}

.disk-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  flex: none;
}

.page-main {
  flex: 1;
  padding: 28px 0 20px;
}

.page-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 6px;
}

.muted {
  color: var(--text3);
}

.flex {
  display: flex;
  align-items: center;
}

.gap-8 {
  gap: 8px;
}

.gap-12 {
  gap: 12px;
}

.grow {
  flex: 1;
  min-width: 0;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  word-break: break-all;
}

.empty-state {
  text-align: center;
  color: var(--text3);
  padding: 40px 12px;
  font-size: 14px;
}

.empty-state .emoji {
  font-size: 40px;
  display: block;
  margin-bottom: 10px;
}

.tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 6px;
  font-size: 12px;
  background: var(--bg);
  color: var(--text2);
  border: 1px solid var(--border);
}
