/* ============================================================
   Ace Hub 样式 —— 对齐 Ace Notes 设计语言
   默认主题 data-theme="aqua"（青蓝清新，Ace Notes 线上默认）
   另内置 dark（品牌橙）/ light 两套，改 <html data-theme> 即可切换
   ============================================================ */

/* 深色（Ace Notes 品牌橙） */
:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-2: #334155;
  --fg: #f8fafc;
  --muted: #94a3b8;
  --accent: #fb923c;
  --accent-2: #f97316;
  --line: #334155;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  --btn-text: #0f172a;
  --brand: var(--accent);
  --text: var(--fg);
}
[data-theme="light"] {
  --bg: #ffffff;
  --surface: #f8fafc;
  --surface-2: #e2e8f0;
  --fg: #0f172a;
  --muted: #64748b;
  --accent: #ea580c;
  --accent-2: #c2410c;
  --line: #e2e8f0;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --btn-text: #ffffff;
}
/* 青蓝清新（默认） */
[data-theme="aqua"] {
  --bg: linear-gradient(180deg, #e0f5f8 0%, #f2fbfc 40%, #f8fdfe 100%);
  --surface: #ffffff;
  --surface-2: #f0fafb;
  --fg: #0d3a42;
  --muted: #5b8f96;
  --accent: #2fb6a6;
  --accent-2: #249e8f;
  --line: #d2eef1;
  --radius: 18px;
  --shadow: 0 10px 28px rgba(47, 182, 166, 0.14);
  --btn-text: #ffffff;
}

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

body {
  font: 16px/1.7 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--fg);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
[data-theme="aqua"] body { background-attachment: fixed; }

a { color: var(--accent); text-decoration: none; }
.container { max-width: 640px; margin: 0 auto; padding: 72px 20px 64px; }

/* ---------- 主页头部 ---------- */
.head { text-align: center; margin-bottom: 36px; }
.avatar {
  width: 84px; height: 84px; margin: 0 auto 18px;
  border-radius: 24px; display: grid; place-items: center;
  font-size: 40px; background: var(--surface-2); color: var(--accent);
  box-shadow: var(--shadow);
}
.head h1 { font-size: 32px; font-weight: 800; letter-spacing: -0.5px; }
.head p  { margin-top: 8px; color: var(--muted); font-size: 16px; }

/* ---------- 链接卡片 ---------- */
.links { display: flex; flex-direction: column; gap: 14px; }
.link {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 18px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; color: var(--fg); box-shadow: var(--shadow);
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.link:hover {
  border-color: var(--accent); transform: translateY(-2px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.05), 0 14px 34px rgba(47,182,166,0.18);
}
.link .ic {
  flex: 0 0 auto; width: 48px; height: 48px; border-radius: 14px;
  display: grid; place-items: center; font-size: 24px; background: var(--surface-2);
}
.link .meta { flex: 1; min-width: 0; }
.link .name { font-size: 17px; font-weight: 700; color: var(--accent); display: flex; align-items: center; gap: 8px; }
.link .tag {
  font-size: 11px; font-weight: 700; color: #fff;
  background: var(--accent); padding: 2px 9px; border-radius: 999px;
}
.link .desc {
  margin-top: 4px; font-size: 14px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.link .arrow { color: var(--muted); font-size: 20px; flex: 0 0 auto; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }

.foot { margin-top: 44px; text-align: center; color: var(--muted); font-size: 13px; }
.foot a:hover { text-decoration: underline; }

/* ---------- 管理页通用 ---------- */
.admin-wrap { max-width: 560px; margin: 0 auto; padding: 56px 20px 64px; }
.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px;
}
.panel h2 { font-size: 20px; font-weight: 800; margin-bottom: 4px; }
.panel .hint { color: var(--muted); font-size: 13px; margin-bottom: 18px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 14px; font-size: 15px; font-family: inherit;
  background: var(--surface-2); color: var(--fg); outline: none;
  transition: border-color .15s ease;
}
.field input:focus, .field textarea:focus { border-color: var(--accent); }
.field textarea { resize: vertical; min-height: 52px; }

/* 胶囊按钮（与 Ace Notes 一致） */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 22px; border: none; border-radius: 999px;
  background: var(--accent); color: var(--btn-text); font-size: 15px; font-weight: 600;
  cursor: pointer; transition: background .15s ease, transform .1s ease, opacity .15s ease;
}
.btn:hover { background: var(--accent-2); }
.btn:active { transform: scale(.98); }
.btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.btn.ghost:hover { background: var(--accent); color: var(--btn-text); }
.btn.block { width: 100%; }

/* aqua 主题下按钮用品牌渐变 */
[data-theme="aqua"] .btn {
  background: linear-gradient(135deg, #40cbb9, #2fb6a6);
  box-shadow: 0 4px 16px rgba(47, 182, 166, 0.35);
}
[data-theme="aqua"] .btn:hover { background: linear-gradient(135deg, #2fb6a6, #249e8f); }
[data-theme="aqua"] .btn.ghost:hover { color: #fff; }

.row { display: flex; gap: 10px; }
.row > * { flex: 1; }
.login { max-width: 360px; margin: 12vh auto 0; }

.admin-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; border: 1px solid var(--line);
  border-radius: 14px; margin-bottom: 10px; background: var(--surface);
}
.admin-item .ic {
  width: 40px; height: 40px; border-radius: 12px; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 20px; background: var(--surface-2);
}
.admin-item .meta { flex: 1; min-width: 0; }
.admin-item .meta .n { font-size: 15px; font-weight: 700; }
.admin-item .meta .u { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-item .actions { display: flex; gap: 8px; flex: 0 0 auto; }
.act {
  border: 1px solid var(--line); background: transparent; color: var(--text);
  height: 32px; padding: 0 14px; border-radius: 999px; cursor: pointer;
  font-size: 13px; font-weight: 600; white-space: nowrap; transition: all .15s ease;
}
.act:hover { border-color: var(--brand); color: var(--brand); }
.act.pin { color: var(--brand); border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.act.pin:hover { background: color-mix(in srgb, var(--brand) 12%, transparent); }
.act.del { color: #f87171; }
.act.del:hover { border-color: #f87171; background: rgba(248,113,113,.08); }
.admin-item.is-pinned { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); }
.pin-badge {
  display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 700; color: #fff; background: var(--brand); vertical-align: middle;
}

.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.topbar h2 { font-size: 20px; font-weight: 800; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #0f172a; color: #f8fafc; padding: 10px 18px; border-radius: 10px;
  font-size: 13.5px; opacity: 0; transition: all .25s ease; pointer-events: none; z-index: 50;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 560px) {
  .container { padding: 52px 16px 48px; }
  .head h1 { font-size: 26px; }
}
