/* ============================================================
   「我的收藏夹」· 个人导航站
   设计基调：暖纸与墨，编辑排版，克制留白
   全局主题变量（accent 由站点设置注入，通过 html 内联 style 覆盖）
   ============================================================ */
:root {
  --paper: #f5f2ec;
  --paper-2: #fbf9f4;
  --ink: #201c18;
  --ink-soft: #57503f;
  --ink-faint: #8a8374;
  --line: #e2dccf;
  --line-strong: #cfc8b8;
  --accent: #b3482b;          /* 默认勃艮第锈红 */
  --accent-ink: #9a3a20;
  --accent-soft: rgba(179, 72, 43, 0.09);
  --radius: 12px;
  --font-body: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Helvetica Neue", Arial, sans-serif;
  --font-display: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", Georgia, serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }

.wrap {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}
.hidden { display: none !important; }

/* ---------- 顶部栏 ---------- */
.site-head {
  border-bottom: 1px solid var(--line);
  background: var(--paper-2);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.site-head .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 62px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mark {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: var(--ink);
  color: var(--paper);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0;
}
.brand-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.nav-admin {
  font-size: 13px;
  color: var(--ink-faint);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 6px 16px;
  transition: color .2s, border-color .2s, background .2s;
}
.nav-admin:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* ---------- 主视觉 ---------- */
.hero {
  padding: 64px 0 40px;
  text-align: center;
}
.hero-date {
  margin: 0 0 34px;
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}
.hero-date .hd-sep {
  display: inline-block;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--accent);
  margin: 0 10px;
  vertical-align: middle;
  opacity: 0.7;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(34px, 5.5vw, 58px);
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 0 0 12px;
  line-height: 1.25;
}
.hero h1::before {
  content: "";
  display: block;
  width: 42px; height: 3px;
  background: var(--accent);
  border-radius: 2px;
  margin: 0 auto 22px;
}
.hero-sub {
  color: var(--ink-soft);
  font-size: 16px;
  max-width: 520px;
  margin: 0 auto 28px;
}
.hero-meta {
  color: var(--ink-faint);
  font-size: 13px;
  letter-spacing: 0.04em;
}
.hero-meta strong { color: var(--accent); font-weight: 600; }

/* ---------- 搜索 ---------- */
.search {
  max-width: 560px;
  margin: 0 auto 26px;
  position: relative;
}
.search input {
  width: 100%;
  height: 52px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--paper-2);
  padding: 0 22px 0 48px;
  font-size: 15px;
  color: var(--ink);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.search .search-icon {
  position: absolute;
  left: 18px; top: 50%;
  transform: translateY(-50%);
  color: var(--ink-faint);
  font-size: 16px;
  pointer-events: none;
}
.search-clear {
  position: absolute;
  right: 14px; top: 50%;
  transform: translateY(-50%);
  border: none; background: none;
  color: var(--ink-faint);
  font-size: 17px;
  padding: 4px;
  display: none;
}
.search-clear.show { display: block; }
.search-clear:hover { color: var(--accent); }

/* ---------- 分类与卡片 ---------- */
.main { padding: 8px 0 64px; }
.cat {
  margin-bottom: 52px;
}
.cat-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}
.cat-head h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  margin: 0;
  letter-spacing: 0.02em;
}
.cat-head .count {
  color: var(--ink-faint);
  font-size: 13px;
}
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: 0 10px 24px -14px rgba(32, 28, 24, 0.28);
}
.card-icon {
  position: relative;
  flex: 0 0 42px;
  width: 42px; height: 42px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #fff;
}
.card-icon .card-letter {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--ic, var(--accent));
}
.card-icon img {
  position: relative;
  z-index: 1;
  width: 22px; height: 22px;
  object-fit: contain;
}
.card-body { min-width: 0; flex: 1; }
.card-name {
  display: block;
  font-size: 15.5px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-desc {
  display: block;
  font-size: 13px;
  color: var(--ink-faint);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-arrow {
  color: var(--line-strong);
  font-size: 14px;
  transition: color .2s, transform .2s;
}
.card:hover .card-arrow { color: var(--accent); transform: translateX(3px); }

/* 运行状态点（呼吸灯） */
@keyframes breathe {
  0%   { opacity: 0.65; transform: scale(1);    box-shadow: 0 0 0 0 var(--glow); }
  50%  { opacity: 1;    transform: scale(1.25); box-shadow: 0 0 0 6px transparent; }
  100% { opacity: 0.65; transform: scale(1);    box-shadow: 0 0 0 0 var(--glow); }
}
.card-status {
  flex: 0 0 auto;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--line-strong);
  opacity: 0.65;
}
.card-status.online {
  background: #2fbf71;
  --glow: rgba(47, 191, 113, 0.6);
  animation: breathe 2.2s ease-in-out infinite;
}
.card-status.offline {
  background: #e04a3a;
  --glow: rgba(224, 74, 58, 0.6);
  animation: breathe 1.5s ease-in-out infinite;
}
.card-status.unknown { background: var(--line-strong); opacity: 0.5; }
.card-desc-off {
  color: #c33b2c;
  font-weight: 600;
  font-size: 12.5px;
}
@media (prefers-reduced-motion: reduce) {
  .card-status.online, .card-status.offline { animation: none; opacity: 1; box-shadow: 0 0 0 3px var(--glow); }
}

/* 分类内色点（每个分类给一个克制的小色标） */
.cat-dot {
  display: inline-block;
  width: 9px; height: 9px;
  border-radius: 50%;
  margin-right: 10px;
  background: var(--dot, var(--accent));
}

/* ---------- 空状态 / 加载 ---------- */
.loading, .empty {
  text-align: center;
  padding: 60px 0;
  color: var(--ink-faint);
  font-size: 15px;
}
.empty .empty-mark { font-family: var(--font-display); font-size: 30px; display:block; margin-bottom: 8px; color: var(--line-strong); }

/* ---------- 页脚 ---------- */
.site-foot {
  border-top: 1px solid var(--line);
  padding: 26px 0 40px;
  color: var(--ink-faint);
  font-size: 13px;
  text-align: center;
}

/* ============================================================
   认证页 / 后台页 通用面板
   ============================================================ */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.panel {
  width: 100%;
  max-width: 380px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 40px 34px;
}
.panel h1 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 4px;
  letter-spacing: 0.02em;
}
.panel .panel-sub { color: var(--ink-faint); font-size: 13.5px; margin: 0 0 24px; }

.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 6px;
  font-weight: 500;
}
.field input, .field textarea, .field select {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: #fff;
  border-radius: 9px;
  padding: 10px 12px;
  font-size: 14.5px;
  color: var(--ink);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field textarea { resize: vertical; min-height: 80px; }
.field .hint { font-size: 12px; color: var(--ink-faint); margin-top: 4px; }
.check-line { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.check-line input { width: auto; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line-strong);
  background: var(--paper-2);
  color: var(--ink);
  border-radius: 9px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  transition: all .18s ease;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn-primary {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
.btn-primary:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 7px; }
.btn-danger { color: #a33; border-color: #e3c9c0; }
.btn-danger:hover { border-color: #a33; color: #a33; background: #f7ece9; }

.alert {
  display: none;
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 13px;
  margin-bottom: 16px;
}
.alert.show { display: block; }
.alert-error { background: #f7ece9; color: #a33; border: 1px solid #e7c9c0; }
.alert-ok { background: #ecf3ee; color: #2f6b5e; border: 1px solid #cfe0d6; }

/* ============================================================
   后台布局
   ============================================================ */
.admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 230px 1fr;
}
.admin-side {
  background: var(--paper-2);
  border-right: 1px solid var(--line);
  padding: 26px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.admin-side .side-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  padding: 0 12px 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}
.admin-side .side-user {
  font-size: 12.5px;
  color: var(--ink-faint);
  padding: 0 12px 16px;
}
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav button,
.side-nav a {
  text-align: left;
  border: none;
  background: none;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--ink-soft);
  border-radius: 9px;
  transition: all .15s;
}
.side-nav button:hover, .side-nav a:hover { color: var(--accent); background: var(--accent-soft); }
.side-nav button.active { color: var(--accent); background: var(--accent-soft); font-weight: 500; }
.side-nav .side-home { font-weight: 500; color: var(--ink); border-bottom: 1px solid var(--line); border-radius: 0; padding-bottom: 13px; margin-bottom: 6px; }
.side-nav .side-home:hover { color: var(--accent); }
.side-nav .logout { margin-top: auto; color: var(--ink-faint); }

.admin-main { padding: 34px 36px 60px; min-width: 0; }
.admin-main h1 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  margin: 0 0 24px;
}

/* 列表 */
.list-tools {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.list-tools input {
  flex: 1;
  min-width: 200px;
  border: 1px solid var(--line-strong);
  background: #fff;
  border-radius: 9px;
  padding: 9px 12px;
  font-size: 14px;
  outline: none;
}
.list-tools input:focus { border-color: var(--accent); }
.list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 13px 16px;
  margin-bottom: 10px;
  transition: border-color .15s;
}
.list-item:hover { border-color: var(--line-strong); }
.list-item .li-move { display: flex; flex-direction: column; gap: 2px; }
.list-item .li-move button {
  border: none; background: none;
  color: var(--ink-faint); font-size: 13px; line-height: 1;
  padding: 2px;
}
.list-item .li-move button:hover { color: var(--accent); }
.list-item .li-icon {
  width: 36px; height: 36px;
  border-radius: 9px;
  display: grid; place-items: center;
  color: #fff; font-family: var(--font-display);
  flex: 0 0 36px;
}
.list-item .li-info { flex: 1; min-width: 0; }
.list-item .li-name { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item .li-desc { font-size: 12.5px; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item .li-url { font-size: 11.5px; color: var(--ink-faint); }
.list-item .li-tag {
  font-size: 11.5px; color: var(--ink-soft);
  border: 1px solid var(--line-strong);
  border-radius: 999px; padding: 2px 9px;
}
.list-item .li-actions { display: flex; gap: 6px; }
.empty-list { color: var(--ink-faint); padding: 30px 0; text-align: center; font-size: 14px; }

/* 分类管理 */
.cat-add {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  max-width: 560px;
}
.cat-add input {
  flex: 1;
  border: 1px solid var(--line-strong);
  background: #fff;
  border-radius: 9px;
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
}
.cat-add input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.cat-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 13px 16px;
  margin-bottom: 10px;
}
.cat-row:hover { border-color: var(--line-strong); }
.cat-row .cr-move { display: flex; flex-direction: column; gap: 2px; }
.cat-row .cr-move button {
  border: none; background: none;
  color: var(--ink-faint); font-size: 14px; line-height: 1;
  padding: 3px 4px;
}
.cat-row .cr-move button:hover:not(:disabled) { color: var(--accent); }
.cat-row .cr-move button:disabled { opacity: 0.3; cursor: default; }
.cat-row .cr-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 10px; }
.cat-row .cr-name { flex: 1; font-weight: 600; font-size: 14.5px; }
.cat-row .cr-count { color: var(--ink-faint); font-size: 12.5px; white-space: nowrap; }
.cat-row .cr-actions { display: flex; gap: 6px; }
.cat-row .cr-edit { display: flex; gap: 8px; flex: 1; min-width: 0; }
.cat-row .cr-edit input {
  flex: 1;
  border: 1px solid var(--line-strong);
  background: #fff;
  border-radius: 7px;
  padding: 6px 10px;
  font-size: 13.5px;
  outline: none;
}
.cat-row .cr-edit input:focus { border-color: var(--accent); }

/* 表单卡片 */
.form-card {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 26px;
  max-width: 560px;
}
.form-card h2 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 18px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* 色板 */
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .15s;
}
.swatch:hover { transform: scale(1.1); }
.swatch.active { border-color: var(--ink); box-shadow: 0 0 0 2px var(--paper-2); }

/* ============================================================
   响应式
   ============================================================ */
@media (min-width: 640px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1000px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1300px) {
  .grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 760px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side {
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding: 12px 16px;
    position: sticky; top: 0; z-index: 20;
    background: var(--paper-2);
  }
  .admin-side .side-title, .admin-side .side-user { display: none; }
  .side-nav { flex-direction: row; overflow-x: auto; gap: 4px; }
  .side-nav button { white-space: nowrap; padding: 7px 12px; font-size: 13px; }
  .side-nav .logout { margin-top: 0; }
  .admin-main { padding: 22px 18px 60px; }
  .form-row { grid-template-columns: 1fr; }
  .card { padding: 14px 16px; gap: 12px; }
  .hero { padding: 44px 0 30px; }
  .list-item { flex-wrap: wrap; }
  .list-item .li-actions { width: 100%; justify-content: flex-end; }
}
