/* 手绘字体 + 设置面板 + 黑夜模式 + 文字颜色 */

.invite-row { display:flex;justify-content:space-between;align-items:center;gap:16px;padding:16px 0;border-bottom:1px solid var(--line, #ddd); }
.invite-row > div:first-child { min-width:0; }
.invite-row code { overflow-wrap:anywhere; }
.invite-row p { margin-top:8px;overflow-wrap:anywhere; }
.invite-actions { display:flex;gap:8px;flex-shrink:0; }
@media (max-width:600px) { .invite-row { align-items:flex-start;flex-direction:column; } }

.brand .brand-mark {
  display: block;
  width: 60px;
  height: 60px;
  object-fit: contain;
  flex-shrink: 0;
}

html[data-theme="dark"] .brand-mark {
  filter: invert(1);
}

@media (max-width: 600px) {
  .brand .brand-mark { width: 46px; height: 46px; }
}

:root {
  --font-hand: "Hannotate SC", "HanziPen SC", "Bradley Hand", "Noteworthy",
    "Chalkboard SE", "Comic Sans MS", "Yuanti SC", "Kaiti SC", cursive;
}

body,
button,
input,
select,
textarea,
h1,
h2,
h3,
h4,
h5,
.display,
.eyebrow,
.mono,
.brand {
  font-family: var(--font-hand) !important;
}

body,
button,
input,
select,
textarea,
.lead,
.hint,
.mono,
.eyebrow,
.brand,
.nav-links a,
.feed-note,
.feed-time,
.home-feed-text,
.btn-link,
.birthday-title,
.birthday-meta,
.stage-caption,
.result-meta {
  font-weight: 600;
}

h1,
h2,
h3,
.display,
.panel-title {
  font-weight: 800;
}

.eyebrow,
.mono {
  letter-spacing: 0.08em;
}

/* ------------------------------ 设置按钮 ------------------------------ */

.settings-wrap {
  position: relative;
  margin-left: 10px;
}

.settings-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(79, 64, 56, 0.14);
  background: rgba(255, 253, 249, 0.8);
  color: var(--cocoa);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.settings-btn:hover {
  background: #fff;
}

.settings-panel {
  position: absolute;
  right: 0;
  top: 44px;
  z-index: 400;
  width: 250px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 253, 249, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 22px 46px rgba(80, 55, 40, 0.24);
  backdrop-filter: blur(18px);
}

.settings-panel[hidden] {
  display: none !important;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  font-size: 12px;
  color: var(--cocoa);
}

.settings-row > span {
  white-space: nowrap;
}

.seg {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(79, 64, 56, 0.08);
}

.seg button {
  border: 0;
  background: transparent;
  color: inherit;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  cursor: pointer;
}

.seg button.on {
  background: #fff;
  color: #4f4038;
  box-shadow: 0 2px 6px rgba(80, 55, 40, 0.12);
}

.settings-range {
  width: 110px;
  accent-color: var(--rose);
}

.swatches {
  display: inline-flex;
  gap: 7px;
}

.swatches button {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
}

.swatches button.on {
  border-color: #4f4038;
}

.swatches button[data-ink="cocoa"] { background: #4f4038; }
.swatches button[data-ink="rose"] { background: #b3554f; }
.swatches button[data-ink="gray"] { background: #6b625c; }
.swatches button[data-ink="cream"] { background: #fff6e9; border-color: rgba(79, 64, 56, 0.2); }

.settings-foot {
  display: flex;
  justify-content: flex-end;
  padding-top: 6px;
}

.settings-reset {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
  text-decoration: underline;
}

/* ------------------------------ 文字颜色 ------------------------------ */

html[data-ink="cocoa"] { --ink: #4f4038; }
html[data-ink="rose"] { --ink: #b3554f; }
html[data-ink="gray"] { --ink: #6b625c; }
html[data-ink="cream"] { --ink: #fff6e9; }

html[data-ink] .main :is(h1, h2, h3, h4, p, li, label, em, strong, .lead, .hint, .eyebrow, .cal-month, .cal-day, .feed-note, .home-feed-text) {
  color: var(--ink) !important;
}

/* ------------------------------- 黑夜模式 ------------------------------ */

html[data-theme="dark"] body {
  background: #14110f;
  color: #f1e7db;
}

html[data-theme="dark"] :is(.hero-copy, .app-copy, .admin-head, .hero h1)::before {
  display: none;
}

html[data-theme="dark"] .page-head .display::before,
html[data-theme="dark"] .showcase-head h2::before {
  display: block;
  background: transparent;
  box-shadow: 0 0 22px rgba(231, 154, 173, 0.18), 0 0 46px rgba(231, 154, 173, 0.08);
}

html[data-theme="dark"] .bg::after {
  background: rgba(24, 20, 18, 0.92);
}

html[data-theme="dark"] body.inner .bg::after {
  background: rgba(24, 20, 18, 0.96);
}

html[data-theme="dark"] .brand {
  color: #f1e7db;
}

html[data-theme="dark"] .home-journal {
  background: rgba(34, 28, 25, 0.96);
  border-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .topbar {
  background: rgba(18, 15, 13, 0.88);
  border-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .marquee {
  background: rgba(231, 154, 173, 0.14);
}

html[data-theme="dark"] .nav-links a {
  color: #d9cdc0;
}

html[data-theme="dark"] .panel,
html[data-theme="dark"] .side-panel,
html[data-theme="dark"] .feed-card,
html[data-theme="dark"] .home-feed-card,
html[data-theme="dark"] .ne-card,
html[data-theme="dark"] .modal-box,
html[data-theme="dark"] .cal-cell,
html[data-theme="dark"] .stage,
html[data-theme="dark"] .card {
  background: #221c19;
  border-color: rgba(255, 255, 255, 0.08);
  color: #f1e7db;
}

html[data-theme="dark"] .showcase-head {
  background: transparent;
  border: 0;
}

html[data-theme="dark"] .app-copy::before,
html[data-theme="dark"] .hero-copy::before {
  background: #221c19;
  border-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .feed-card-link {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.16);
}

html[data-theme="dark"] :is(.feed-fallback, .feed-member, .card-meta span, .detail-list span, .birthday-title, .birthday-meta, .stat-card b, .stat-card span, .cal-month, .cal-foot) {
  color: #eadfd2;
}

html[data-theme="dark"] :is(.display, .page-head .display, .hero .display) {
  text-shadow: none;
}

html[data-theme="dark"] :is(h1, h2, h3, h4, .display, .lead, p, li, label, .card__body, .cal-day, .feed-note, .home-feed-text, .ne-title) {
  color: #f1e7db;
}

html[data-theme="dark"] :is(.hint, .mono, .eyebrow, time, .feed-time, .cal-foot) {
  color: #b7a894;
}

html[data-theme="dark"] .input,
html[data-theme="dark"] .select,
html[data-theme="dark"] textarea {
  background: rgba(255, 255, 255, 0.06);
  color: #f1e7db;
  border-color: rgba(255, 255, 255, 0.16);
}

html[data-theme="dark"] .btn-ghost {
  color: #f1e7db;
  border-color: rgba(255, 255, 255, 0.22);
  background: transparent;
}

html[data-theme="dark"] .footer {
  color: #b7a894;
  border-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .empty {
  background: rgba(34, 29, 26, 0.6);
  color: #f1e7db;
}

html[data-theme="dark"] .settings-panel,
html[data-theme="dark"] .music-dock-body {
  background: rgba(30, 25, 22, 0.97);
  border-color: rgba(255, 255, 255, 0.1);
  color: #f1e7db;
}

html[data-theme="dark"] .settings-btn {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
  color: #f1e7db;
}

html[data-theme="dark"] .settings-row {
  color: #e8dccd;
}

html[data-theme="dark"] .seg {
  background: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .seg button.on {
  background: #e79aad;
  color: #1a1512;
}

html[data-theme="dark"] .settings-panel .swatches button.on {
  border-color: #f1e7db;
}

html[data-theme="dark"] .music-dock-btn {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.16);
  color: #f1e7db;
}

@media (max-width: 720px) {
  .settings-panel {
    right: -8px;
    width: 230px;
  }
}

/* --------------------------- 卡片不透明度 --------------------------- */

:root {
  --card-alpha: 1;
  --btn-green: #bfd9a8;
  --btn-green-deep: #a4c78c;
  --btn-ink: #3d4a34;
}

.btn:not(.btn-ghost):not(.btn-ink) {
  --btn-bg: linear-gradient(145deg, var(--btn-green), var(--btn-green-deep));
  --btn-fg: var(--btn-ink);
  box-shadow: 0 14px 30px rgba(150, 180, 120, 0.28);
}

.btn:not(.btn-ghost):not(.btn-ink):hover {
  box-shadow: 0 18px 38px rgba(150, 180, 120, 0.36);
}

html:not([data-theme="dark"]) :is(.panel, .side-panel, .feed-card, .home-feed-card, .ne-card, .card, .cal-cell, .journal-card, .settings-panel, .profile-strip, .stat-card, .modal-box, .empty) {
  background: rgba(255, 253, 249, var(--card-alpha, 0.92));
}

html[data-theme="dark"] .post-dialog,
html[data-theme="dark"] .post-close {
  background: #221c19;
  color: #f1e7db;
  border-color: rgba(255, 255, 255, 0.14);
}
html[data-theme="dark"] .post-content > .feed-card { background: transparent; }
html[data-theme="dark"] .post-dialog {
  --post-panel: #141313;
  --post-compose: #1c1a19;
  --post-comment: #23201e;
  --post-border: rgba(255,255,255,.13);
  background: var(--post-panel);
}
html[data-theme="dark"] .post-dialog .post-close { background: var(--post-compose); }
html[data-theme="dark"] .post-dialog :is(h2,h3,strong,p,textarea,.discussion-cancel) { color: #f1e7db !important; }
html[data-theme="dark"] .post-dialog :is(time,.discussion-count,.discussion-status) { color: #b8aba0 !important; }
