/* ==================================================================
   设计语言：Art Design Pro
   - 中性灰底 + 纯白卡片
   - 1px 极淡描边，不使用重投影
   - 12 / 16px 圆角，单一强调色
   - 大留白，零装饰
   ================================================================== */

:root {
  /* 中性色 */
  --bg: #f6f7f9;
  --surface: #fff;
  --surface-hover: #fafbfc;
  --surface-sunken: #f4f5f7;

  /* 文字 */
  --text: #1d2129;
  --text-secondary: #5c6270;
  --text-tertiary: #8b919e;

  /* 描边 */
  --line: #ebedf0;
  --line-strong: #dfe2e7;

  /* 强调色（单一） */
  --accent: #1f6feb;
  --accent-hover: #1a5fd0;
  --accent-soft: #eff4fe;

  /* 语义色 */
  --danger: #d92d20;
  --danger-soft: #fef3f2;
  --success: #079455;
  --success-soft: #ecfdf3;
  --warn: #b54708;
  --warn-soft: #fffaeb;

  /* 圆角 */
  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 18px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
p {
  margin: 0;
}

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

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 42px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: background 0.16s ease, border-color 0.16s ease, opacity 0.16s ease;
}

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

.btn:active:not(:disabled) {
  transform: translateY(0.5px);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn-block {
  width: 100%;
  height: 46px;
}

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

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line-strong);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--surface-hover);
  border-color: #cfd4db;
}

.btn-danger {
  background: var(--danger);
}

.btn-danger:hover:not(:disabled) {
  background: #b42318;
}

/* ---------------- 输入框 ---------------- */
.field {
  display: block;
  margin-bottom: 18px;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

.input,
.textarea,
.select {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  font-size: 15px;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
  appearance: none;
}

.input::placeholder,
.textarea::placeholder {
  color: #a8adb7;
}

.input:hover,
.textarea:hover,
.select:hover {
  border-color: #cfd4db;
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(31 111 235 / 10%);
}

.textarea {
  height: auto;
  min-height: 96px;
  padding: 12px 14px;
  line-height: 1.5;
  resize: vertical;
}

/* ---------------- 提示条 ---------------- */
.alert {
  display: none;
  padding: 11px 14px;
  margin-bottom: 16px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  font-size: 14px;
  line-height: 1.55;
}

.alert.is-visible {
  display: block;
}

.alert-error {
  background: var(--danger-soft);
  border-color: #fecdca;
  color: #b42318;
}

.alert-success {
  background: var(--success-soft);
  border-color: #abefc6;
  color: #067647;
}

.alert-warn {
  background: var(--warn-soft);
  border-color: #fedf89;
  color: var(--warn);
}

/* ---------------- 徽标 ---------------- */
.badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.badge-unused {
  background: var(--accent-soft);
  color: var(--accent);
}

.badge-used {
  background: var(--surface-sunken);
  color: var(--text-tertiary);
}

/* ---------------- 工具类 ---------------- */
.hidden {
  display: none !important;
}

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgb(255 255 255 / 45%);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
