* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --green: #1a7f4b; --green-dark: #14603a; --bg: #eef3f0; --card: #fff;
  --text: #1e2b24; --muted: #6b7a72; --border: #dde5e0; --red: #d64545; --blue: #2a6fb5; --gold: #c9971f;
}
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--text); padding-bottom: 40px; min-height: 100vh; }

/* ---------- 顶栏 ---------- */
.topbar { background: linear-gradient(135deg, #1a7f4b 0%, #14603a 60%, #0e4d2e 100%); color: #fff; position: sticky; top: 0; z-index: 10; box-shadow: 0 2px 12px rgba(10,60,35,.35); }
.brand-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px 6px; gap: 8px; flex-wrap: wrap; }
.brand { font-size: 18px; font-weight: 700; letter-spacing: .5px; }
.role-area { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.role-badge { font-size: 12px; padding: 3px 10px; border-radius: 12px; }
.role-badge.admin { background: rgba(255,217,77,.2); color: #ffd94d; border: 1px solid rgba(255,217,77,.5); }
.role-badge.guest { background: rgba(255,255,255,.15); color: rgba(255,255,255,.85); }
.tabs { display: flex; overflow-x: auto; }
.tabs button { flex: 1; min-width: 64px; padding: 10px 0; background: none; border: none; color: rgba(255,255,255,.75); font-size: 14px; cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs button.active { color: #fff; border-bottom-color: #ffd94d; font-weight: 600; }

main { max-width: 960px; margin: 0 auto; padding: 16px; }
.footer { text-align: center; color: var(--muted); font-size: 12px; padding: 20px 0 10px; }

/* ---------- 通用 ---------- */
.card { background: var(--card); border-radius: 14px; padding: 16px; margin-bottom: 14px; box-shadow: 0 1px 5px rgba(0,0,0,.06); }
.card h3 { margin-bottom: 10px; font-size: 16px; }

.btn { display: inline-block; background: var(--green); color: #fff; border: none; border-radius: 8px; padding: 9px 18px; font-size: 14px; cursor: pointer; transition: filter .15s; }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: #fff; color: var(--green); border: 1px solid var(--green); }
.btn.ghost.light { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.5); }
.btn.danger { background: var(--red); }
.btn.small { padding: 5px 10px; font-size: 12px; border-radius: 6px; }
.btn.blue { background: var(--blue); }
.btn.yellow { background: #ffd94d; color: #5a4a00; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 9px 8px; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f7faf8; }

.form-row { margin-bottom: 12px; }
.form-row label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.form-row input, .form-row select, .form-row textarea { width: 100%; padding: 9px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 15px; background: #fff; }
.form-row input:focus, .form-row select:focus, .form-row textarea:focus { outline: 2px solid rgba(26,127,75,.3); border-color: var(--green); }
textarea { resize: vertical; }

.modal-mask { position: fixed; inset: 0; background: rgba(10,25,17,.5); backdrop-filter: blur(2px); display: none; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.modal-mask.show { display: flex; }
.modal { background: #fff; border-radius: 16px; padding: 20px; width: 100%; max-width: 520px; max-height: 88vh; overflow-y: auto; animation: pop .18s ease; }
@keyframes pop { from { transform: scale(.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal h3 { margin-bottom: 14px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }

/* ---------- 首页 hero ---------- */
.hero { background: linear-gradient(135deg, #1a7f4b, #14603a); border-radius: 16px; color: #fff; padding: 22px 20px; margin-bottom: 14px; text-align: center; box-shadow: 0 4px 14px rgba(20,96,58,.35); }
.hero-title { font-size: 13px; letter-spacing: 2px; opacity: .85; margin-bottom: 6px; }
.hero-score { font-size: 34px; font-weight: 800; }
.hero-score span { font-size: 16px; font-weight: 500; margin: 0 6px 0 2px; opacity: .85; }
.hero-sub { font-size: 13px; opacity: .8; margin-top: 6px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat-box { background: var(--card); color: var(--text); border-radius: 12px; padding: 14px; text-align: center; box-shadow: 0 1px 5px rgba(0,0,0,.06); border-top: 3px solid var(--green); }
.stat-box .num { font-size: 24px; font-weight: 800; color: var(--green); }
.stat-box .lbl { font-size: 12px; color: var(--muted); margin-top: 2px; }

.podium { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.podium-card { border-radius: 14px; padding: 16px; text-align: center; color: #fff; }
.podium-card.gold { background: linear-gradient(135deg, #d9a520, #b8860b); }
.podium-card.silver { background: linear-gradient(135deg, #8fa3ad, #6e828c); }
.p-icon { font-size: 26px; }
.p-name { font-size: 17px; font-weight: 700; margin-top: 4px; }
.p-stat { font-size: 13px; margin-top: 2px; }
.p-lbl { font-size: 11px; opacity: .8; margin-top: 4px; }

/* ---------- 比赛 ---------- */
.match-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.score { font-size: 22px; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.score .win { color: var(--green); } .score .lose { color: var(--red); } .score .draw { color: var(--gold); }
.score-tag { position: relative; font-size: 12px; font-weight: 600; padding: 2px 10px 2px 22px; border-radius: 999px; letter-spacing: 1px; }
.score-tag::before { content: ''; position: absolute; left: 9px; top: 50%; transform: translateY(-50%); width: 7px; height: 7px; border-radius: 50%; }
.score-tag.win { background: #e9f5ee; color: var(--green); } .score-tag.win::before { background: var(--green); }
.score-tag.lose { background: #fdeeed; color: var(--red); } .score-tag.lose::before { background: var(--red); }
.score-tag.draw { background: #faf3e0; color: #a8811a; } .score-tag.draw::before { background: var(--gold); }
.sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- 照片 ---------- */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.photo-grid figure { position: relative; }
.photo-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; cursor: pointer; transition: transform .15s; }
.photo-grid img:hover { transform: scale(1.03); }
.photo-del { position: absolute; top: 6px; right: 6px; background: rgba(0,0,0,.55); color: #fff; border: none; border-radius: 50%; width: 26px; height: 26px; cursor: pointer; font-size: 14px; }
figcaption { font-size: 12px; color: var(--muted); margin-top: 3px; }

.toast { position: fixed; left: 50%; bottom: 60px; transform: translateX(-50%) translateY(20px); background: rgba(30,43,36,.92); color: #fff; padding: 10px 20px; border-radius: 20px; font-size: 14px; opacity: 0; transition: .25s; pointer-events: none; z-index: 200; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.empty { text-align: center; color: var(--muted); padding: 40px 0; }

.perf-table td, .perf-table th { padding: 6px 6px; }
.perf-table input[type="number"] { width: 56px; padding: 5px; border: 1px solid var(--border); border-radius: 6px; text-align: center; }
.perf-table input:disabled { background: #f3f6f4; color: var(--text); }
.perf-table input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--green); }

.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.92); display: none; align-items: center; justify-content: center; z-index: 300; cursor: zoom-out; }
.lightbox.show { display: flex; }
.lightbox img { max-width: 96vw; max-height: 96vh; border-radius: 6px; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; background: #e8f2ec; color: var(--green); }
.badge.gray { background: #eee; color: var(--muted); }

.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 10px; flex-wrap: wrap; }
.toolbar h2 { font-size: 20px; }

/* 年度筛选 */
.year-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.chip { padding: 6px 16px; border-radius: 18px; border: 1px solid var(--border); background: #fff; color: var(--muted); font-size: 13px; cursor: pointer; transition: all .15s; }
.chip:hover { border-color: var(--green); color: var(--green); }
.chip.on { background: var(--green); border-color: var(--green); color: #fff; font-weight: 600; }
.year-summary { font-size: 13px; color: var(--muted); background: #e8f2ec; border-radius: 8px; padding: 8px 12px; margin-bottom: 14px; }

/* 留言板 */
.board-page-list { min-height: 40vh; }
.msg-match { display: inline-block; margin-top: 6px; font-size: 12px; color: var(--blue); background: #eaf2fb; border-radius: 6px; padding: 3px 10px; text-decoration: none; }
.board-list { max-height: 340px; overflow-y: auto; }
.board-item { padding: 10px 0; border-bottom: 1px solid var(--border); }
.board-item:last-child { border-bottom: none; }
.board-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; gap: 8px; }
.board-time { font-size: 12px; color: var(--muted); }
.board-content { font-size: 14px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
#boardForm textarea { width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; font-family: inherit; resize: vertical; }
#boardForm textarea:focus { outline: 2px solid rgba(26,127,75,.3); border-color: var(--green); }

/* 作者标签 */
.badge.team-tag { background: #e8f2ec; color: var(--green); font-weight: 600; }
.badge.admin-tag { background: #faf3e0; color: #a8811a; font-weight: 600; }
.board-head { flex-wrap: wrap; }
.board-head .badge { flex-shrink: 0; }

/* 留言输入框 */
.composer { background: linear-gradient(180deg,#f6faf7,#eef4f0); border: 1px solid #dbe7e0; border-radius: 14px; padding: 12px; transition: border-color .2s, box-shadow .2s; }
.composer:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px rgba(26,127,75,.12); }
.composer textarea { width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; font-size: 15px; font-family: inherit; resize: vertical; background: #fff; line-height: 1.6; transition: border-color .2s; }
.composer textarea:focus { outline: none; border-color: var(--green); }
.composer-bar { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.composer-select { flex: 1; min-width: 180px; max-width: 60%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 999px; font-size: 13px; background: #fff; color: var(--text); cursor: pointer; }
.composer-select:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(26,127,75,.12); }
.composer-count { font-size: 12px; color: var(--muted); margin-left: auto; white-space: nowrap; }
.composer-btn { background: linear-gradient(135deg, #1a7f4b, #14603a); border-radius: 999px; padding: 9px 22px; font-weight: 600; box-shadow: 0 2px 8px rgba(20,96,58,.3); transition: transform .15s, box-shadow .15s; }
.composer-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(20,96,58,.4); }
.composer-btn:disabled { opacity: .6; transform: none; box-shadow: none; }

/* 注册/审核 */
.tab-switch { display: flex; gap: 8px; margin-bottom: 14px; }
.tab-switch button { flex: 1; padding: 8px; border: 1px solid var(--border); background: #fff; border-radius: 8px; font-size: 14px; cursor: pointer; color: var(--muted); }
.tab-switch button.on { background: var(--green); color: #fff; border-color: var(--green); font-weight: 600; }
.radio-row { display: flex; gap: 14px; flex-wrap: wrap; }
.radio-item { display: flex; align-items: center; gap: 5px; font-size: 14px; cursor: pointer; }
.radio-item input { width: 16px; height: 16px; accent-color: var(--green); }
.review-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.review-item:last-child { border-bottom: none; }
.role-badge.player { background: rgba(255,217,77,.2); color: #ffd94d; border: 1px solid rgba(255,217,77,.5); }
.role-badge.captain { background: rgba(46,204,113,.2); color: #2ecc71; border: 1px solid rgba(46,204,113,.5); }
.role-badge.vice-captain { background: rgba(52,152,219,.2); color: #3498db; border: 1px solid rgba(52,152,219,.5); }
.role-badge.user { background: rgba(255,255,255,.2); color: #fff; border: 1px solid rgba(255,255,255,.4); }

/* 头像 */
.avatar-sm { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; vertical-align: middle; }
.avatar-xs { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; vertical-align: middle; margin-right: 4px; }

/* 成员卡片 */
.member-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.member-card { background: var(--card); border-radius: 14px; padding: 16px; text-align: center; box-shadow: 0 1px 5px rgba(0,0,0,.06); }
.member-avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; margin-bottom: 8px; }
.member-avatar-placeholder { width: 64px; height: 64px; border-radius: 50%; background: #e8f2ec; display: flex; align-items: center; justify-content: center; font-size: 28px; margin: 0 auto 8px; }
.member-info { font-size: 14px; margin-bottom: 4px; }
.member-sub { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.member-actions { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; }

/* 个人中心 */
.profile-card { text-align: center; }
.profile-avatar-area { margin-bottom: 16px; }
.profile-avatar { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; margin-bottom: 8px; }
.profile-avatar-placeholder { width: 80px; height: 80px; border-radius: 50%; background: #e8f2ec; display: flex; align-items: center; justify-content: center; font-size: 36px; margin: 0 auto 8px; }

/* 相册 */
.album-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }

/* 球队列表 */
.team-row:hover { background: #e8f2ec !important; }
.dot { display: inline-block; width: 8px; height: 8px; background: #ff5252; border-radius: 50%; margin-left: 4px; vertical-align: middle; }

@media (max-width: 600px) {
  .brand { font-size: 16px; }
  main { padding: 12px; }
  .toolbar h2 { font-size: 18px; }
  .hero-score { font-size: 28px; }
  .table-wrap { overflow-x: auto; }
  th, td { padding: 8px 6px; font-size: 13px; }
  .tabs button { font-size: 13px; min-width: 56px; }
}
