/* ============ 十依的小站 · style.css ============ */
:root {
  --bg: #f4f6fb;
  --card: rgba(255, 255, 255, .78);
  --card-solid: #ffffff;
  --txt: #1f2430;
  --muted: #6b7280;
  --line: rgba(17, 24, 39, .08);
  --pri: #6366f1;
  --pri2: #8b5cf6;
  --ok-bg: #ecfdf5; --ok-tx: #047857;
  --err-bg: #fef2f2; --err-tx: #b91c1c;
  --shadow: 0 8px 28px rgba(30, 41, 59, .08);
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1218;
    --card: rgba(23, 28, 38, .8);
    --card-solid: #171c26;
    --txt: #e5e9f0;
    --muted: #9aa3b2;
    --line: rgba(255, 255, 255, .09);
    --shadow: 0 8px 28px rgba(0, 0, 0, .35);
  }
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background: var(--bg); color: var(--txt);
  min-height: 100vh; line-height: 1.6;
}
a { color: var(--pri); text-decoration: none; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.main { padding-top: 18px; padding-bottom: 48px; min-height: calc(100vh - 160px); }

/* 背景光斑 */
.bg-orbs { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg-orbs i { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .35; }
.bg-orbs i:nth-child(1) { width: 480px; height: 480px; background: #c7d2fe; top: -160px; left: -120px; }
.bg-orbs i:nth-child(2) { width: 380px; height: 380px; background: #ddd6fe; top: 30%; right: -140px; }
.bg-orbs i:nth-child(3) { width: 420px; height: 420px; background: #bae6fd; bottom: -180px; left: 30%; }
@media (prefers-color-scheme: dark) {
  .bg-orbs i:nth-child(1) { background: #312e81; }
  .bg-orbs i:nth-child(2) { background: #4c1d95; }
  .bg-orbs i:nth-child(3) { background: #0c4a6e; }
  .bg-orbs i { opacity: .25; }
}

/* 顶栏 */
.topbar { position: sticky; top: 0; z-index: 50; backdrop-filter: blur(14px); background: color-mix(in srgb, var(--bg) 78%, transparent); border-bottom: 1px solid var(--line); }
.topbar-in { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; color: var(--txt); white-space: nowrap; }
.brand-dot { width: 26px; height: 26px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 14px; }
.nav { display: flex; align-items: center; gap: 4px; overflow-x: auto; }
.nav a { padding: 7px 13px; border-radius: 10px; color: var(--muted); font-size: 14.5px; white-space: nowrap; transition: .18s; }
.nav a:hover { background: var(--card); color: var(--txt); }
.nav a.on { background: linear-gradient(135deg, var(--pri), var(--pri2)); color: #fff; font-weight: 600; }

/* Hero */
.hero { text-align: center; padding: 42px 0 26px; }
.hero h1 { font-size: clamp(26px, 4.5vw, 38px); letter-spacing: .5px; }
.hero .sub { color: var(--muted); margin-top: 8px; font-size: 15px; }
.search-box { max-width: 560px; margin: 22px auto 0; display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 12px 20px; box-shadow: var(--shadow); backdrop-filter: blur(10px); }
.search-box .ico { color: var(--muted); flex: none; }
.search-box input { flex: 1; border: 0; outline: 0; background: transparent; color: var(--txt); font-size: 15px; }

/* 分类 */
.cat { margin-top: 34px; }
.nav-section .search-box { margin: 8px auto 0; }
.cat-title { display: flex; align-items: center; gap: 9px; font-size: 19px; margin-bottom: 14px; }
.cat-icon { font-size: 20px; }
.cat-title small { color: var(--muted); font-weight: 400; font-size: 13px; background: var(--card); border: 1px solid var(--line); padding: 1px 9px; border-radius: 999px; }

/* 卡片网格 */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.card { display: flex; align-items: center; gap: 13px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 16px; color: var(--txt); box-shadow: var(--shadow); backdrop-filter: blur(10px); transition: .18s; }
a.card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--pri) 45%, transparent); }
.badge { flex: none; width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 19px; font-weight: 700; }
.card-txt { min-width: 0; display: flex; flex-direction: column; }
.card-name { font-weight: 600; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-desc { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-host { color: var(--muted); font-size: 11.5px; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 介绍页 */
.about-hero { display: flex; flex-direction: column; align-items: center; }
.avatar { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 40px; font-weight: 800; box-shadow: var(--shadow); border: 3px solid #fff; }
@media (prefers-color-scheme: dark) { .avatar { border-color: #262d3d; } }
.about-hero .sub { max-width: 640px; margin-top: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 7px 16px; font-size: 14px; box-shadow: var(--shadow); backdrop-filter: blur(10px); }
.contact-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.about-more { display: block; flex-direction: initial; }
.about-more h3 { margin-bottom: 6px; }
.about-more p { color: var(--muted); font-size: 14.5px; }

/* 空状态 */
.empty { text-align: center; color: var(--muted); padding: 40px 0; }
.empty.small { padding: 16px 0; font-size: 14px; grid-column: 1 / -1; }

/* 页脚 */
.footer { border-top: 1px solid var(--line); padding: 18px 0 26px; color: var(--muted); font-size: 13.5px; text-align: center; }
.foot-stat b { color: var(--pri); }
.sep { margin: 0 7px; opacity: .5; }

/* ============ 后台 ============ */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card { width: min(380px, 92vw); background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 34px 30px; text-align: center; backdrop-filter: blur(12px); }
.login-card h1 { font-size: 24px; }
.login-card .sub { color: var(--muted); font-size: 13.5px; margin: 4px 0 18px; }
.login-card .tiny { margin-top: 16px; font-size: 13px; color: var(--muted); }

.ipt { width: 100%; padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--card-solid); color: var(--txt); font-size: 14.5px; outline: none; transition: .15s; font-family: inherit; }
.ipt:focus { border-color: var(--pri); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pri) 18%, transparent); }
textarea.ipt { resize: vertical; }
.ipt.sm { width: auto; min-width: 150px; }
.ipt.xs { width: 84px; }
select.ipt { appearance: auto; }

.btn { border: 1px solid var(--line); background: var(--card-solid); color: var(--txt); padding: 10px 18px; border-radius: 10px; cursor: pointer; font-size: 14px; transition: .15s; white-space: nowrap; }
.btn:hover { border-color: var(--pri); color: var(--pri); }
.btn.primary { background: linear-gradient(135deg, var(--pri), var(--pri2)); border: 0; color: #fff; font-weight: 600; }
.btn.primary:hover { opacity: .88; color: #fff; }
.btn.danger { color: #dc2626; border-color: rgba(220, 38, 38, .35); }
.btn.danger:hover { background: var(--err-bg); }
.btn.full { width: 100%; margin-top: 6px; }

.alert { max-width: 720px; margin: 0 auto 16px; padding: 11px 16px; border-radius: 10px; font-size: 14px; }
.alert.ok { background: var(--ok-bg); color: var(--ok-tx); border: 1px solid rgba(4, 120, 87, .25); }
.alert.err { background: var(--err-bg); color: var(--err-tx); border: 1px solid rgba(185, 28, 28, .25); margin-bottom: 12px; }

.pg { font-size: 22px; margin: 10px 0 18px; }
.admin-body .card { padding: 16px 18px; margin-bottom: 14px; }
.admin-body .card.narrow { max-width: 460px; }
.admin-body h3 { font-size: 15.5px; margin-bottom: 10px; }
.lb { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 5px; }
.row-form { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }
.row-form .ipt { flex: 1 1 170px; }
.row-form .ipt.sm { flex: 0 1 auto; }
.row-form .ipt.xs { flex: 0 0 auto; }
.inline-del { margin-top: 9px; }
.card { position: relative; }
.admin-body .card > .row-form + .inline-del { position: absolute; right: 16px; bottom: 14px; }
.admin-body .card { padding-bottom: 48px; }
.admin-body .card:has(> form:not(.inline-del):last-child) { padding-bottom: 18px; }

/* 统计 */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.stat-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 10px; text-align: center; box-shadow: var(--shadow); backdrop-filter: blur(10px); }
.stat-box b { display: block; font-size: 30px; background: linear-gradient(135deg, var(--pri), var(--pri2)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.stat-box span { color: var(--muted); font-size: 13px; }
.chart-card h3 { margin-bottom: 14px; }
.bars { display: flex; align-items: flex-end; gap: 5px; height: 170px; overflow-x: auto; padding-bottom: 4px; }
.bar-col { flex: 1; min-width: 26px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; }
.bar { width: 100%; max-width: 30px; background: linear-gradient(180deg, var(--pri), var(--pri2)); border-radius: 6px 6px 2px 2px; opacity: .85; }
.bar-col:hover .bar { opacity: 1; }
.bar-n { font-size: 10.5px; color: var(--muted); }
.bar-d { font-size: 10px; color: var(--muted); }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.tbl th { color: var(--muted); font-weight: 500; font-size: 13px; }

/* 响应式 */
@media (max-width: 720px) {
  .topbar-in { flex-direction: column; height: auto; padding: 10px 0; gap: 8px; }
  .nav { width: 100%; justify-content: center; }
  .hero { padding-top: 26px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
  .badge { width: 38px; height: 38px; font-size: 16px; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .row-form .ipt { flex: 1 1 100%; }
  .row-form .btn { flex: 1 1 100%; }
  .admin-body .card { padding-bottom: 18px; }
  .admin-body .card > .row-form + .inline-del { position: static; margin-top: 9px; }
}
