/* ==========================================================================
   LinkHub · 基础样式与主站皮肤
   ========================================================================== */
:root {
  --bg: #f5f7fc;
  --bg-glow-1: rgba(79, 70, 229, 0.16);
  --bg-glow-2: rgba(6, 182, 212, 0.14);
  --surface: #ffffff;
  --surface-2: #f2f4fb;
  --surface-3: #e9edf8;
  --text: #131a2a;
  --text-soft: #3c4560;
  --muted: #6b7488;
  --line: #e3e8f4;
  --brand: #4f46e5;
  --brand-soft: rgba(79, 70, 229, 0.12);
  --brand-2: #06b6d4;
  --success: #10b981;
  --danger: #ef4444;
  --warn: #f59e0b;
  --shadow-sm: 0 2px 10px rgba(19, 26, 42, 0.06);
  --shadow-md: 0 12px 32px rgba(19, 26, 42, 0.1);
  --shadow-lg: 0 24px 60px rgba(19, 26, 42, 0.16);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --header-h: 68px;
  --font: "Segoe UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Mono", Consolas, "Courier New", monospace;
}

[data-theme="dark"] {
  --bg: #0a0f1d;
  --bg-glow-1: rgba(99, 102, 241, 0.24);
  --bg-glow-2: rgba(34, 211, 238, 0.16);
  --surface: #141b2e;
  --surface-2: #1b2338;
  --surface-3: #232c44;
  --text: #eef2ff;
  --text-soft: #c7cfe4;
  --muted: #94a0bd;
  --line: #26304a;
  --brand: #7c7bff;
  --brand-soft: rgba(124, 123, 255, 0.16);
  --brand-2: #22d3ee;
  --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 14px 34px rgba(0, 0, 0, 0.42);
  --shadow-lg: 0 26px 64px rgba(0, 0, 0, 0.55);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 520px at 8% -6%, var(--bg-glow-1), transparent 62%),
    radial-gradient(760px 460px at 96% 4%, var(--bg-glow-2), transparent 60%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.container { width: min(1240px, 100% - 40px); margin-inline: auto; }

/* ------------------------------ 顶栏 ------------------------------ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  display: flex;
  align-items: center;
  backdrop-filter: blur(18px) saturate(160%);
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
}

.header-inner { display: flex; align-items: center; gap: 18px; width: min(1240px, 100% - 40px); margin-inline: auto; }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: 0.2px; flex: none; }
.brand img { width: 34px; height: 34px; border-radius: 10px; box-shadow: 0 6px 16px rgba(79, 70, 229, 0.28); }
.brand-text { font-size: 19px; }
.brand-text small { display: block; font-size: 10px; font-weight: 600; letter-spacing: 2.4px; color: var(--muted); text-transform: uppercase; }

.top-nav { display: flex; gap: 4px; margin-left: 6px; }
.top-nav a {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13.5px;
  color: var(--muted);
  font-weight: 600;
  transition: color 0.18s, background 0.18s;
}
.top-nav a:hover, .top-nav a.active { color: var(--brand); background: var(--brand-soft); }

.search-wrap { position: relative; flex: 1 1 320px; max-width: 520px; margin-left: auto; display: flex; align-items: center; gap: 8px; }
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px 8px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.18s, box-shadow 0.18s;
}
.search-box:focus-within { border-color: color-mix(in srgb, var(--brand) 55%, var(--line)); box-shadow: 0 0 0 4px var(--brand-soft); }
.search-box svg { flex: none; opacity: 0.55; }
.search-box input { flex: 1; border: 0; background: transparent; outline: none; font-size: 14px; min-width: 60px; }
.search-box kbd {
  font-family: var(--mono); font-size: 10.5px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 6px; padding: 1px 5px; background: var(--surface-2);
}

.engine-select {
  flex: none; border: 1px solid var(--line); background: var(--surface-2);
  border-radius: 999px; padding: 7px 8px; font-size: 12.5px; color: var(--text-soft);
  appearance: none; text-align: center; min-width: 74px;
}

.header-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
  color: var(--text-soft); transition: all 0.18s;
}
.icon-btn:hover { color: var(--brand); border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); transform: translateY(-1px); }

.account-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); font-size: 13.5px; font-weight: 600; color: var(--text-soft);
}
.account-btn:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); color: var(--brand); }
.account-btn .avatar {
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-size: 12px; font-weight: 700;
}

.user-pop {
  position: absolute; right: 0; top: calc(100% + 10px); min-width: 210px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-md); padding: 8px; display: none; z-index: 60;
}
.user-pop.open { display: block; }
.user-pop .pop-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.user-pop .pop-head strong { display: block; font-size: 14px; }
.user-pop .pop-head span { font-size: 12px; color: var(--muted); }
.user-pop button, .user-pop a { display: block; width: 100%; text-align: left; padding: 9px 10px; border: 0; background: none; border-radius: 9px; font-size: 13px; color: var(--text-soft); }
.user-pop button:hover, .user-pop a:hover { background: var(--surface-2); color: var(--brand); }

/* ------------------------------ 首屏 ------------------------------ */
.hero { padding: clamp(30px, 5vw, 54px) 0 10px; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.hero h1 { margin: 0 0 10px; font-size: clamp(26px, 3.6vw, 40px); letter-spacing: -0.6px; line-height: 1.15; }
.hero h1 em {
  font-style: normal;
  background: linear-gradient(100deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { margin: 0; color: var(--muted); max-width: 620px; font-size: 14.5px; }
.hero-stats { display: flex; gap: 12px; flex-wrap: wrap; }
.stat-chip {
  min-width: 96px; padding: 12px 16px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.stat-chip b { display: block; font-size: 21px; line-height: 1.2; }
.stat-chip span { font-size: 12px; color: var(--muted); }

/* 分类快捷导航 */
.chip-bar { display: flex; flex-wrap: wrap; gap: 8px; overflow: visible; padding: 18px 2px 8px; }
.chip {
  flex: none; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); font-size: 13px; color: var(--text-soft); font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px; transition: all 0.18s;
}
.chip:hover { color: var(--brand); border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); transform: translateY(-1px); }
.chip .count { font-size: 11px; color: var(--muted); background: var(--surface-2); padding: 1px 6px; border-radius: 999px; }

/* ------------------------------ 分区与卡片 ------------------------------ */
.section { margin-top: 34px; }
.section-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.section-head h2 { margin: 0; font-size: 19px; letter-spacing: -0.2px; display: flex; align-items: center; gap: 9px; }
.section-head .badge { font-size: 11.5px; font-weight: 700; color: var(--brand); background: var(--brand-soft); padding: 3px 9px; border-radius: 999px; }
.section-head .hint { margin-left: auto; font-size: 12.5px; color: var(--muted); }

.category-block { margin-bottom: 30px; }
.category-title { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 16px; }
.category-title .emoji { font-size: 19px; }
.category-title .slug { font-family: var(--mono); font-size: 11px; color: var(--muted); background: var(--surface-2); border-radius: 6px; padding: 2px 7px; }
.category-title .more { margin-left: auto; font-size: 12px; color: var(--muted); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }

.site-card {
  position: relative;
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.2s, border-color 0.2s;
}
.site-card:hover, .site-card:focus-visible {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--brand) 34%, var(--line));
  box-shadow: var(--shadow-md);
  z-index: 3;
}
.site-card.flash { animation: flash 1.8s ease; }
@keyframes flash {
  0% { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.55); border-color: var(--brand); }
  60% { box-shadow: 0 0 0 10px rgba(79, 70, 229, 0); }
  100% { box-shadow: var(--shadow-sm); }
}

.site-icon {
  width: 40px; height: 40px; flex: none; border-radius: 11px; overflow: hidden;
  background: var(--surface-2); display: grid; place-items: center;
  border: 1px solid var(--line);
}
.site-icon img { width: 24px; height: 24px; object-fit: contain; }
.site-main { min-width: 0; }
.site-main strong { display: block; font-size: 14.5px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.site-main .host { display: block; font-size: 11.5px; color: var(--muted); font-family: var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.site-main .desc { margin: 6px 0 0; font-size: 12.5px; color: var(--text-soft); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.site-tip {
  position: absolute; left: 0; right: 0; top: 100%;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-md); padding: 12px 14px; z-index: 20;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity 0.18s, transform 0.18s, visibility 0.18s;
  pointer-events: none;
}
.site-card:hover .site-tip, .site-card:focus-within .site-tip { opacity: 1; visibility: visible; transform: none; pointer-events: auto; }
.site-tip .tip-desc { font-size: 12.8px; color: var(--text-soft); margin: 0 0 8px; }
.site-tip .tip-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.site-tip .tip-tags span { font-size: 11px; color: var(--muted); background: var(--surface-2); border-radius: 6px; padding: 2px 7px; }
.site-tip .tip-foot { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 8px; }
.site-tip .tip-foot b { color: var(--brand); font-weight: 700; }

/* ------------------------------ 我的链接 ------------------------------ */
.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  padding: clamp(16px, 2.4vw, 24px);
}
.panel-head { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.panel-head h3 { margin: 0; font-size: 17px; }
.panel-head p { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); }
.panel-head .spacer { margin-left: auto; }

.link-form { display: grid; grid-template-columns: 2fr 1.4fr 2fr auto; gap: 10px; }
.link-form input {
  width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface-2); font-size: 13.5px; outline: none;
}
.link-form input:focus { border-color: var(--brand); background: var(--surface); box-shadow: 0 0 0 3px var(--brand-soft); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 16px; border-radius: 12px; border: 1px solid transparent;
  font-size: 13.5px; font-weight: 700; transition: all 0.18s; white-space: nowrap;
  background: var(--surface-2); color: var(--text-soft);
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: linear-gradient(120deg, var(--brand), #6366f1 55%, var(--brand-2)); color: #fff; box-shadow: 0 8px 20px rgba(79, 70, 229, 0.28); }
.btn-ghost { background: var(--surface-2); border-color: var(--line); }
.btn-danger { background: rgba(239, 68, 68, 0.1); color: var(--danger); border-color: rgba(239, 68, 68, 0.25); }
.btn-sm { padding: 7px 11px; font-size: 12.5px; border-radius: 10px; }

.my-links { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 10px; }
.my-links li {
  display: flex; align-items: center; gap: 12px; padding: 11px 13px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2);
}
.my-links .site-icon { background: var(--surface); }
.my-links .meta { min-width: 0; flex: 1; }
.my-links .meta strong { display: block; font-size: 13.5px; }
.my-links .meta span { font-size: 11.5px; color: var(--muted); font-family: var(--mono); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.my-links .actions { display: flex; gap: 8px; flex: none; }
.empty-state { padding: 26px; text-align: center; color: var(--muted); font-size: 13px; border: 1px dashed var(--line); border-radius: 14px; margin-top: 14px; }

/* ------------------------------ 设备信息 ------------------------------ */
.device-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.device-item { padding: 12px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.device-item span { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 3px; }
.device-item b { font-size: 13.5px; font-weight: 650; word-break: break-word; }

/* ------------------------------ 搜索浮层 ------------------------------ */
.search-layer {
  position: fixed; inset: 0; z-index: 80; display: none;
  background: rgba(9, 14, 28, 0.42); backdrop-filter: blur(2px);
}
.search-layer.open { display: block; }
.search-panel {
  width: min(720px, calc(100% - 28px)); margin: 92px auto 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
  box-shadow: var(--shadow-lg); overflow: hidden; animation: pop 0.2s ease;
}
@keyframes pop { from { transform: translateY(-8px) scale(0.985); opacity: 0; } }
.search-panel header { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.search-panel header strong { font-size: 14px; }
.search-panel header .close { margin-left: auto; }
.search-results { max-height: min(58vh, 460px); overflow: auto; padding: 8px; }
.search-results .result {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px;
  border: 1px solid transparent;
}
.search-results .result:hover { background: var(--surface-2); border-color: var(--line); }
.search-results .result .meta { min-width: 0; flex: 1; }
.search-results .result .meta strong { display: block; font-size: 13.5px; }
.search-results .result .meta span { font-size: 12px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.search-results .result .cat { flex: none; font-size: 11px; color: var(--brand); background: var(--brand-soft); padding: 2px 8px; border-radius: 999px; }
.search-empty { padding: 24px 18px 8px; text-align: center; }
.search-empty p { margin: 0 0 6px; font-size: 14px; color: var(--text-soft); }
.search-empty small { color: var(--muted); font-size: 12px; }
.search-empty .external { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.search-hint { padding: 10px 18px 14px; font-size: 11.5px; color: var(--muted); border-top: 1px dashed var(--line); }

/* ------------------------------ 登录弹窗 ------------------------------ */
.modal {
  position: fixed; inset: 0; z-index: 90; display: none; place-items: center;
  background: rgba(9, 14, 28, 0.5); padding: 20px;
}
.modal.open { display: grid; }
.modal-card {
  width: min(420px, 100%); background: var(--surface); border-radius: 22px;
  border: 1px solid var(--line); box-shadow: var(--shadow-lg); padding: 24px;
  animation: pop 0.2s ease; position: relative;
}
.modal-card h3 { margin: 0 0 4px; font-size: 20px; }
.modal-card .sub { margin: 0 0 18px; color: var(--muted); font-size: 12.5px; }
.modal-card .close { position: absolute; right: 14px; top: 14px; }
.tabs { display: flex; gap: 6px; padding: 4px; background: var(--surface-2); border-radius: 12px; margin-bottom: 16px; }
.tabs button { flex: 1; padding: 8px; border: 0; background: none; border-radius: 9px; font-size: 13px; font-weight: 650; color: var(--muted); }
.tabs button.active { background: var(--surface); color: var(--brand); box-shadow: var(--shadow-sm); }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.field input {
  width: 100%; padding: 11px 13px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface-2); outline: none; font-size: 14px;
}
.field input:focus { border-color: var(--brand); background: var(--surface); box-shadow: 0 0 0 3px var(--brand-soft); }
.form-error { min-height: 18px; color: var(--danger); font-size: 12px; margin: 4px 0 8px; }
.modal-foot { font-size: 11.5px; color: var(--muted); margin-top: 12px; line-height: 1.7; }

/* ------------------------------ 提示 ------------------------------ */
.toast-wrap { position: fixed; z-index: 120; top: 18px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; pointer-events: none; }
.toast {
  min-width: 180px; max-width: min(460px, 90vw); padding: 11px 16px; border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 94%, transparent); border: 1px solid var(--line);
  box-shadow: var(--shadow-md); font-size: 13px; animation: toastIn 0.2s ease;
}
.toast.ok { border-left: 3px solid var(--success); }
.toast.err { border-left: 3px solid var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } }

/* ------------------------------ 页脚 ------------------------------ */
.site-footer { margin: 46px 0 26px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.site-footer .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); display: inline-block; }

/* ------------------------------ 浮层组件 ------------------------------ */
.floating {
  position: fixed; z-index: 70;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid var(--line); box-shadow: var(--shadow-md);
  border-radius: 14px; backdrop-filter: blur(14px);
}

.size-badge {
  top: 84px; left: 18px; padding: 8px 14px; font-family: var(--mono);
  font-size: 12.5px; letter-spacing: 0.4px; color: var(--text-soft);
  display: flex; align-items: center; gap: 8px; cursor: grab;
  user-select: none; touch-action: none;
}
.size-badge:active { cursor: grabbing; }
.size-badge .live { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.size-badge.clock .live { background: var(--success); box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18); }
.size-badge b { font-weight: 700; }

/* 日志窗口 */
.logbook { width: 342px; right: 18px; bottom: 18px; display: flex; flex-direction: column; max-height: min(70vh, 460px); }
.logbook.min { left: auto; width: auto; max-height: none; background: transparent; border: 0; box-shadow: none; backdrop-filter: none; }
.logbook-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; cursor: grab; user-select: none; border-bottom: 1px solid var(--line); }
.logbook-head strong { font-size: 13px; display: flex; align-items: center; gap: 7px; }
.logbook-head .spacer { margin-left: auto; display: flex; gap: 4px; }
.logbook-body { padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.logbook.min .logbook-head, .logbook.min .logbook-body { display: none; }
.logbook-pill {
  display: none; align-items: center; gap: 8px; padding: 8px 14px;
  border-radius: 999px; border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: var(--shadow-md); backdrop-filter: blur(14px);
  color: var(--text-soft); font-size: 12.5px; cursor: pointer; white-space: nowrap;
}
.logbook.min .logbook-pill { display: inline-flex; }
.logbook-pill:hover, .logbook-pill:focus-visible { color: var(--text); border-color: var(--brand); }
.logbook-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.logbook-pill .pill-count {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--brand); color: #fff; font-size: 11px; font-family: var(--mono);
  display: grid; place-items: center;
}
.log-list {
  flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px;
  min-height: 120px; max-height: 200px; padding-right: 4px;
}
.log-entry { font-size: 12.2px; line-height: 1.5; padding: 7px 9px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line); word-break: break-word; }
.log-entry time { display: block; font-family: var(--mono); font-size: 10.5px; color: var(--muted); margin-bottom: 1px; }
.log-entry.alert { border-color: rgba(245, 158, 11, 0.35); background: rgba(245, 158, 11, 0.08); }
.log-input { display: flex; gap: 6px; }
.log-input textarea {
  flex: 1; resize: none; height: 46px; padding: 8px 10px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface-2); font-size: 12.5px; outline: none;
}
.log-input textarea:focus { border-color: var(--brand); background: var(--surface); }
.countdown-row { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.countdown-row input { width: 58px; padding: 6px 8px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface-2); text-align: center; font-size: 12px; }
.countdown-row .cd-display { margin-left: auto; font-family: var(--mono); font-size: 13px; font-weight: 700; color: var(--brand); }
.countdown-row .cd-display.done { color: var(--warn); }
.logbook-tools { display: flex; gap: 6px; }

/* 播放器容器由 player.css 定义 */

/* ------------------------------ 响应式 ------------------------------ */
@media (max-width: 1024px) {
  .search-wrap { max-width: none; }
  .top-nav { display: none; }
  .link-form { grid-template-columns: 1fr 1fr; }
  .link-form input[name="description"] { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  .container, .header-inner { width: calc(100% - 24px); }
  .brand-text small { display: none; }
  .header-inner { gap: 10px; flex-wrap: wrap; }
  .search-wrap { order: 3; flex-basis: 100%; max-width: none; }
  .header-actions { margin-left: auto; }
  .site-header { height: auto; min-height: var(--header-h); padding: 8px 0; }
  .hero { padding-top: 68px; }
  .hero-stats { width: 100%; }
  .section-head { flex-wrap: wrap; gap: 8px; }
  .section-head h2 { font-size: 17px; white-space: nowrap; }
  .section-head .hint { display: none; }
  .section-head .badge { font-size: 10.5px; padding: 2px 7px; }
  .site-card { flex-wrap: wrap; }
  .site-main { flex: 1 1 0; }
  .site-tip { flex: 1 1 100%; }
  .stat-chip { flex: 1; min-width: 0; }
  .grid { grid-template-columns: 1fr; }
  .site-tip { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; padding: 8px 0 0; pointer-events: auto; }
  .site-main .desc { display: none; }
  .site-tip .tip-tags { margin-bottom: 6px; }
  .link-form { grid-template-columns: 1fr; }
  .logbook { left: 10px; right: 10px; width: auto; bottom: 10px; }
  .size-badge { top: 136px; left: 12px; }
  .search-panel { margin-top: 76px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ==========================================================================
   LinkHub 2026 改造：壁纸、磁贴、折叠、日志/闹钟、响应式导航
   ========================================================================== */

/* ---- 背景轮播 ---- */
.wallpaper-layer {
  position: fixed; inset: 0; z-index: 0; overflow: hidden;
  pointer-events: none;
}
.wallpaper-layer span {
  position: absolute; inset: 0; background-position: center; background-size: cover;
  background-repeat: no-repeat; opacity: 0; transition: opacity 1.2s ease;
}
.wallpaper-shade {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(245, 247, 252, 0.16), rgba(245, 247, 252, 0.34));
}
[data-theme="dark"] .wallpaper-shade {
  background: linear-gradient(180deg, rgba(5, 8, 18, 0.42), rgba(5, 8, 18, 0.62));
}
body.has-wallpaper { background-color: transparent; background-image: none; }
body.has-wallpaper .site-header { background: color-mix(in srgb, var(--surface) 88%, transparent); }
body.has-wallpaper .hero > div:first-child {
  background: color-mix(in srgb, var(--surface) 66%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 55%, transparent);
  border-radius: 22px;
  padding: clamp(16px, 2.2vw, 26px);
  backdrop-filter: blur(12px) saturate(130%);
  box-shadow: var(--shadow-sm);
}
body.has-wallpaper .site-footer,
body.has-wallpaper .hero p { text-shadow: 0 1px 12px rgba(255, 255, 255, 0.35); }
[data-theme="dark"] body.has-wallpaper .site-footer,
[data-theme="dark"] body.has-wallpaper .hero p { text-shadow: 0 1px 12px rgba(0, 0, 0, 0.65); }
main.container { position: relative; z-index: 1; }
.site-header { z-index: 40; }

/* ---- 顶栏：任何宽度都不产生横向滚动条 ---- */
html, body { overflow-x: clip; }
.site-header { height: auto; min-height: var(--header-h); }
.header-inner { flex-wrap: wrap; padding: 8px 0; row-gap: 8px; }
.top-nav { display: flex; flex-wrap: wrap; overflow: visible; }
.search-wrap { min-width: 190px; }
.account-btn .account-name { max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-btn .avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* ---- 分类展开控件 ---- */
.nav-head { flex-wrap: wrap; }
.expand-controls {
  display: inline-flex; padding: 3px; gap: 3px; margin-left: auto;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px;
}
.seg-btn {
  border: 0; background: transparent; color: var(--muted); font-size: 12px; font-weight: 700;
  padding: 6px 11px; border-radius: 999px; white-space: nowrap;
}
.seg-btn.active { background: var(--surface); color: var(--brand); box-shadow: var(--shadow-sm); }
.nav-mode-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  color: var(--text-soft); font-size: 12px; line-height: 1.4; cursor: pointer;
  transition: color .15s ease, border-color .15s ease;
}
.nav-mode-btn:hover { color: var(--brand); border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.nav-mode-btn .caret { opacity: .65; }
.chip-bar.folded { display: none; }
#categories.folded .category-block.is-beyond { display: none; }
#categories.folded.fold-open .category-block.is-beyond { display: block; }
.fold-more { display: flex; justify-content: center; padding: 4px 0 10px; }
.fold-more[hidden] { display: none; }
.cat-glyph svg { width: 14px; height: 14px; display: block; }
.category-title .emoji .cat-glyph svg { width: 15px; height: 15px; }
.chip-bar { flex-wrap: wrap; overflow: visible; }
.chip { border: 1px solid var(--line); }
.cat-glyph {
  width: 22px; height: 22px; flex: none; display: inline-grid; place-items: center;
  border-radius: 7px; background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; font-size: 10.5px; font-weight: 800; letter-spacing: -0.2px; line-height: 1;
}
.category-title .emoji { width: 24px; height: 24px; display: inline-grid; place-items: center; font-size: 19px; }
.category-title .emoji .cat-glyph { width: 24px; height: 24px; font-size: 11.5px; border-radius: 8px; }
.chip.open { border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); color: var(--brand); }
.category-title {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 9px 0; margin: 0 0 12px; border: 0; background: none;
  color: var(--text); font-size: 16px; font-weight: 750; text-align: left;
}
.category-title:hover { color: var(--brand); }
.category-title .cat-chev {
  margin-left: 6px; color: var(--muted); font-size: 18px; line-height: 1;
  transition: transform 0.2s; transform: rotate(-90deg);
}
.category-block.open .cat-chev { transform: rotate(0deg); }
.category-block { border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent); padding-bottom: 10px; }
.category-block:last-child { border-bottom: 0; }
.category-block .grid { margin-top: 2px; }

/* ---- 官网卡片：说明只在悬停时出现，且与卡片无缝相连 ---- */
.site-card { padding: 12px 14px; align-items: center; }
.site-main strong { font-size: 14px; }
.site-main .host { font-size: 11px; }
.site-tip {
  top: 100%; left: -1px; right: -1px; margin-top: 0;
  border-top-left-radius: 0; border-top-right-radius: 0;
  border-top-color: color-mix(in srgb, var(--brand) 28%, var(--line));
  padding: 11px 14px 12px;
}
.site-card:hover .site-tip, .site-card:focus-within .site-tip { transform: none; }
.site-card:focus-visible .site-tip { opacity: 1; visibility: visible; }
.site-tip .tip-desc { margin-bottom: 7px; }
.site-tip .tip-tags { margin-bottom: 8px; }

/* ---- 下拉列表：背景与文字明确区分 ---- */
select, .engine-select {
  background-color: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
}
select option {
  background-color: var(--surface);
  color: var(--text);
}
[data-theme="dark"] select,
[data-theme="dark"] .engine-select,
[data-theme="dark"] select option {
  background-color: #141b2e;
  color: #eef2ff;
}
.engine-select { background-color: var(--surface-2); }
select:focus, .engine-select:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--brand-soft); }

/* ---- 我的链接：微软式快捷方式磁贴 ---- */
.my-top { display: flex; flex-direction: column; gap: 16px; }
.my-panel-head { margin-bottom: 0; }
.my-panel-head h3 { margin: 0; }
.quick-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 12px; margin-top: 16px;
}
.quick-tile-wrap { position: relative; min-width: 0; }
.quick-tile {
  width: 100%; min-height: 92px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 7px; padding: 10px 6px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px;
  color: var(--text); text-align: center; transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
}
.quick-tile:hover, .quick-tile:focus-visible {
  transform: translateY(-2px); border-color: color-mix(in srgb, var(--brand) 36%, var(--line));
  box-shadow: var(--shadow-sm);
}
.quick-icon {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line); overflow: hidden;
}
.quick-icon img { width: 30px; height: 30px; object-fit: contain; }
.quick-icon.plus { font-size: 24px; color: var(--muted); border-style: dashed; background: transparent; }
.quick-name {
  width: 100%; font-size: 12px; font-weight: 650; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis;
}
.quick-add { border-style: dashed; background: transparent; color: var(--muted); }
.quick-add:hover .quick-icon.plus { color: var(--brand); border-color: var(--brand); }
.quick-del {
  position: absolute; right: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  font-size: 14px; line-height: 1; display: grid; place-items: center; opacity: 0;
  transition: opacity 0.15s, color 0.15s;
}
.quick-tile-wrap:hover .quick-del, .quick-del:focus-visible { opacity: 1; }
.quick-del:hover { color: var(--danger); border-color: var(--danger); }
.icon-preview { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); margin: 4px 0 10px; }
.icon-preview .site-icon { background: var(--surface-2); }

/* ---- 设备信息：默认折叠 ---- */
.device-panel { padding: 0; overflow: hidden; }
.device-toggle {
  width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 16px 18px; border: 0; background: transparent; color: var(--text); text-align: left;
}
.device-title { display: flex; align-items: center; gap: 12px; }
.device-icon { width: 38px; height: 38px; border-radius: 11px; background: var(--surface-2); display: grid; place-items: center; font-size: 18px; }
.device-title strong { display: block; font-size: 15px; }
.device-title small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.device-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.device-actions .chev { color: var(--muted); font-size: 18px; transition: transform 0.2s; }
.device-panel.collapsed .device-actions .chev { transform: rotate(-90deg); }
.device-panel.collapsed .device-body { display: none; }
.device-body { padding: 0 18px 18px; }
.device-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.device-toolbar .hint { font-size: 12px; color: var(--muted); }
.device-toolbar .spacer { margin-left: auto; }

/* ---- 日志 / 闹钟窗口 ---- */
.logbook { width: 420px; max-height: min(82vh, 600px); }
.logbook-head { flex-wrap: wrap; row-gap: 4px; }
.logbook-tabs { display: flex; gap: 2px; }
.logbook-tab {
  border: 0; background: transparent; color: var(--muted); font-size: 12.5px; font-weight: 700;
  padding: 4px 8px; border-radius: 8px;
}
.logbook-tab.active { background: var(--brand-soft); color: var(--brand); }
.logbook-tab .badge { font-size: 10px; color: var(--muted); }
.logbook-body { gap: 9px; }
.logbook-panel { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.log-toolbar, .sound-row { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.log-toolbar .spacer, .sound-row .spacer { flex: 1; }
.mini-btn {
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text-soft);
  border-radius: 7px; font-size: 11px; padding: 4px 7px; line-height: 1.2; white-space: nowrap;
}
.mini-btn:hover { border-color: var(--brand); color: var(--brand); }
.mini-btn.active { background: var(--brand-soft); color: var(--brand); border-color: var(--brand); }
.mini-btn.danger:hover { color: var(--danger); border-color: var(--danger); }
.log-list { min-height: 130px; max-height: 235px; gap: 5px; }
.log-entry {
  display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: start; gap: 6px;
  font-size: 12px; padding: 7px 8px;
}
.log-entry.selecting { cursor: pointer; }
.log-check { margin: 2px 0 0; accent-color: var(--brand); }
.log-seq { font-family: var(--mono); font-size: 10px; color: var(--brand); padding-top: 1px; }
.log-body { min-width: 0; }
.log-body time { display: block; font-family: var(--mono); font-size: 9.5px; color: var(--muted); margin-bottom: 1px; }
.log-body p { margin: 0; word-break: break-word; line-height: 1.5; }
.log-del {
  border: 0; background: transparent; color: var(--muted); font-size: 15px; line-height: 1;
  width: 18px; height: 18px; border-radius: 5px; opacity: 0.55;
}
.log-del:hover { color: var(--danger); background: rgba(239, 68, 68, 0.1); opacity: 1; }
.sound-row { font-size: 11.5px; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 8px; }
.sound-row select { max-width: 150px; padding: 4px 6px; border-radius: 7px; font-size: 11px; }
.sound-state { color: var(--warn); font-size: 10.5px; }
.switch-row { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--text-soft); }
.switch-row input { accent-color: var(--brand); }
.alarm-form { display: flex; flex-direction: column; gap: 7px; }
.alarm-row { display: flex; align-items: flex-end; gap: 7px; flex-wrap: wrap; }
.alarm-row label { flex: 1 1 120px; display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--muted); }
.alarm-row input, .alarm-row select {
  width: 100%; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface-2); font-size: 12px;
}
.alarm-list { display: flex; flex-direction: column; gap: 6px; max-height: 190px; overflow: auto; }
.alarm-item {
  display: flex; align-items: center; gap: 9px; padding: 8px 9px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--line);
}
.alarm-item.off { opacity: 0.55; }
.alarm-time { font-family: var(--mono); font-size: 15px; font-weight: 700; color: var(--brand); }
.alarm-meta { min-width: 0; flex: 1; }
.alarm-meta strong { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alarm-meta span { display: block; font-size: 10px; color: var(--muted); }
.tiny-switch { position: relative; width: 30px; height: 17px; flex: none; }
.tiny-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.tiny-switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--surface-3); transition: background 0.2s; }
.tiny-switch span::after { content: ''; position: absolute; width: 13px; height: 13px; border-radius: 50%; background: #fff; top: 2px; left: 2px; transition: transform 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.tiny-switch input:checked + span { background: var(--brand); }
.tiny-switch input:checked + span::after { transform: translateX(13px); }
.alarm-del { border: 0; background: transparent; color: var(--muted); font-size: 16px; line-height: 1; }
.alarm-del:hover { color: var(--danger); }
.alarm-empty, .alarm-note { font-size: 11px; color: var(--muted); line-height: 1.55; }
.alarm-note { border-top: 1px dashed var(--line); padding-top: 7px; }

/* 日志桌面置顶小窗 */
body.pip-body { margin: 0; background: var(--bg); }
.logbook.in-pip {
  position: relative !important; left: auto !important; top: auto !important; right: auto !important;
  bottom: auto !important; width: 100%; max-height: none; height: 100vh; border-radius: 0; border: 0;
  box-shadow: none; backdrop-filter: none;
}
.logbook.in-pip .logbook-body { flex: 1; min-height: 0; }
.logbook.in-pip .log-list { max-height: none; flex: 1; }
.logbook.in-pip .logbook-head { cursor: default; }

/* 提醒弹窗 */
.ring-layer {
  position: fixed; inset: 0; z-index: 115; display: none; place-items: center;
  background: rgba(9, 14, 28, 0.58); backdrop-filter: blur(3px); padding: 20px;
}
.ring-layer.open { display: grid; }
.ring-card {
  width: min(360px, 100%); background: var(--surface); border: 1px solid var(--line);
  border-radius: 22px; box-shadow: var(--shadow-lg); padding: 24px; text-align: center;
  animation: pop 0.2s ease;
}
.ring-bell {
  width: 58px; height: 58px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff;
  font-size: 30px; font-weight: 800; line-height: 1; animation: ringBell 1.2s ease-in-out infinite;
  box-shadow: 0 10px 24px rgba(79, 70, 229, 0.3);
}
@keyframes ringBell { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-12deg); } 75% { transform: rotate(12deg); } }
.ring-card h3 { margin: 12px 0 4px; font-size: 20px; }
.ring-card p { margin: 0 0 18px; color: var(--muted); font-size: 13px; }
.ring-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* 壁纸设置弹窗 */
.modal-wide { width: min(780px, 100%); }
.wallpaper-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-height: 340px; overflow: auto; margin-bottom: 14px; }
.wallpaper-item { position: relative; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.wallpaper-item.active { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.wallpaper-item img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.wallpaper-item-meta { position: absolute; inset: auto 0 0; padding: 16px 8px 6px; background: linear-gradient(transparent, rgba(0,0,0,.62)); color: #fff; }
.wallpaper-item-meta strong { display: block; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wallpaper-item-meta span { display: block; font-size: 9px; opacity: 0.8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wallpaper-pick {
  position: absolute; right: 6px; top: 6px; border: 1px solid rgba(255,255,255,.55);
  background: rgba(0,0,0,.45); color: #fff; border-radius: 7px; font-size: 10px; padding: 3px 7px;
}
.wallpaper-item.active .wallpaper-pick { background: var(--brand); border-color: var(--brand); }
.wallpaper-remove {
  position: absolute; left: 6px; top: 6px; width: 20px; height: 20px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.55); background: rgba(0,0,0,.45); color: #fff; line-height: 1;
  font-size: 13px;
}
.wallpaper-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.wallpaper-controls label { display: inline-flex; align-items: center; gap: 6px; }
.wallpaper-controls select { padding: 6px 8px; border-radius: 8px; font-size: 12px; }
.wallpaper-note { margin-top: 10px; font-size: 11px; color: var(--muted); line-height: 1.6; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

/* ---- 响应式：导航自适应，避免横向滚动 ---- */
@media (max-width: 1024px) {
  .top-nav { display: flex; }
  .header-inner { gap: 10px; }
  .search-wrap { flex: 1 1 280px; max-width: none; }
  .quick-grid { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }
  .wallpaper-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .container, .header-inner { width: calc(100% - 20px); }
  .site-header { padding: 6px 0; }
  .header-inner { flex-wrap: wrap; row-gap: 6px; }
  .brand img { width: 30px; height: 30px; }
  .brand-text { font-size: 16px; }
  .brand-text small { display: none; }
  .top-nav { order: 4; flex-basis: 100%; justify-content: flex-start; gap: 2px; }
  .top-nav a { padding: 6px 9px; font-size: 12.5px; }
  .search-wrap { order: 3; flex-basis: 100%; gap: 6px; }
  .header-actions { margin-left: auto; gap: 4px; }
  .icon-btn { width: 34px; height: 34px; }
  .account-btn { padding: 6px 9px; }
  .account-btn .account-name { max-width: 72px; font-size: 12px; }
  .hero { padding-top: 22px; }
  .hero-stats { width: 100%; }
  .nav-head { align-items: flex-start; }
  .expand-controls { margin-left: 0; }
  .grid { grid-template-columns: 1fr; }
  .site-tip { display: none; }
  .quick-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .quick-tile { min-height: 82px; }
  .wallpaper-grid { grid-template-columns: 1fr 1fr; }
  .logbook { left: 8px; right: 8px; width: auto; bottom: 8px; max-height: 76vh; }
  .size-badge { display: none; }
  .logbook-head { padding: 8px 10px; }
  .log-list { max-height: 180px; }
  .sound-row select { max-width: 118px; }
  .device-title small { font-size: 11px; }
  .device-toggle { padding: 13px 14px; }
  .device-body { padding: 0 14px 14px; }
  .modal-wide { width: 100%; }
  .wallpaper-item-meta strong { font-size: 10px; }
}

/* ---- 服务器账号 ---- */
.auth-account .account-name { max-width: 72px; }
.auth-tabs { display: flex; gap: 3px; padding: 3px; margin: 2px 0 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; }
.auth-tabs button { flex: 1; border: 0; background: transparent; color: var(--muted); font-size: 12.5px; font-weight: 700; padding: 7px 9px; border-radius: 8px; }
.auth-tabs button.active { background: var(--surface); color: var(--brand); box-shadow: var(--shadow-sm); }
.auth-remember { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; color: var(--text-soft); margin: 6px 0 10px; }
.auth-remember input { accent-color: var(--brand); }
.auth-warning { color: var(--warn); font-size: 11px; }
.auth-warning.danger { color: var(--danger); font-weight: 700; }
.auth-session { display: flex; flex-direction: column; gap: 10px; }
.auth-session-head { display: flex; align-items: center; gap: 11px; padding: 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.auth-session-head .avatar { width: 42px; height: 42px; flex: none; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-weight: 800; font-size: 14px; }
.auth-session-head strong { display: block; font-size: 14px; }
.auth-session-head span { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.auth-session .modal-actions { margin-top: 2px; }
@media (max-width: 1100px) {
  .auth-account .account-name { display: none; }
  .auth-account { padding: 6px; }
}

/* ---- 帮助与反馈 ---- */
.footer-link { border: 0; background: transparent; color: var(--muted); font-size: 12px; padding: 2px 6px; border-radius: 6px; }
.footer-link:hover { color: var(--brand); background: var(--brand-soft); }
.feedback-hint { margin-right: auto; font-size: 11px; color: var(--muted); max-width: 260px; line-height: 1.5; }
#feedbackContent { resize: vertical; min-height: 110px; }

/* ---- 壁纸透明度与网页图片捕获 ---- */
.opacity-control { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }
.opacity-control input[type="range"] { width: 110px; accent-color: var(--brand); }
#wallpaperOpacityValue { font-family: var(--mono); font-size: 10.5px; color: var(--text-soft); min-width: 34px; }
.capture-panel { margin-top: 14px; padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.capture-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 9px; }
.capture-head strong { font-size: 13px; }
.capture-head span { font-size: 11px; color: var(--muted); line-height: 1.5; }
.capture-row { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.capture-row input { flex: 1 1 260px; min-width: 0; padding: 7px 9px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 12px; }
.capture-dir-row { margin-top: 8px; font-size: 11px; color: var(--muted); }
.capture-status { margin-top: 8px; font-size: 11px; color: var(--muted); line-height: 1.5; }
.capture-results { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; max-height: 260px; overflow: auto; }
.capture-item { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); }
.capture-item img { width: 100%; aspect-ratio: 16/9; object-fit: contain; background: var(--surface-2); display: block; }
.capture-meta { padding: 6px 7px; }
.capture-meta strong { display: block; font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.capture-meta span { display: block; font-size: 9.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.capture-actions { display: flex; gap: 4px; margin-top: 5px; }
.capture-actions button { flex: 1; border: 1px solid var(--line); background: var(--surface-2); color: var(--text-soft); border-radius: 6px; font-size: 10px; padding: 3px 4px; }
.capture-actions button:hover { color: var(--brand); border-color: var(--brand); }
@media (max-width: 760px) { .capture-results { grid-template-columns: 1fr 1fr; } .opacity-control input { width: 80px; } }

/* ---- 我的链接排序 ---- */
.section-drag { flex: none; display: inline-grid; place-items: center; width: 30px; height: 30px; touch-action: none; user-select: none; border: 1px dashed var(--line); border-radius: 8px; background: var(--surface-2); color: var(--muted); cursor: grab; font-size: 18px; line-height: 1; }
.section-drag:active { cursor: grabbing; }
.section-drag:hover { color: var(--brand); border-color: var(--brand); }
.quick-grid.sorting .quick-tile-wrap { outline: 1px dashed color-mix(in srgb, var(--brand) 26%, transparent); outline-offset: 2px; }
.quick-tile-wrap.dragging { opacity: .35; }
.quick-tile-wrap.drag-over { transform: translateY(-3px); box-shadow: 0 0 0 3px var(--brand-soft); border-radius: 14px; }
.quick-move { position: absolute; left: 3px; bottom: 3px; width: 20px; height: 20px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--muted); font-size: 12px; line-height: 1; display: grid; place-items: center; }
.quick-move.next { left: auto; right: 3px; }
.quick-move:hover { color: var(--brand); border-color: var(--brand); }
body.section-dragging .section[data-section] { outline: 1px dashed color-mix(in srgb, var(--brand) 30%, transparent); outline-offset: 4px; }
body.section-dragging .section[data-section] .panel { opacity: .94; }
body.section-dragging .section-drop-target { outline: 2px solid var(--brand); outline-offset: 4px; border-radius: 16px; }
