/* ============ 基础 ============ */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #faf5ec;
  --card: #ffffff;
  --ink: #4a3f35;
  --ink-light: #8a7d6f;
  --accent: #e07a5f;
  --accent-dark: #c9603f;
  --green: #3d5a4c;
  --gold: #d9a441;
  --line: #eee3d3;
  --shadow: 0 4px 16px rgba(94, 70, 46, .10);
  --radius: 14px;
}
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background:
    radial-gradient(1200px 500px at 80% -100px, #fbe8d8 0%, transparent 60%),
    radial-gradient(900px 400px at -10% 20%, #f3ead9 0%, transparent 55%),
    var(--bg);
  color: var(--ink);
  min-height: 100vh;
}
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: 15px; color: var(--ink); }

/* ============ 通用控件 ============ */
.btn {
  border: none; border-radius: 10px; padding: 9px 18px;
  font-size: 15px; transition: transform .06s, box-shadow .15s, background .15s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-dark)); color: #fff; box-shadow: 0 3px 10px rgba(224,122,95,.35); }
.btn-primary:hover { filter: brightness(1.05); }
.btn-primary:disabled { background: #ccc; box-shadow: none; cursor: not-allowed; }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--ink-light); }
.btn-ghost:hover { background: #fff; color: var(--ink); }
.btn-danger { background: #fbeaea; color: #c0392b; border: 1px solid #f3d1ce; }
.btn-danger:hover { background: #f8dcdc; }
.btn-sm { padding: 5px 12px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }

input[type="text"], input[type="password"], input[type="date"], textarea {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--line);
  border-radius: 10px; background: #fffdf9; outline: none; transition: border .15s;
}
input:focus, textarea:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 74px; }

/* ============ 登录页 ============ */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
}
.login-card {
  width: 380px; max-width: 94vw; background: var(--card); border-radius: 22px;
  box-shadow: 0 18px 50px rgba(94,70,46,.18); padding: 38px 34px 30px; text-align: center;
  border: 1px solid #f3e8d8;
}
.login-logo { font-size: 56px; line-height: 1; margin-bottom: 10px; }
.login-title { font-size: 30px; letter-spacing: 6px; }
.login-sub { color: var(--ink-light); margin: 8px 0 20px; font-size: 14px; }
.login-quick { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-bottom: 18px; font-size: 13px; color: var(--ink-light); align-items: center; }
.chip {
  border: 1px solid var(--line); background: #fdf8f0; border-radius: 999px;
  padding: 5px 12px; font-size: 13px; color: var(--ink); transition: all .15s;
}
.chip:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
#login-form { display: flex; flex-direction: column; gap: 12px; }
.login-err { color: #c0392b; font-size: 13px; min-height: 18px; margin-top: 10px; }
.login-hint { color: var(--ink-light); font-size: 12.5px; margin-top: 6px; }

/* ============ 顶栏 ============ */
.topbar {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 16px;
  padding: 10px 22px; background: rgba(255, 252, 246, .92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.brand { font-size: 19px; font-weight: 700; letter-spacing: 2px; white-space: nowrap; }
.nav { display: flex; gap: 6px; flex: 1; overflow-x: auto; }
.nav-btn {
  border: none; background: transparent; padding: 8px 14px; border-radius: 999px;
  font-size: 14.5px; color: var(--ink-light); white-space: nowrap; transition: all .15s;
}
.nav-btn:hover { background: #f6ecdc; color: var(--ink); }
.nav-btn.active { background: var(--green); color: #fff; box-shadow: 0 3px 8px rgba(61,90,76,.3); }
.user-box { display: flex; align-items: center; gap: 10px; }
.user-badge { font-size: 14px; background: #fdf0e3; padding: 6px 12px; border-radius: 999px; border: 1px solid #f3e2c8; }

.main { max-width: 1080px; margin: 0 auto; padding: 22px 18px 60px; }
.footer { text-align: center; color: var(--ink-light); font-size: 12.5px; padding: 26px 0 34px; }

/* ============ 板块一：家人生日 ============ */
.birthday-head { text-align: center; margin-bottom: 20px; }
.birthday-head h2 { font-size: 22px; letter-spacing: 2px; }
.birthday-head p { color: var(--ink-light); font-size: 13.5px; margin-top: 6px; }
.bday-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.bday-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 18px 14px; border-top: 4px solid var(--accent); position: relative; overflow: hidden;
}
.bday-card.next-one { border-top-color: var(--gold); }
.bday-card.next-one::after {
  content: "🎂 下一个寿星"; position: absolute; top: 12px; right: -34px;
  background: var(--gold); color: #fff; font-size: 11.5px; padding: 3px 40px; transform: rotate(38deg);
}
.bday-top { display: flex; align-items: center; gap: 12px; }
.bday-avatar {
  width: 52px; height: 52px; border-radius: 50%; background: #fdf0e3;
  display: flex; align-items: center; justify-content: center; font-size: 30px; flex: none;
  border: 2px solid #f6e3c8;
}
.bday-name { font-size: 18px; font-weight: 700; }
.bday-role { font-size: 12.5px; color: #fff; background: var(--green); border-radius: 999px; padding: 2px 10px; margin-left: 8px; }
.bday-zodiac { color: var(--ink-light); font-size: 12.5px; margin-top: 4px; }
.bday-birth { font-size: 13.5px; margin-top: 10px; line-height: 1.7; color: var(--ink); }
.bday-birth b { color: var(--accent-dark); }
.lived { margin-top: 10px; background: #faf6ee; border-radius: 10px; padding: 10px 12px; font-size: 13px; line-height: 1.8; }
.lived .num { font-weight: 700; color: var(--green); font-size: 15px; }
.lived .tick { color: var(--accent-dark); font-variant-numeric: tabular-nums; }
.countdown { margin-top: 12px; text-align: center; }
.countdown .cd-label { font-size: 12.5px; color: var(--ink-light); margin-bottom: 6px; }
.cd-num { font-size: 26px; font-weight: 800; color: var(--accent-dark); font-variant-numeric: tabular-nums; }
.cd-unit { font-size: 12px; color: var(--ink-light); margin: 0 6px 0 2px; }
.cd-today { font-size: 20px; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--accent), var(--gold)); padding: 10px; border-radius: 10px; }

/* ============ 板块二：公示栏 ============ */
.panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.panel + .panel { margin-top: 18px; }
.panel h3 { font-size: 17px; margin-bottom: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 170px auto auto; gap: 10px; align-items: start; }
.form-grid textarea { min-height: 44px; }
@media (max-width: 720px) { .form-grid { grid-template-columns: 1fr 1fr; } }
.event-list { display: flex; flex-direction: column; gap: 12px; }
.event-item { display: flex; gap: 14px; align-items: flex-start; border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #fffdf9; }
.event-datebox {
  flex: none; width: 62px; text-align: center; background: #fdf0e3; border-radius: 10px; padding: 8px 4px;
}
.event-datebox .m { font-size: 12px; color: var(--accent-dark); }
.event-datebox .d { font-size: 22px; font-weight: 800; color: var(--accent-dark); line-height: 1.2; }
.event-body { flex: 1; min-width: 0; }
.event-title { font-weight: 700; font-size: 15.5px; }
.event-note { color: var(--ink-light); font-size: 13.5px; margin-top: 4px; white-space: pre-wrap; word-break: break-word; }
.event-meta { color: #b5a898; font-size: 12px; margin-top: 6px; }
.cd-chip {
  flex: none; align-self: center; font-size: 13px; font-weight: 700; padding: 7px 12px;
  border-radius: 999px; background: #eef3ee; color: var(--green); white-space: nowrap;
}
.cd-chip.urgent { background: #fdeae0; color: #c0392b; }
.cd-chip.today { background: linear-gradient(135deg, var(--accent), var(--gold)); color: #fff; }
.cd-chip.past { background: #f1ece4; color: #a89b8b; font-weight: 500; }
.event-del { flex: none; align-self: center; }

/* ============ 板块三：八十分 ============ */
.game-intro { text-align: center; padding: 30px 20px; }
.game-intro .big { font-size: 46px; }
.game-intro h2 { margin: 10px 0 6px; font-size: 22px; }
.game-intro p { color: var(--ink-light); font-size: 14px; max-width: 560px; margin: 0 auto 20px; line-height: 1.8; }
.gm-wrap { max-width: 980px; margin: 0 auto; }
.gm-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--card); border-radius: 12px; box-shadow: var(--shadow); padding: 10px 16px; margin-bottom: 12px;
  font-size: 13.5px;
}
.gm-level { background: #eef3ee; color: var(--green); border-radius: 999px; padding: 5px 12px; font-weight: 700; }
.gm-score { background: #fdf0e3; color: var(--accent-dark); border-radius: 999px; padding: 5px 12px; font-weight: 700; }
.gm-phase { color: var(--ink-light); }
.gm-bar .spacer { flex: 1; }
.gm-table {
  position: relative; border-radius: 18px; min-height: 430px;
  background:
    radial-gradient(ellipse at center, #3f7a5c 0%, #2f5d44 68%, #254a35 100%);
  box-shadow: inset 0 0 60px rgba(0,0,0,.35), var(--shadow);
  overflow: hidden; user-select: none; padding: 10px;
}
.gm-seat { position: absolute; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.gm-seat .seat-label {
  color: rgba(255,255,255,.92); font-size: 12.5px; background: rgba(0,0,0,.28);
  padding: 3px 10px; border-radius: 999px; white-space: nowrap;
}
.gm-seat .seat-label b { color: #ffd98a; }
.gm-seat.seat-1 { right: 12px; top: 42%; transform: translateY(-50%); }
.gm-seat.seat-2 { left: 50%; top: 10px; transform: translateX(-50%); flex-direction: row; gap: 10px; }
.gm-seat.seat-3 { left: 12px; top: 42%; transform: translateY(-50%); }
.gm-center { position: absolute; left: 50%; top: 44%; transform: translate(-50%, -50%); width: 66%; text-align: center; }
.gm-msg { color: #ffe9c9; font-size: 14.5px; text-shadow: 0 1px 3px rgba(0,0,0,.5); min-height: 22px; }
.gm-msg b { color: #ffd98a; }
.gm-kitty { display: flex; gap: 5px; justify-content: center; flex-wrap: wrap; margin-top: 6px; }
.gm-plays { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; justify-items: center; min-height: 90px; margin-top: 8px; }
.gm-play { display: flex; gap: 4px; padding: 5px 8px; border-radius: 9px; background: rgba(255,255,255,.10); min-height: 56px; align-items: center; transition: box-shadow .2s; }
.gm-play.win { box-shadow: 0 0 0 2.5px #ffd98a, 0 0 18px rgba(255,217,138,.65); background: rgba(255,217,138,.16); }
.gm-play .who { font-size: 11px; color: rgba(255,255,255,.85); align-self: center; margin-right: 2px; }
.gm-hand-zone { margin-top: 430px; }
.gm-hand-zone { margin-top: 0; }
.gm-bottom { padding: 12px 8px 6px; background: rgba(255,248,238,.55); border-radius: 0 0 18px 18px; }
.gm-controls { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 8px 0 10px; }
.gm-hint { font-size: 13px; color: #b3462e; min-height: 18px; text-align: center; }
.gm-hand { display: flex; justify-content: center; padding: 4px 0 2px; min-height: 108px; flex-wrap: wrap; gap: 0; }
.gm-hand .hcard { margin: 0 -13px; }
.gm-hand .hcard.sel { transform: translateY(-16px); z-index: 2; }
.gm-hand .hcard.kitty-src { outline: 2.5px dashed var(--gold); outline-offset: -2px; border-radius: 7px; }

/* 扑克牌 */
.pcard {
  width: 58px; height: 82px; background: #fff; border-radius: 7px; position: relative;
  box-shadow: 0 2px 6px rgba(0,0,0,.35); border: 1px solid #d8d2c6;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 20px; flex: none; transition: transform .12s, box-shadow .12s;
}
.pcard .corner { position: absolute; top: 3px; left: 5px; font-size: 12.5px; line-height: 1.05; text-align: center; }
.pcard .corner small { display: block; font-size: 11px; }
.pcard.red { color: #d33; }
.pcard.black { color: #222; }
.pcard.trump-rank { box-shadow: 0 2px 6px rgba(0,0,0,.35), 0 0 0 2px var(--gold); }
.pcard.back { background: repeating-linear-gradient(45deg, #b03a2e, #b03a2e 6px, #943126 6px, #943126 12px); border-color: #7c281e; }
.pcard.back::after { content: "❦"; color: rgba(255,255,255,.55); font-size: 22px; }
.pcard.mini { width: 40px; height: 57px; font-size: 14px; border-radius: 5px; }
.pcard.mini .corner { font-size: 9px; top: 2px; left: 3px; }
.pcard.clickable:hover { transform: translateY(-6px); cursor: pointer; }
.gm-bid-panel, .gm-bury-panel {
  background: var(--card); border-radius: 12px; box-shadow: var(--shadow);
  padding: 14px 16px; margin-top: 12px; text-align: center;
}
.gm-bid-panel .opts, .gm-bury-panel .opts { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.gm-round-summary { max-width: 460px; margin: 0 auto; }
.gm-round-summary .row { display: flex; justify-content: space-between; padding: 7px 4px; border-bottom: 1px dashed var(--line); font-size: 14px; }
.gm-round-summary .win-line { text-align: center; font-size: 18px; font-weight: 800; color: var(--accent-dark); margin-bottom: 10px; }
.rules-list { text-align: left; color: var(--ink-light); font-size: 13.5px; line-height: 1.9; max-width: 520px; margin: 0 auto 8px; }

/* ============ 板块四：留言板 ============ */
.msg-composer { display: flex; flex-direction: column; gap: 10px; }
.composer-foot { display: flex; align-items: center; gap: 12px; }
.composer-foot .who { color: var(--ink-light); font-size: 13px; }
.photo-pick { display: inline-flex; align-items: center; gap: 6px; }
.pending-thumb { position: relative; }
.pending-thumb img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.pending-thumb .rm {
  position: absolute; top: -7px; right: -7px; width: 22px; height: 22px; border-radius: 50%;
  background: #c0392b; color: #fff; border: none; font-size: 12px; line-height: 1;
}
.msg-list { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
.msg-item { display: flex; gap: 12px; }
.msg-avatar { flex: none; width: 44px; height: 44px; border-radius: 50%; background: #fdf0e3; border: 2px solid #f6e3c8; display: flex; align-items: center; justify-content: center; font-size: 24px; }
.msg-bubble { flex: 1; min-width: 0; background: #fffdf9; border: 1px solid var(--line); border-radius: 4px 14px 14px 14px; padding: 12px 14px; }
.msg-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.msg-head .nm { font-weight: 700; font-size: 14.5px; }
.msg-head .rl { font-size: 11px; color: #fff; background: var(--green); padding: 1px 8px; border-radius: 999px; }
.msg-head .tm { color: #b5a898; font-size: 12px; margin-left: auto; }
.msg-text { margin-top: 6px; font-size: 14.5px; line-height: 1.75; white-space: pre-wrap; word-break: break-word; }
.msg-photo { margin-top: 10px; }
.msg-photo img { max-width: min(320px, 100%); max-height: 260px; border-radius: 10px; cursor: zoom-in; display: block; border: 1px solid var(--line); }
.msg-foot { margin-top: 8px; text-align: right; }
.empty-tip { text-align: center; color: var(--ink-light); font-size: 13.5px; padding: 26px 0; }

/* ============ 板块五：照片墙 ============ */
.wall-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.wall-head h3 { font-size: 17px; }
.wall-head .cnt { color: var(--ink-light); font-size: 13px; }
.wall-head .grow { flex: 1; }
.wall-grid { column-count: 4; column-gap: 14px; }
@media (max-width: 900px) { .wall-grid { column-count: 3; } }
@media (max-width: 640px) { .wall-grid { column-count: 2; } }
.wall-item {
  break-inside: avoid; margin-bottom: 14px; border-radius: 12px; overflow: hidden;
  background: var(--card); box-shadow: var(--shadow); position: relative; cursor: zoom-in;
}
.wall-item img { width: 100%; display: block; transition: transform .25s; }
.wall-item:hover img { transform: scale(1.03); }
.wall-item .overlay {
  position: absolute; inset: auto 0 0 0; padding: 26px 10px 8px;
  background: linear-gradient(transparent, rgba(0,0,0,.62)); color: #fff;
  font-size: 12px; display: flex; align-items: flex-end; gap: 8px;
  opacity: 0; transition: opacity .2s;
}
.wall-item:hover .overlay { opacity: 1; }
.wall-item .overlay .cap { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wall-item .overlay .del {
  background: rgba(255,255,255,.22); border: none; color: #fff; border-radius: 7px; padding: 3px 9px; font-size: 12px;
}
.uploading-tip { color: var(--accent-dark); font-size: 13px; }

/* ============ 灯箱 / 弹窗 / 提示 ============ */
.lightbox {
  position: fixed; inset: 0; z-index: 200; background: rgba(20, 14, 8, .88);
  display: flex; align-items: center; justify-content: center; padding: 26px;
}
.lightbox img { max-width: 92vw; max-height: 80vh; border-radius: 10px; box-shadow: 0 10px 50px rgba(0,0,0,.6); }
.lightbox .lb-meta { color: #e8dcc9; text-align: center; margin-top: 12px; font-size: 13.5px; }
.lightbox .lb-close { position: fixed; top: 18px; right: 22px; font-size: 30px; color: #fff; background: none; border: none; }
.lightbox .lb-foot { display: flex; gap: 12px; justify-content: center; margin-top: 12px; }
.modal-mask { position: fixed; inset: 0; z-index: 150; background: rgba(30, 22, 12, .45); display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-card { background: var(--card); border-radius: 16px; padding: 24px; width: 420px; max-width: 94vw; box-shadow: 0 16px 50px rgba(0,0,0,.25); }
.modal-card h4 { font-size: 17px; margin-bottom: 10px; }
.modal-card .m-body { font-size: 14.5px; color: var(--ink-light); line-height: 1.7; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.toast-root { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: rgba(50, 40, 28, .92); color: #fff; font-size: 14px; padding: 10px 18px;
  border-radius: 999px; box-shadow: 0 6px 20px rgba(0,0,0,.25); animation: toastIn .25s ease;
}
.toast.err { background: rgba(160, 45, 35, .95); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.spin {
  display: inline-block; width: 15px; height: 15px; border-radius: 50%; vertical-align: -2px;
  border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 640px) {
  .topbar { padding: 8px 12px; gap: 8px; }
  .brand { font-size: 16px; }
  .main { padding: 14px 10px 50px; }
  .gm-hand .hcard { margin: 0 -10px; }
  .pcard { width: 48px; height: 70px; font-size: 17px; }
  .pcard.mini { width: 34px; height: 49px; font-size: 12px; }
}
