/* =========================================================
   软件之家 — 前台样式
   ========================================================= */
:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #171a21;
  --text-2: #4b5563;
  --muted: #8a93a5;
  --line: #e8ecf4;
  --brand: #2f6bff;
  --brand-2: #5b8bff;
  --brand-3: #8fb2ff;
  --brand-dark: #1f52d6;
  --brand-soft: #eef3ff;
  --brand-ink: #2f6bff;
  --brand-rgb: 47, 107, 255;
  --ok: #16a34a;
  --warn: #f59e0b;
  /* 中性填充（浅色主题） */
  --soft: #f2f5fb;
  --field: #f7f9fd;
  --hover: #f7f9fd;
  --tint-a: #eef3ff;
  --tint-b: #dbe6ff;
  --header-bg: rgba(255, 255, 255, .88);
  --ok-bg: #e9f9ef;
  --warn-bg: #fff4e5;
  --warn-ink: #b56a00;
  --gray-bg: #eef1f7;
  --notice-bg: #fff8e6;
  --notice-line: #ffe3a3;
  --notice-ink: #8a5a00;
  --gold-bg: #fff8e6;
  --gold-line: #ffd27a;
  --gold-ink: #b56a00;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(20, 30, 60, .04), 0 8px 24px rgba(20, 30, 60, .06);
  --shadow-hover: 0 6px 14px rgba(20, 30, 60, .08), 0 18px 40px rgba(20, 30, 60, .10);
  --maxw: 1200px;
}

/* 暗夜主题：覆盖中性色，品牌色仍由 JS 按后台配置注入 */
[data-theme="dark"] {
  --bg: #0f1320;
  --card: #171d2c;
  --text: #e9edf7;
  --text-2: #b6c0d4;
  --muted: #7e8aa3;
  --line: #262f45;
  --soft: #1e2637;
  --field: #1b2334;
  --hover: #1a2131;
  --tint-a: #1b2436;
  --tint-b: #22304a;
  --header-bg: rgba(17, 23, 35, .86);
  --ok-bg: rgba(22, 163, 74, .16);
  --warn-bg: rgba(245, 158, 11, .16);
  --warn-ink: #f0b250;
  --gray-bg: #232c3e;
  --notice-bg: rgba(245, 158, 11, .12);
  --notice-line: rgba(245, 158, 11, .32);
  --notice-ink: #e6b566;
  --gold-bg: rgba(245, 166, 35, .16);
  --gold-line: rgba(245, 166, 35, .38);
  --gold-ink: #f0b95e;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 8px 24px rgba(0, 0, 0, .38);
  --shadow-hover: 0 6px 14px rgba(0, 0, 0, .45), 0 18px 40px rgba(0, 0, 0, .52);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.hidden { display: none !important; }

/* ---------------- 顶部导航 ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; gap: 22px; height: 64px;
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; letter-spacing: .3px; white-space: nowrap; }
.logo .mark {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-3));
  color: #fff; font-size: 17px; box-shadow: 0 4px 12px rgba(var(--brand-rgb), .35);
}
.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav a {
  padding: 7px 12px; border-radius: 9px; color: var(--text-2); font-weight: 500;
  transition: .16s;
}
.main-nav a:hover { background: var(--brand-soft); color: var(--brand-ink); }
.main-nav a.active { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }

.header-search { margin-left: auto; position: relative; }
.header-search input {
  width: 230px; height: 38px; padding: 0 38px 0 14px; border-radius: 19px;
  border: 1px solid var(--line); background: var(--field); outline: none; transition: .18s;
}
.header-search input:focus { width: 280px; border-color: var(--brand-2); background: var(--card); box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .12); }
.header-search .ico {
  position: absolute; right: 13px; top: 50%; transform: translateY(-50%);
  color: var(--muted); pointer-events: none; font-size: 14px;
}
.admin-link {
  padding: 8px 15px; border-radius: 9px; border: 1px solid var(--line);
  color: var(--text-2); font-weight: 500; white-space: nowrap; transition: .16s;
}
.admin-link:hover { border-color: var(--brand-2); color: var(--brand-ink); background: var(--brand-soft); }

/* ---------------- 英雄区 ---------------- */
.hero {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 45%, var(--brand-3) 100%);
  color: #fff; padding: 46px 0 40px; position: relative; overflow: hidden;
}
.hero::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 85% 15%, rgba(255,255,255,.22), transparent 45%),
              radial-gradient(circle at 10% 90%, rgba(255,255,255,.12), transparent 40%);
  pointer-events: none;
}
.hero .wrap { position: relative; z-index: 1; }
.hero h1 { font-size: 30px; font-weight: 800; letter-spacing: .5px; margin-bottom: 8px; }
.hero p { opacity: .92; font-size: 15px; margin-bottom: 22px; }
.hero-search { display: flex; max-width: 620px; background: #fff; border-radius: 14px; padding: 6px; box-shadow: 0 12px 30px rgba(10, 30, 80, .18); }
.hero-search input {
  flex: 1; border: 0; outline: none; padding: 0 16px; height: 46px; font-size: 15px; background: transparent;
  color: #171a21;   /* 输入框底始终为白色，文字固定深色，避免暗夜下看不见 */
}
.hero-search button {
  border: 0; padding: 0 30px; height: 46px; border-radius: 10px; cursor: pointer;
  background: var(--brand); color: #fff; font-weight: 600; font-size: 15px; transition: .16s;
}
.hero-search button:hover { background: var(--brand-dark); }
.hero-tags { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; font-size: 13px; }
.hero-tags .lbl { opacity: .85; }
.hero-tags a {
  background: rgba(255, 255, 255, .18); padding: 4px 12px; border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, .28); transition: .16s;
}
.hero-tags a:hover { background: rgba(255, 255, 255, .32); }

/* ---------------- 公告 ---------------- */
.notice {
  display: flex; gap: 10px; align-items: center; margin: 20px 0 -4px;
  background: var(--notice-bg); border: 1px solid var(--notice-line); color: var(--notice-ink);
  padding: 10px 16px; border-radius: var(--radius-sm); font-size: 13px;
}
.notice .tag {
  background: var(--warn); color: #fff; padding: 1px 8px; border-radius: 6px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}

/* ---------------- 主体两栏 ---------------- */
.main-grid { display: grid; grid-template-columns: 1fr 300px; gap: 24px; padding: 26px 0 44px; align-items: start; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-head {
  display: flex; align-items: center; gap: 12px; padding: 16px 20px;
  border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.panel-head h2 { font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.panel-head h2::before {
  content: ''; width: 4px; height: 17px; border-radius: 2px;
  background: linear-gradient(180deg, var(--brand), var(--brand-2));
}
.panel-head .count { color: var(--muted); font-size: 13px; font-weight: 400; }
.panel-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* 筛选工具条 */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 14px 20px 0; }
.chip {
  padding: 6px 14px; border-radius: 20px; border: 1px solid var(--line); background: var(--card);
  color: var(--text-2); cursor: pointer; transition: .16s; font-size: 13px;
}
.chip:hover { border-color: var(--brand-2); color: var(--brand-ink); }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.sort-tabs { margin-left: auto; display: flex; gap: 2px; background: var(--soft); border-radius: 9px; padding: 3px; }
.sort-tabs button {
  border: 0; background: transparent; padding: 5px 14px; border-radius: 7px;
  cursor: pointer; color: var(--text-2); font-size: 13px; transition: .16s;
}
.sort-tabs button.active { background: var(--card); color: var(--brand-ink); font-weight: 600; box-shadow: 0 1px 4px rgba(20,30,60,.1); }

/* ---------------- 软件卡片 ---------------- */
.sw-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 16px 20px 20px; }
.sw-card {
  display: flex; gap: 13px; padding: 15px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--card); transition: .18s; position: relative;
}
.sw-card:hover { border-color: var(--brand-2); box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.sw-icon {
  width: 52px; height: 52px; border-radius: 13px; flex: none; object-fit: cover;
  background: linear-gradient(135deg, var(--tint-a), var(--tint-b)); display: grid; place-items: center;
  font-size: 22px; font-weight: 700; color: var(--brand-ink); overflow: hidden;
}
.sw-icon img { width: 100%; height: 100%; object-fit: cover; }
.sw-body { flex: 1; min-width: 0; }
.sw-title { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.sw-title h3 { font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sw-title h3 a:hover { color: var(--brand-ink); }
.sw-title .ver { font-size: 12px; color: var(--muted); }
.sw-meta { display: flex; gap: 6px; flex-wrap: wrap; color: var(--muted); font-size: 12px; margin-top: 3px; }
.sw-meta .dot { opacity: .45; }
.sw-desc {
  color: var(--text-2); font-size: 13px; margin-top: 7px; line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.sw-foot { display: flex; align-items: center; gap: 10px; margin-top: 11px; flex-wrap: wrap; }
.sw-foot .dl-count { color: var(--muted); font-size: 12px; }
.sw-foot .dl-count b { color: var(--text-2); font-weight: 600; }
.sw-foot .fav-count { color: var(--muted); font-size: 12px; white-space: nowrap; }
.sw-foot .fav-count b { color: var(--text-2); font-weight: 600; }
.badge {
  font-size: 11px; padding: 1px 7px; border-radius: 5px; font-weight: 600; white-space: nowrap;
}
.badge.blue { background: var(--brand-soft); color: var(--brand-ink); }
.badge.green { background: var(--ok-bg); color: var(--ok); }
.badge.orange { background: var(--warn-bg); color: var(--warn-ink); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; cursor: pointer; border-radius: 9px; font-weight: 600; transition: .16s;
  white-space: nowrap; text-decoration: none;
}
.btn-dl {
  margin-left: auto; padding: 8px 18px; background: var(--brand); color: #fff;
  font-size: 13px; box-shadow: 0 4px 12px rgba(var(--brand-rgb), .28);
}
.btn-dl:hover { background: var(--brand-dark); box-shadow: 0 6px 16px rgba(var(--brand-rgb), .38); }
.btn-ghost { padding: 8px 16px; background: var(--soft); color: var(--text-2); font-size: 13px; }
.btn-ghost:hover { background: var(--brand-soft); color: var(--brand-ink); }
.btn-lg { padding: 13px 40px; font-size: 16px; border-radius: 11px; }

/* ---------------- 分页 ---------------- */
.pager { display: flex; gap: 6px; justify-content: center; align-items: center; padding: 4px 20px 22px; flex-wrap: wrap; }
.pager button {
  min-width: 36px; height: 36px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--card); color: var(--text-2); cursor: pointer; transition: .16s;
}
.pager button:hover:not(:disabled) { border-color: var(--brand-2); color: var(--brand-ink); }
.pager button.active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.pager button:disabled { opacity: .45; cursor: not-allowed; }
.pager .info { color: var(--muted); font-size: 13px; margin-left: 6px; }

/* ---------------- 侧栏 ---------------- */
.side { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 84px; }
.side-block { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.side-block > h3 {
  font-size: 14px; padding: 14px 16px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 7px; font-weight: 700;
}
.side-block > h3 .more { margin-left: auto; font-size: 12px; color: var(--muted); font-weight: 400; }
.cat-list { padding: 8px; }
.cat-list a {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 9px;
  color: var(--text-2); transition: .16s;
}
.cat-list a:hover { background: var(--brand-soft); color: var(--brand-ink); }
.cat-list a.active { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
.cat-list .ico { font-size: 16px; width: 20px; text-align: center; }
.cat-list .n { margin-left: auto; font-size: 12px; color: var(--muted); background: var(--soft); padding: 0 8px; border-radius: 10px; }
.cat-list a.active .n { background: var(--card); }

.rank-list { padding: 6px; }
.rank-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; transition: .16s; }
.rank-item:hover { background: var(--hover); }
.rank-item .no {
  width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center;
  font-size: 12px; font-weight: 700; background: var(--gray-bg); color: var(--muted); flex: none;
}
.rank-item:nth-child(1) .no { background: #ffe3e3; color: #e04040; }
.rank-item:nth-child(2) .no { background: #ffeede; color: #dd7f1a; }
.rank-item:nth-child(3) .no { background: #fff6d8; color: #b89100; }
.rank-item .nm { flex: 1; min-width: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-item .cnt { font-size: 12px; color: var(--muted); }

/* ---------------- 空状态 / 加载 ---------------- */
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty .big { font-size: 42px; margin-bottom: 12px; opacity: .5; }
.skeleton-card { height: 112px; border-radius: var(--radius-sm); background: linear-gradient(90deg, var(--soft) 25%, var(--field) 37%, var(--soft) 63%); background-size: 400% 100%; animation: sk 1.3s ease infinite; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------------- 详情页 ---------------- */
.crumb { padding: 18px 0 0; color: var(--muted); font-size: 13px; display: flex; gap: 8px; align-items: center; }
.crumb a:hover { color: var(--brand-ink); }

.app-head {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 26px; margin-top: 16px;
  display: flex; gap: 24px; align-items: flex-start;
}
.app-icon {
  width: 96px; height: 96px; border-radius: 22px; flex: none; overflow: hidden;
  background: linear-gradient(135deg, var(--tint-a), var(--tint-b)); display: grid; place-items: center;
  font-size: 40px; font-weight: 700; color: var(--brand-ink);
}
.app-icon img { width: 100%; height: 100%; object-fit: cover; }
.app-main { flex: 1; min-width: 0; }
.app-main h1 { font-size: 24px; font-weight: 800; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.app-main h1 .ver { font-size: 14px; color: var(--muted); font-weight: 500; }
.app-sub { color: var(--text-2); margin-top: 8px; font-size: 14px; }
.app-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.app-chips .badge { padding: 4px 11px; font-size: 12px; }
.app-actions { display: flex; gap: 12px; align-items: center; margin-top: 20px; flex-wrap: wrap; }
.app-actions .hint { color: var(--muted); font-size: 12px; }

.meta-table { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-top: 16px; }
.meta-table .cell { background: var(--card); padding: 14px 16px; }
.meta-table .k { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.meta-table .v { font-weight: 600; font-size: 14px; word-break: break-all; }

/* 标签页 */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-top: 20px; padding: 0 6px; }
.tabs button {
  border: 0; background: transparent; padding: 12px 18px; cursor: pointer; color: var(--text-2);
  font-weight: 600; font-size: 14px; position: relative; transition: .16s;
}
.tabs button:hover { color: var(--brand-ink); }
.tabs button.active { color: var(--brand-ink); }
.tabs button.active::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--brand); }
.tab-body { padding: 22px 24px 26px; }
.prose { color: var(--text-2); font-size: 14.5px; line-height: 1.9; }
.prose p { margin: 0 0 12px; }
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.shots img { border-radius: var(--radius-sm); border: 1px solid var(--line); cursor: zoom-in; transition: .18s; }
.shots img:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.tag-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.tag-row .badge { padding: 4px 12px; }

.lightbox { position: fixed; inset: 0; background: rgba(10, 14, 25, .82); display: none; place-items: center; z-index: 200; padding: 30px; }
.lightbox.on { display: grid; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }

/* ---------------- 页脚 ---------------- */
.site-footer { background: var(--card); border-top: 1px solid var(--line); padding: 28px 0; margin-top: auto; }
.site-footer .wrap { color: var(--muted); font-size: 13px; text-align: center; line-height: 1.9; }
.site-footer a { color: var(--text-2); }
.site-footer a:hover { color: var(--brand-ink); }

/* ---------------- Toast ---------------- */
#toast { position: fixed; left: 50%; bottom: 46px; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: rgba(23, 26, 33, .94); color: #fff; padding: 11px 20px; border-radius: 10px;
  font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.25); animation: toastIn .22s ease;
}
.toast.ok { background: #14803c; }
.toast.err { background: #c5362f; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* =========================================================
   v3 新增组件
   ========================================================= */
.hidden { display: none !important; }
.muted { color: var(--muted); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* 顶部导航：Q群链接 / 头像 */
.qgroup-link {
  padding: 8px 15px; border-radius: 9px; border: 1px solid var(--line);
  color: var(--text-2); font-weight: 500; white-space: nowrap; transition: .16s;
}
.qgroup-link:hover { border-color: var(--brand-2); color: var(--brand-ink); background: var(--brand-soft); }
.nav-avatar { display: inline-flex; vertical-align: -4px; margin-right: 6px; }
.main-nav a .avatar { width: 20px; height: 20px; font-size: 11px; }

/* 页头 */
.page-head { padding: 26px 0 4px; }
.page-head h1 { font-size: 26px; font-weight: 800; letter-spacing: .3px; }
.page-head p { color: var(--text-2); margin-top: 8px; font-size: 14px; }

/* 工具条标签 */
.tb-lbl { color: var(--muted); font-size: 13px; }
.cat-dot {
  width: 7px; height: 7px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, var(--brand), var(--brand-3));
}

/* 徽章 / 按钮补充 */
.badge.gray { background: var(--gray-bg); color: var(--muted); }
.btn-sm { padding: 6px 13px; font-size: 12.5px; }
.btn-block { width: 100%; }
.loading { text-align: center; padding: 46px 20px; color: var(--muted); font-size: 14px; }

/* 整数卡片可点击 */
.sw-card { cursor: pointer; }
.sw-card:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.sw-card:hover .sw-title h3 { color: var(--brand-ink); }
.sw-card .btn-dl { border: 0; }

/* 详情页左下角浮动按钮组（收藏 / 分享） */
.fab-dock {
  position: fixed; left: 26px; bottom: 28px; z-index: 120;
  display: flex; gap: 10px; align-items: center;
}
.fav-fab, .share-fab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 30px; cursor: pointer;
  border: 1px solid var(--line); background: var(--card); color: var(--text-2);
  font-weight: 600; font-size: 14px; box-shadow: var(--shadow-hover); transition: .18s;
}
.fav-fab:hover { transform: translateY(-2px); border-color: var(--gold-line); color: var(--gold-ink); }
.fav-fab .star { font-size: 18px; line-height: 1; color: #d9a300; transition: .18s; }
.fav-fab.on { border-color: var(--gold-line); background: var(--gold-bg); color: var(--gold-ink); }
.fav-fab.on .star { color: #f5a623; transform: scale(1.1); }
.share-fab:hover { transform: translateY(-2px); border-color: var(--brand-2); color: var(--brand-ink); }
.share-fab .ico { display: inline-flex; }
.share-fab.copied { border-color: var(--ok); color: var(--ok); }

/* 公开页投稿 */
.compose { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 14px; }
.compose-row { display: flex; flex-direction: column; gap: 7px; }
.compose-row > label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.compose-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.compose-foot .hint { flex: 1; color: var(--muted); font-size: 12.5px; }
.compose-login { padding: 40px 20px; text-align: center; color: var(--text-2); }
.compose-login p { margin-bottom: 16px; }
.compose-login .row { justify-content: center; }

.file-chip {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 10px;
  background: var(--field); border: 1px solid var(--line); border-radius: 9px; padding: 7px 12px; font-size: 13px;
}
.file-chip .rm { border: 0; background: transparent; color: #c5362f; cursor: pointer; font-size: 12.5px; }

/* 封面选择器（投稿表单） */
.cover-pick { display: flex; gap: 12px; align-items: flex-start; }
.cover-thumb {
  width: 108px; height: 68px; flex: none; border-radius: 9px; overflow: hidden;
  border: 1px dashed var(--line); background: var(--field); display: flex; align-items: center; justify-content: center;
}
.cover-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-thumb .cover-ph { color: var(--muted); font-size: 12.5px; }
.cover-ops { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cover-ops .hint { flex-basis: 100%; color: var(--muted); font-size: 12px; }

/* 公开内容卡片网格 */
.post-grid { padding: 14px 20px 18px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.post-card {
  border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden;
  background: var(--card); display: flex; flex-direction: column; transition: .16s;
}
.post-card.is-link { cursor: pointer; }
.post-card:hover { border-color: var(--brand-2); box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.post-card:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.post-cover { position: relative; aspect-ratio: 16 / 10; background: var(--soft); overflow: hidden; }
.post-cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: .3s; }
.post-card:hover .post-cover img { transform: scale(1.04); }
.post-cover .cover-ph {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; letter-spacing: 2px; color: rgba(255,255,255,.92);
}
.cover-ph.ph-source { background: linear-gradient(135deg, #24a06a, #4ad295); }
.cover-ph.ph-app { background: linear-gradient(135deg, var(--brand), var(--brand-3)); }
.cover-ph.ph-site { background: linear-gradient(135deg, #5b6bff, #8fa2ff); }
.cover-ph.ph-link { background: linear-gradient(135deg, #e08600, #ffb24d); }
.cover-ph.ph-thread { background: linear-gradient(135deg, #6b7793, #9aa6c2); }
.post-cover .cover-tag { position: absolute; left: 10px; top: 10px; backdrop-filter: blur(4px); }
.post-body { padding: 13px 14px 14px; display: flex; flex-direction: column; flex: 1; }
.post-title { font-size: 15px; font-weight: 700; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-card:hover .post-title { color: var(--brand-ink); }
.post-desc { color: var(--text-2); font-size: 12.5px; margin-top: 7px; line-height: 1.6; flex: 1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-desc.muted { color: var(--muted); }
.post-foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--line); }
.post-who { display: flex; align-items: center; gap: 7px; color: var(--text-2); font-size: 12.5px; flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mini-avatar {
  width: 22px; height: 22px; flex: none; border-radius: 50%; font-style: normal;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-3)); color: #fff; font-size: 11.5px; font-weight: 700;
}
.post-cat { font-style: normal; color: var(--brand-ink); background: var(--brand-soft); border-radius: 5px; padding: 1px 7px; font-size: 11.5px; margin-left: 2px; }
.post-date { color: var(--muted); font-size: 12px; flex: none; }

@media (max-width: 620px) { .post-grid { grid-template-columns: 1fr; } }

/* 制作同款（我的页底部） */
.same-style {
  margin: 20px 0 8px; border-radius: var(--radius); overflow: hidden;
  background: linear-gradient(120deg, var(--brand), var(--brand-2) 55%, var(--brand-3));
  color: #fff; box-shadow: 0 12px 28px rgba(var(--brand-rgb), .26);
}
.ss-inner { display: flex; align-items: center; gap: 22px; padding: 22px 26px; flex-wrap: wrap; }
.ss-text { flex: 1; min-width: 220px; }
.ss-text h3 { font-size: 18px; font-weight: 800; letter-spacing: .3px; }
.ss-text p { margin-top: 7px; font-size: 13px; line-height: 1.65; color: rgba(255,255,255,.9); }
.ss-btn {
  flex: none; background: #fff; color: var(--brand) !important; font-weight: 700;
  padding: 12px 30px; border-radius: 30px; border: 0; box-shadow: 0 6px 16px rgba(0,0,0,.15); transition: .16s;
}
.ss-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(0,0,0,.22); }
@media (max-width: 620px) { .ss-inner { padding: 18px; } .ss-btn { width: 100%; text-align: center; } }

/* 我的：登录 / 注册 */
.auth-wrap { padding: 26px 0 44px; display: flex; justify-content: center; }
.auth-card {
  width: 100%; max-width: 420px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px;
}
.auth-tabs { display: flex; gap: 4px; background: var(--soft); border-radius: 10px; padding: 4px; margin-bottom: 20px; }
.auth-tabs button {
  flex: 1; border: 0; background: transparent; padding: 9px 0; border-radius: 8px;
  cursor: pointer; color: var(--text-2); font-weight: 600; font-size: 14px; transition: .16s;
}
.auth-tabs button.active { background: var(--card); color: var(--brand-ink); box-shadow: 0 1px 4px rgba(20,30,60,.1); }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.input, .select, .textarea {
  width: 100%; border: 1px solid var(--line); background: var(--card); border-radius: 10px;
  padding: 10px 13px; outline: none; transition: .16s; font-size: 14px;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .12); }
.textarea { min-height: 96px; resize: vertical; line-height: 1.6; }

/* 人机验证码 */
.captcha-row { display: flex; gap: 10px; align-items: stretch; }
.captcha-row .input { flex: 1 1 auto; min-width: 0; letter-spacing: 2px; text-transform: uppercase; }
.captcha-img {
  flex: none; width: 116px; height: 42px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--soft); display: grid; place-items: center; cursor: pointer; overflow: hidden;
  user-select: none; transition: .16s;
}
.captcha-img:hover { border-color: var(--brand-2); }
.captcha-img:focus-visible { outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .12); }
.captcha-img svg { display: block; width: 100%; height: 100%; }
.cap-hint { font-size: 12px; color: var(--text-2); padding: 0 6px; text-align: center; line-height: 1.2; }

/* 头像 */
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none; overflow: hidden;
  display: inline-grid; place-items: center; background: linear-gradient(135deg, var(--tint-a), var(--tint-b));
  color: var(--brand-ink); font-weight: 700; font-size: 14px;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.big { width: 64px; height: 64px; font-size: 26px; }
.avatar-pick { display: flex; align-items: center; gap: 12px; }

/* 我的：面板 */
.profile-head {
  display: flex; align-items: center; gap: 16px; margin-top: 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px 22px;
}
.pf-info { flex: 1; min-width: 0; }
.pf-name { font-size: 19px; font-weight: 800; }
.pf-sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.my-list { padding: 18px 22px 22px; display: flex; flex-direction: column; gap: 10px; }
.my-item {
  display: flex; align-items: center; gap: 12px; padding: 13px 15px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.mi-main { flex: 1; min-width: 0; }
.mi-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 600; font-size: 14px; }
.mi-sub { color: var(--muted); font-size: 12.5px; margin-top: 5px; }
.mi-ops { display: flex; gap: 8px; align-items: center; }
.acct-form { padding: 22px 24px 26px; max-width: 420px; display: flex; flex-direction: column; gap: 14px; }
.acct-form .hint, .hint { color: var(--muted); font-size: 12.5px; }

/* =========================================================
   搜索页 / 帖子详情页
   ========================================================= */
.search-form { display: flex; gap: 10px; max-width: 640px; margin-top: 18px; }
.search-form .input { flex: 1; height: 44px; }
.search-form .btn { padding: 0 26px; height: 44px; border-radius: 10px; background: var(--brand); color: #fff; font-size: 14px; }
.search-form .btn:hover { background: var(--brand-dark); }

.sec-head {
  display: flex; align-items: center; gap: 10px; padding: 16px 20px 6px;
  font-size: 15px; font-weight: 700;
}
.sec-head .n { color: var(--muted); font-size: 13px; font-weight: 400; }
.sec-head::before {
  content: ''; width: 4px; height: 16px; border-radius: 2px;
  background: linear-gradient(180deg, var(--brand), var(--brand-2));
}
.sec-head a.more { margin-left: auto; font-size: 12.5px; color: var(--muted); font-weight: 400; }
.sec-head a.more:hover { color: var(--brand-ink); }

/* 帖子详情 */
.pd-head {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 26px; margin-top: 16px;
}
.pd-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.pd-tags .badge { padding: 3px 10px; font-size: 12px; }
.pd-title { font-size: 26px; font-weight: 800; line-height: 1.38; letter-spacing: .2px; }
.pd-meta {
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
  color: var(--muted); font-size: 13px; margin-top: 16px; padding-top: 15px; border-top: 1px solid var(--line);
}
.pd-meta .who { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); font-weight: 600; }
.pd-article { padding: 24px 26px 28px; }

.res-panel { margin-top: 18px; }
.res-panel .app-actions .btn { margin-left: 0; }
.res-note { color: var(--muted); font-size: 12.5px; margin-top: 10px; }
.pd-cover { margin: -4px 0 18px; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); }
.pd-cover img { display: block; width: 100%; max-height: 340px; object-fit: cover; cursor: zoom-in; }
.adopt-note {
  display: flex; align-items: center; gap: 10px; margin-top: 16px; padding: 13px 18px;
  border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--ok-bg); color: var(--text-2); font-size: 13.5px;
}
.adopt-note .ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%; flex: none;
  background: var(--ok); color: #fff; font-size: 12px; font-weight: 700;
}
.adopt-note .go { margin-left: auto; color: var(--brand-ink); font-weight: 600; }
.adopt-note:hover { border-color: var(--brand-2); text-decoration: none; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1000px) {
  .main-grid { grid-template-columns: 1fr; }
  .side { position: static; }
  .app-head { flex-direction: column; }
  .meta-table { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .sw-grid { grid-template-columns: 1fr; }
  .site-header .wrap { gap: 8px 10px; height: auto; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
  .logo { font-size: 16px; gap: 8px; }
  .logo .mark { width: 28px; height: 28px; font-size: 15px; border-radius: 8px; }
  .main-nav { order: 3; width: 100%; overflow-x: auto; padding-bottom: 2px; }
  .main-nav a { padding: 6px 10px; font-size: 13.5px; }
  .header-search { margin-left: auto; }
  .header-search input { width: 116px; padding: 0 32px 0 12px; }
  .header-search input:focus { width: 150px; }
  .qgroup-link { padding: 6px 11px; font-size: 12.5px; }
  .hero h1 { font-size: 23px; }
  .hero-search { flex-direction: column; background: transparent; box-shadow: none; padding: 0; gap: 10px; }
  .hero-search input { background: #fff; border-radius: 12px; height: 48px; }
  .hero-search button { height: 48px; border-radius: 12px; width: 100%; }
  .hero-tags { display: none; }
  .meta-table { grid-template-columns: 1fr; }
  .fab-dock { left: 16px; bottom: 18px; }
  .fav-fab, .share-fab { padding: 10px 16px; }
  .profile-head { flex-wrap: wrap; }
  .pd-title { font-size: 21px; }
  .pd-head { padding: 20px; }
  .search-form { flex-direction: column; }
  .search-form .btn { width: 100%; }
}
