/* ===== Link3 Plus 公共样式 ===== */
:root {
  --primary: #007AFF;
  --primary-soft: #E8F1FF;
  --primary-hover: #0066D6;
  --text-1: #1D1D1F;
  --text-2: #6E6E73;
  --text-3: #8E8E93;
  --text-4: #C7C7CC;
  --bg: #F5F5F7;
  --card: #FFFFFF;
  --border: #E5E5EA;
  --border-strong: #D1D1D6;
  --border-hover: #A8A8AD;
  --success: #34C759;
  --danger: #FF3B30;
  --warn: #FF9500;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.05), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 8px 24px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.04);
  --shadow-lg: 0 24px 60px rgba(0,0,0,.12), 0 8px 20px rgba(0,0,0,.06);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "PingFang SC", "Helvetica Neue", "Microsoft YaHei", "Segoe UI", Roboto, Arial, sans-serif;
}

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

html, body {
  font-family: var(--font);
  color: var(--text-1);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  font-size: 14px;
}

a { color: var(--primary); text-decoration: none; }
a:hover { opacity: .85; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; font-size: 14px; color: var(--text-1); }

/* ===== 按钮 ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; padding: 0 18px;
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600;
  background: var(--card); color: var(--text-1);
  border: 1px solid var(--border);
  transition: all .18s ease;
  white-space: nowrap;
}
.btn:hover { border-color: var(--border-hover); }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: rgba(0,0,0,.04); border-color: transparent; }
.btn-danger { background: #fff; color: var(--danger); border-color: var(--border); }
.btn-danger:hover { background: #FFF1F0; border-color: var(--danger); }
.btn-block { width: 100%; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-lg { height: 48px; padding: 0 24px; font-size: 15px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ===== 表单 ===== */
.field { margin-bottom: 16px; }
.field-label { display: block; font-size: 13px; color: var(--text-2); font-weight: 500; margin-bottom: 6px; }
.input, .textarea, .select {
  width: 100%; height: 42px;
  padding: 0 14px;
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  color: var(--text-1);
  transition: border-color .18s, box-shadow .18s;
  caret-color: var(--primary);
}
.textarea { height: auto; padding: 10px 14px; resize: vertical; min-height: 88px; line-height: 1.6; }
.input:hover, .textarea:hover, .select:hover { border-color: var(--border-hover); }
.input:focus, .textarea:focus, .select:focus {
  outline: none; border-color: var(--primary); border-width: 1.5px;
  box-shadow: 0 0 0 3px rgba(0,122,255,.12);
}
.input::placeholder, .textarea::placeholder { color: var(--text-4); }

/* ===== 卡片 ===== */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

/* ===== Toast ===== */
#toast-wrap {
  position: fixed; top: 24px; left: 50%; transform: translateX(-50%);
  z-index: 9999; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none;
}
.toast {
  background: rgba(29,29,31,.92); color: #fff;
  padding: 10px 18px; border-radius: 10px;
  font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-md);
  animation: toastIn .25s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  max-width: 80vw;
}
.toast.success { background: rgba(52,199,89,.95); }
.toast.error { background: rgba(255,59,48,.95); }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== 通用工具 ===== */
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: 10px; }
.muted { color: var(--text-3); }
.hidden { display: none !important; }
.spacer { flex: 1; }

/* ===== 标签 ===== */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 8px;
  border-radius: 6px; font-size: 12px; font-weight: 600;
  background: var(--primary-soft); color: var(--primary);
}
.tag.gray { background: #F2F2F7; color: var(--text-2); }
.tag.green { background: #E6F8EC; color: var(--success); }
.tag.red { background: #FFEBEA; color: var(--danger); }

/* ===== 空状态 ===== */
.empty {
  text-align: center; padding: 60px 20px; color: var(--text-3);
}
.empty-icon { font-size: 40px; margin-bottom: 12px; opacity: .6; }

/* ===== 滚动条 ===== */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,.18); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,.3); background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }
