/* =========================================================
 * v2.css — 新版「精致可爱」外观（盖在 style.css / theme.css 上面）
 * 字体：霞鹜文楷 Lite（SIL OFL，免费开源）
 * ========================================================= */
:root {
  --font: "LXGW WenKai Lite", "LXGW WenKai", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --ink: #3B2F45; --muted: #8C7C96; --soft: #B9A9C2;
  --accent: #E85D8F; --accent-dark: #C2477A; --accent-2: #8E7CF0;
  --bg1: #FFE3EC; --bg2: #E9E4FF; --bg3: #FFF0F5; --bg4: #FFF4E6; --bgbase: #FFF6F9;
  --card: #FFFFFF; --line: #F5E4EC; --chip: #FFF3F7; --chip-line: #F5D5E1;
  --glass: rgba(255, 255, 255, .78); --glass-hi: #FFFFFF; --glass-edge: rgba(255, 255, 255, .9);
  --shadow: 0 14px 32px -18px rgba(180, 90, 130, .45); --shadow-sm: 0 8px 20px -14px rgba(180, 90, 130, .45);
  --btn-grad: #E85D8F;
  --r1: 24px; --r2: 20px; --r3: 14px;
}
body { font-family: var(--font); background: var(--bgbase); letter-spacing: .2px; }
h1, h2, h3, h4, b, strong, .btn, .eyebrow { font-weight: 700; }
.tag, .chip, .nav a { font-weight: 400; }
.ic { width: 1.2em; height: 1.2em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.2em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- 背景 ---------- */
body::before {
  background:
    radial-gradient(55vmax 45vmax at 0% 0%, var(--bg1), transparent 60%),
    radial-gradient(55vmax 45vmax at 100% 10%, var(--bg2), transparent 60%),
    radial-gradient(60vmax 50vmax at 50% 110%, var(--bg4), transparent 60%),
    var(--bgbase);
}
html.team-bg body:not(.space-me)::before {
  background: linear-gradient(rgba(255, 246, 249, .78), rgba(255, 246, 249, .86)), var(--team-bg) center / cover no-repeat, var(--bgbase);
}
body.space-me.has-bg::before {
  background: linear-gradient(color-mix(in srgb, var(--bgbase) 70%, transparent), color-mix(in srgb, var(--bgbase) 82%, transparent)), var(--me-bg) center / cover no-repeat, var(--bgbase);
}

/* ---------- 卡片、按钮 ---------- */
.card, .task-card { background: var(--card); backdrop-filter: none; -webkit-backdrop-filter: none; border: 1px solid var(--line); box-shadow: var(--shadow); }
.task-card { border-radius: var(--r2); }
.btn.primary { background: var(--accent); box-shadow: 0 10px 20px -12px var(--accent); }
.btn.primary:hover { background: var(--accent-dark); }
.btn.ghost, .btn-ghost.sm { background: var(--card); border-color: var(--chip-line); }
.chip { background: var(--chip); border-color: var(--chip-line); color: var(--ink); }
.chip small { display: block; font-size: 11px; color: var(--muted); }
.chip[aria-pressed="true"] small { color: rgba(255, 255, 255, .85); }
.chip.on, .chip[aria-pressed="true"] { background: var(--accent); }
.inp { background: #FFFFFF; border-color: var(--chip-line); }
.inp.big { font-size: 18px; min-height: 50px; }
.fire { display: inline-block; font-size: 12px; line-height: 1; padding: 4px 6px; margin-right: 6px; border-radius: 8px; background: #FFE1E1; color: #C0262D; vertical-align: 3px; font-weight: 700; }
.sec-label { margin: 22px 4px 10px; font-size: 14px; color: var(--muted); letter-spacing: 1px; }
.sec-label.row { display: flex; justify-content: space-between; align-items: baseline; }
.sec-label.row a { font-size: 13px; letter-spacing: 0; }

/* ---------- 侧栏 ---------- */
.side { background: rgba(255, 255, 255, .82); border-right: 1px solid var(--line); }
.space-switch { background: var(--chip); border-color: var(--chip-line); box-shadow: none; }
body:not(.space-me) .space-switch .sw-team, body.space-me .space-switch .sw-me { background: var(--accent); box-shadow: none; }
.brand b { color: var(--accent-dark); font-size: 22px; }
.nav a { display: flex; align-items: center; gap: 10px; }
.nav a .ic { color: var(--soft); }
.nav a.active { background: var(--chip); color: var(--accent-dark); box-shadow: none; }
.nav a.active .ic { color: var(--accent); }
.tip-card { background: var(--chip); border-color: var(--chip-line); }
.tip-card b { display: flex; align-items: center; gap: 6px; color: var(--accent-dark); }
.me-card { background: var(--chip); border-color: var(--chip-line); }

/* ---------- 首页：主图、团队头像、成员 ---------- */
.cover { position: relative; height: 210px; border-radius: var(--r1); overflow: hidden; background: linear-gradient(135deg, #FFD3E2 0%, #E3DBFF 55%, #CFE4FF 100%); }
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-ph { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: #8A6F94; font-size: 13px; }
.cover-ph .ic { width: 34px; height: 34px; stroke-width: 1.4; }
.cover-btn { position: absolute; right: 14px; top: 14px; display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 999px; background: rgba(255, 255, 255, .9); color: #5B4766; font-size: 13px; cursor: pointer; box-shadow: var(--shadow-sm); }
.team-head { display: flex; align-items: flex-end; gap: 14px; margin: -46px 0 0 18px; position: relative; }
.team-logo { position: relative; flex: none; }
.team-logo img { width: 92px; height: 92px; border-radius: 50%; object-fit: cover; border: 5px solid #FFFFFF; background: #FFFFFF; box-shadow: 0 10px 24px -12px rgba(160, 80, 120, .6); display: block; }
.team-logo.can { cursor: pointer; }
.logo-edit { position: absolute; right: 2px; bottom: 4px; width: 28px; height: 28px; border-radius: 50%; background: #FFFFFF; color: var(--accent-dark); display: grid; place-items: center; box-shadow: var(--shadow-sm); }
.logo-edit .ic { width: 16px; height: 16px; }
.team-name { padding-bottom: 8px; }
.team-name h1 { font-size: 28px; color: var(--accent-dark); line-height: 1.15; }
.team-name small { color: var(--muted); font-size: 13px; }
.member-row { display: flex; gap: 12px; overflow-x: auto; padding: 16px 4px 4px; scrollbar-width: none; }
.member-row::-webkit-scrollbar { display: none; }
.mem { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; width: 56px; flex: none; color: var(--ink); font-size: 12px; }
.mem span { max-width: 56px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mem .badge { position: absolute; top: -2px; right: 0; min-width: 18px; height: 18px; border-radius: 9px; background: var(--accent); color: #FFFFFF; font-style: normal; font-size: 11px; display: grid; place-items: center; padding: 0 5px; border: 2px solid var(--bgbase); }

/* ---------- 发布任务栏 ---------- */
.pub { margin: 16px 0 0; padding: 14px; display: flex; flex-direction: column; gap: 12px; border-radius: var(--r1); }
.pub-main { display: flex; align-items: center; gap: 10px; }
.pub-plus { width: 38px; height: 38px; border-radius: 50%; background: var(--chip); color: var(--accent-dark); display: grid; place-items: center; flex: none; }
.pub-main input { flex: 1; min-width: 0; border: 0; outline: none; font: inherit; font-size: 17px; color: var(--ink); background: transparent; min-height: 40px; }
.pub-main input::placeholder { color: var(--soft); }
.pub-opts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pchip { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border: 1px solid var(--chip-line); background: var(--chip); border-radius: 999px; font: inherit; font-size: 14px; color: #5B4766; cursor: pointer; }
.pchip .av { width: 26px !important; height: 26px !important; margin-left: -8px; box-shadow: none; }
.pchip.icon { width: 36px; padding: 0; justify-content: center; }
.pchip.on { border-color: var(--accent); color: var(--accent-dark); background: #FFFFFF; }
.pchip.urgent { background: #FFE1E1; border-color: #FFB3B3; color: #C0262D; }
.pub-send { min-height: 40px; padding: 0 22px; font-size: 15px; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumb { position: relative; width: 64px; height: 64px; border-radius: 14px; overflow: hidden; flex: none; background: var(--chip); }
.thumb img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; display: block; }
.thumb button { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%; border: 0; padding: 0; background: rgba(43, 37, 64, .7); color: #FFFFFF; display: grid; place-items: center; }
.thumb button .ic { width: 12px; height: 12px; }
.thumb.add { display: grid; place-items: center; border: 1.5px dashed var(--chip-line); color: var(--accent-dark); cursor: pointer; background: #FFFFFF; }

/* ---------- 现在要做 ---------- */
.focus { padding: 0; overflow: hidden; }
.focus-img { width: 100%; height: 170px; object-fit: cover; display: block; cursor: zoom-in; }
.focus-body { padding: 18px 18px 18px; display: flex; flex-direction: column; gap: 10px; }
.focus-title { font-size: 24px; line-height: 1.3; word-break: break-word; }
.focus-crit { margin: 0; font-size: 15px; color: #5B4766; }
.focus-btns { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.focus-btns .btn.primary { flex: 1; }
.empty-focus { padding: 22px; text-align: center; }
.review-link { display: block; margin-top: 14px; padding: 12px 16px; border-radius: 16px; background: #EFEAFF; color: #5A49C9; }

/* ---------- 接下来清单 ---------- */
.list-card { padding: 4px 16px; }
.list-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 0; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; font: inherit; color: var(--ink); cursor: pointer; }
.list-row:last-child { border-bottom: 0; }
.lr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lr-title { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lr-sub { font-size: 12px; color: var(--muted); background: none !important; padding: 0; }
.lr-sub.due-over { color: #C0262D; } .lr-sub.due-today { color: #B35400; }
.lr-thumb { width: 46px; height: 46px; border-radius: 12px; object-fit: cover; flex: none; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #C9D3E6; flex: none; }
.dot.doing { background: #F2C14E; } .dot.blocked { background: #E5484D; } .dot.review { background: #8E7CF0; }
.stats { gap: 10px; }
.stat { background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-sm); border-radius: var(--r2); }
.stat b { font-family: var(--font); }
.game-entry { margin-top: 16px; }
.ge-icon { width: 48px; height: 48px; border-radius: 16px; background: var(--chip); color: var(--accent-dark); display: grid; place-items: center; }
.ge-icon .ic { width: 26px; height: 26px; }

/* ---------- 任务卡 ---------- */
.tc-top { align-items: flex-start; gap: 10px; }
.tc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.tc-title { font-size: 17px; }
.tc-thumb { width: 60px; height: 60px; border-radius: 14px; object-fit: cover; flex: none; cursor: zoom-in; }
.tc-line { color: #6E5F78; }
.task-card .tc-btns .btn.primary { min-height: 40px; }

/* ---------- 弹窗里的选择 ---------- */
.who-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; }
.who-opt, .who-mini { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border: 2px solid transparent; border-radius: 16px; background: var(--chip); font: inherit; font-size: 13px; color: var(--ink); cursor: pointer; }
.who-opt[aria-pressed="true"], .who-mini[aria-pressed="true"] { border-color: var(--accent); background: #FFFFFF; }
.who-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.who-mini { width: 64px; flex: none; padding: 6px 2px; font-size: 12px; }
.who-mini span { max-width: 58px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.chip-grid .chip { padding: 10px 6px; border-radius: 14px; font-size: 15px; }
.toggles { display: flex; gap: 8px; flex-wrap: wrap; }
.tog input { position: absolute; opacity: 0; pointer-events: none; }
.tog span { display: inline-flex; align-items: center; height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--chip-line); background: var(--chip); cursor: pointer; }
.tog input:checked + span { background: var(--accent); border-color: var(--accent); color: #FFFFFF; }
.tog input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.gallery { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 12px; }
.gallery img { height: 150px; border-radius: 14px; object-fit: cover; cursor: zoom-in; flex: none; max-width: 85%; }
.detail-who { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.detail-who b { display: block; margin-bottom: 4px; }
.img-full { width: 100%; max-height: 75vh; object-fit: contain; border-radius: 12px; display: block; }
.brand-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.brand-item:last-of-type { border-bottom: 0; }
.bi-pre { width: 64px; height: 48px; border-radius: 12px; overflow: hidden; background: var(--chip); display: grid; place-items: center; color: var(--soft); flex: none; }
.bi-pre.logo { width: 48px; border-radius: 50%; }
.bi-pre img { width: 100%; height: 100%; object-fit: cover; }
.bi-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.file-btn { display: inline-flex; align-items: center; gap: 6px; }
.modal { background: #FFFFFF; }
.modal header h3 { font-size: 20px; }

/* ---------- 底部导览 ---------- */
.bottom-nav a .ic { width: 24px; height: 24px; }
.bottom-nav a.active { color: var(--accent-dark); }

/* ---------- 个人页深色主题 ---------- */
body.space-me.is-dark { --card: var(--glass); --line: rgba(255, 255, 255, .1); --chip: rgba(255, 255, 255, .08); --chip-line: rgba(255, 255, 255, .14); }

/* ---------- 手机 ---------- */
@media (max-width: 900px) {
  .bottom-nav { background: #FFFFFF; border-color: var(--line); }
  .cover { margin: 0 -15px; border-radius: 0 0 28px 28px; height: 200px; }
  .team-head { margin-left: 6px; }
  .team-logo img { width: 84px; height: 84px; }
  .team-name h1 { font-size: 25px; }
  .focus-title { font-size: 22px; }
  .pub-opts .sp { display: none; }
  .pub-send { margin-left: auto; }
  body:not(.space-me) .view:not([hidden]) ~ .x {}
}
@media (max-width: 380px) {
  .pchip span:not(.sr) { max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* ---------- 修正：弹窗不超出画面、手机发布栏一行 ---------- */
.modal-body { min-width: 0; }
.modal-body .form, .modal-body .fld { min-width: 0; max-width: 100%; }
.who-row, .chips { max-width: 100%; }
.fld-row .inp { min-width: 0; flex: 1 1 140px; }
@media (max-width: 430px) {
  .pchip[data-pub="who"] span { display: none; }
  .pchip[data-pub="who"] { width: 36px; padding: 0; justify-content: center; }
  .pchip[data-pub="who"] .av { margin-left: 0; }
  .pub-opts { flex-wrap: nowrap; }
  .pub-send { padding: 0 16px; }
}
.modal-wrap { grid-template-columns: minmax(0, 1fr); justify-items: center; }
.focus-btns .btn.primary { max-width: 360px; }
