/* ===== SweetHome · 服务器小站 ===== */
:root {
  --bg: #0a0c10;
  --bg-soft: #0e1117;
  --panel: rgba(255, 255, 255, 0.035);
  --panel-hi: rgba(255, 255, 255, 0.06);
  --line: rgba(255, 255, 255, 0.085);
  --line-hi: rgba(255, 255, 255, 0.16);
  --ink: #e9eff7;
  --muted: #8e9bad;
  --dim: #64707f;
  --grass: #5fd06f;
  --grass-soft: rgba(95, 208, 111, 0.14);
  --amber: #f5b942;
  --amber-soft: rgba(245, 185, 66, 0.14);
  --sky: #63a6ff;
  --sky-soft: rgba(99, 166, 255, 0.14);
  --radius: 16px;
  --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* 背景：极光 + 网格 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(900px 520px at 12% -8%, rgba(95, 208, 111, 0.16), transparent 62%),
    radial-gradient(760px 460px at 88% 0%, rgba(99, 166, 255, 0.14), transparent 60%),
    radial-gradient(700px 500px at 60% 110%, rgba(160, 110, 255, 0.10), transparent 65%),
    var(--bg);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 85% 65% at 50% 0%, #000 25%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 85% 65% at 50% 0%, #000 25%, transparent 78%);
  pointer-events: none;
}

a { color: inherit; text-decoration: none; }
.wrap { width: min(1080px, 100% - 40px); margin-inline: auto; }

/* ===== 顶栏 ===== */
header.top {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  background: linear-gradient(to bottom, rgba(10, 12, 16, 0.88), rgba(10, 12, 16, 0.62));
  border-bottom: 1px solid var(--line);
}
.top-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 62px;
}
.brand { display: flex; align-items: center; gap: 11px; font-weight: 700; letter-spacing: 0.2px; }
.brand .cube {
  width: 26px; height: 26px; border-radius: 7px;
  background: linear-gradient(145deg, #74e08a, #2f9f4a 55%, #1d7038);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 4px 14px rgba(95,208,111,.35);
  position: relative; flex: 0 0 auto;
}
.brand .cube::after {
  content: ""; position: absolute; inset: 7px 6px; border-radius: 2px;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.22) 0 2px, transparent 2px 4px),
              repeating-linear-gradient(90deg, rgba(0,0,0,.18) 0 2px, transparent 2px 4px);
}
.brand .txt { display: flex; flex-direction: column; gap: 3px; }
.brand b { font-size: 16px; }
.brand small { font: 600 10px/1 var(--mono); color: var(--dim); letter-spacing: 1.4px; text-transform: uppercase; }

nav.links { margin-left: auto; display: flex; align-items: center; gap: 4px; }
nav.links a {
  padding: 8px 13px; border-radius: 9px; font-size: 13.5px; color: var(--muted);
  transition: color .16s, background .16s;
}
nav.links a:hover { color: var(--ink); background: var(--panel-hi); }
nav.links a.on { color: var(--ink); background: var(--panel-hi); box-shadow: inset 0 0 0 1px var(--line); }
nav.links a.ext::after { content: "↗"; font-size: 11px; margin-left: 4px; color: var(--dim); }

/* ===== Hero ===== */
.hero { padding: 76px 0 30px; text-align: center; }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 13px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel);
  font: 500 12px/1 var(--mono); color: var(--muted); letter-spacing: .4px;
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); }
.pill.live .dot { background: var(--grass); box-shadow: 0 0 0 4px rgba(95,208,111,.16); animation: pulse 2s infinite; }
.pill.live { border-color: rgba(95,208,111,.32); color: #b6ecc0; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(95,208,111,.35); }
  50% { box-shadow: 0 0 0 6px rgba(95,208,111,0); }
}

h1.title {
  margin: 22px 0 10px;
  font-size: clamp(44px, 8vw, 76px);
  line-height: 1.02;
  letter-spacing: -2px;
  font-weight: 800;
  background: linear-gradient(180deg, #ffffff 12%, #b9f0c4 58%, #57c96c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 10px 34px rgba(95, 208, 111, 0.16));
}
.sub { color: var(--muted); font-size: 15.5px; margin: 0 auto; max-width: 560px; }

.ipbar {
  margin: 26px auto 0;
  display: inline-flex; align-items: stretch; gap: 0;
  border: 1px solid var(--line-hi); border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.02));
  overflow: hidden;
  box-shadow: 0 18px 46px -22px rgba(0,0,0,.9);
}
.ipbar .label {
  display: grid; place-items: center; padding: 0 13px;
  font: 600 10px/1 var(--mono); letter-spacing: 1.2px; color: var(--dim);
  text-transform: uppercase; border-right: 1px solid var(--line);
  background: rgba(0,0,0,.25);
}
.ipbar code {
  font: 600 16px/1 var(--mono); padding: 15px 18px; letter-spacing: .4px;
  color: #eaf3ea; user-select: all; white-space: nowrap;
}
.ipbar button {
  border: 0; border-left: 1px solid var(--line); cursor: pointer;
  background: rgba(95,208,111,.10); color: #a9e8b7; font: 600 12px/1 var(--sans);
  padding: 0 16px; transition: background .16s, color .16s;
}
.ipbar button:hover { background: rgba(95,208,111,.2); color: #d5f7dc; }
.ipbar button.done { background: rgba(95,208,111,.28); color: #fff; }

.chips { margin: 18px 0 0; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.chip {
  font: 500 12px/1 var(--mono); color: var(--muted);
  border: 1px solid var(--line); background: var(--panel);
  border-radius: 8px; padding: 7px 11px;
}
.chip b { color: var(--ink); font-weight: 600; }

/* ===== 入口卡片 ===== */
.entries { padding: 34px 0 8px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

.card {
  position: relative;
  display: flex; flex-direction: column; gap: 12px;
  padding: 22px 22px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(120% 120% at 100% 0%, var(--glow, rgba(255,255,255,.05)), transparent 55%),
    linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.015));
  overflow: hidden;
  transition: transform .2s cubic-bezier(.2,.8,.3,1), border-color .2s, box-shadow .2s;
}
.card::after {
  content: "";
  position: absolute; inset: 0; border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
  pointer-events: none;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-line, var(--line-hi));
  box-shadow: 0 24px 48px -26px var(--accent-glow, rgba(0,0,0,.9));
}
.card .icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--accent-soft, var(--panel-hi));
  border: 1px solid var(--accent-line, var(--line));
  color: var(--accent, var(--ink));
}
.card .icon svg { width: 22px; height: 22px; }
.card h3 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: .1px; }
.card p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.55; flex: 1; }
.card .go {
  display: inline-flex; align-items: center; gap: 6px;
  font: 600 12.5px/1 var(--sans); color: var(--accent, var(--ink));
  letter-spacing: .2px;
}
.card .go .arw { transition: transform .2s; }
.card:hover .go .arw { transform: translateX(4px); }

.card.green { --accent: var(--grass); --accent-soft: var(--grass-soft); --accent-line: rgba(95,208,111,.36); --glow: rgba(95,208,111,.13); --accent-glow: rgba(95,208,111,.28); }
.card.amber { --accent: var(--amber); --accent-soft: var(--amber-soft); --accent-line: rgba(245,185,66,.34); --glow: rgba(245,185,66,.12); --accent-glow: rgba(245,185,66,.26); }
.card.sky   { --accent: var(--sky);   --accent-soft: var(--sky-soft);   --accent-line: rgba(99,166,255,.34); --glow: rgba(99,166,255,.12); --accent-glow: rgba(99,166,255,.26); }

/* ===== 区块标题 ===== */
.sec { padding: 46px 0 0; }
.sec-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.sec-head h2 { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: .3px; }
.sec-head .hint { color: var(--dim); font-size: 12.5px; }
.sec-head a { margin-left: auto; font-size: 12.5px; color: var(--muted); border-bottom: 1px dashed var(--line-hi); }
.sec-head a:hover { color: var(--ink); }

/* ===== 留言条目 ===== */
.msg-list { display: flex; flex-direction: column; gap: 10px; }
.msg {
  display: grid; grid-template-columns: 38px 1fr; gap: 13px;
  padding: 14px 16px;
  border: 1px solid var(--line); border-radius: 13px;
  background: var(--panel);
  transition: border-color .16s, background .16s;
}
.msg:hover { border-color: var(--line-hi); background: var(--panel-hi); }
.avatar {
  width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center;
  font: 700 15px/1 var(--sans); color: #0b0d10;
  background: hsl(var(--h, 140) 62% 62%);
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.18);
  user-select: none;
}
.msg .who { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.msg .who b { font-size: 13.5px; font-weight: 700; }
.msg .who time { font: 500 11.5px/1 var(--mono); color: var(--dim); }
.msg .body { color: #d7e0ea; font-size: 14px; white-space: pre-wrap; word-break: break-word; margin-top: 3px; }
.msg .body a { color: var(--sky); border-bottom: 1px solid rgba(99,166,255,.4); }

.empty {
  border: 1px dashed var(--line-hi); border-radius: 13px;
  padding: 34px 18px; text-align: center; color: var(--dim); font-size: 13.5px;
}

/* ===== 留言板表单 ===== */
.board { padding: 40px 0 60px; }
.board-head { margin-bottom: 22px; }
.board-head h1 { margin: 0 0 6px; font-size: 30px; letter-spacing: -0.6px; font-weight: 800; }
.board-head p { margin: 0; color: var(--muted); font-size: 14px; }

.form-card {
  padding: 20px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02));
  box-shadow: 0 22px 60px -34px rgba(0,0,0,.95);
}
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 12px; }
.field label { font: 600 11.5px/1 var(--mono); letter-spacing: .8px; color: var(--dim); text-transform: uppercase; }
.row2 { display: grid; grid-template-columns: 220px 1fr; gap: 12px; }

input[type="text"], input[type="password"], textarea {
  width: 100%;
  background: #0b0e13;
  border: 1px solid var(--line-hi);
  border-radius: 10px;
  color: var(--ink);
  font: 400 14px/1.5 var(--sans);
  padding: 11px 13px;
  outline: none;
  transition: border-color .16s, box-shadow .16s;
}
input[type="text"]::placeholder, input[type="password"]::placeholder, textarea::placeholder { color: #525f6e; }
input[type="text"]:focus, input[type="password"]:focus, textarea:focus {
  border-color: rgba(95,208,111,.55);
  box-shadow: 0 0 0 3px rgba(95,208,111,.12);
}
textarea { resize: vertical; min-height: 84px; }

.form-foot { display: flex; align-items: center; gap: 12px; margin-top: 4px; flex-wrap: wrap; }
.counter { font: 500 11.5px/1 var(--mono); color: var(--dim); }
.counter.warn { color: var(--amber); }
.btn {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid rgba(95,208,111,.42);
  background: linear-gradient(180deg, #57c76a, #35a04d);
  color: #06210f; font: 700 13.5px/1 var(--sans);
  padding: 11px 20px; border-radius: 10px; cursor: pointer;
  box-shadow: 0 10px 24px -14px rgba(95,208,111,.9), inset 0 1px 0 rgba(255,255,255,.35);
  transition: transform .12s, filter .16s;
}
.btn:hover { filter: brightness(1.07); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; filter: saturate(.6); }

.note { font-size: 12.5px; color: var(--dim); }
.note.err { color: #ff8e8e; }
.note.ok { color: #8ee6a1; }

.loadmore {
  margin: 18px auto 0; display: block;
  background: var(--panel); border: 1px solid var(--line-hi); color: var(--muted);
  padding: 10px 22px; border-radius: 10px; cursor: pointer;
  font: 600 13px/1 var(--sans); transition: color .16s, border-color .16s;
}
.loadmore:hover { color: var(--ink); border-color: var(--muted); }
.loadmore[hidden] { display: none; }

/* ===== 页脚 ===== */
footer.foot {
  margin-top: 64px;
  border-top: 1px solid var(--line);
  padding: 22px 0 34px;
  color: var(--dim); font-size: 12.5px;
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
}
footer.foot .sep { color: #2b323c; }
footer.foot a:hover { color: var(--muted); }

/* ===== 提示 toast ===== */
#toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 16px);
  background: rgba(20, 26, 22, .96); color: #d8f7dd;
  border: 1px solid rgba(95,208,111,.4); border-radius: 10px;
  padding: 10px 16px; font-size: 13px; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; z-index: 60;
  box-shadow: 0 18px 40px -20px #000;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 860px) {
  .grid3 { grid-template-columns: 1fr; }
  .hero { padding-top: 52px; }
  .row2 { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .wrap { width: calc(100% - 28px); }
  .brand .txt { display: none; }          /* 5 个导航项在 390px 里放不下，品牌只留方块 */
  .top-inner { gap: 8px; height: 56px; }
  nav.links { gap: 0; }
  nav.links a { padding: 7px 7px; font-size: 12px; }
  nav.links a.ext::after { display: none; }
  .ipbar code { font-size: 14px; padding: 13px 12px; }
  .ipbar .label { padding: 0 9px; }
  h1.title { letter-spacing: -1px; }
}

/* ===== 编辑器：表情 / 图片 ===== */
.editor { position: relative; }
.tools { display: flex; align-items: center; gap: 8px; margin-top: 9px; flex-wrap: wrap; }
.tool {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--panel); border: 1px solid var(--line-hi); color: var(--muted);
  border-radius: 9px; padding: 7px 11px; cursor: pointer;
  font: 600 12.5px/1 var(--sans);
  transition: color .15s, border-color .15s, background .15s;
}
.tool:hover, .tool[aria-expanded="true"] { color: var(--ink); border-color: var(--muted); background: var(--panel-hi); }
.tools .counter { margin-left: auto; }

.emoji-pop {
  position: absolute; right: 0; top: calc(100% + 8px);
  width: 292px; max-width: 100%;
  display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px;
  padding: 8px;
  background: #10141a; border: 1px solid var(--line-hi); border-radius: 12px;
  box-shadow: 0 24px 50px -22px #000; z-index: 25;
}
.emoji-pop[hidden] { display: none; }
.emoji-pop button {
  border: 0; background: transparent; cursor: pointer;
  font-size: 19px; line-height: 1; padding: 6px 0; border-radius: 8px;
  transition: background .12s, transform .12s;
}
.emoji-pop button:hover { background: rgba(255,255,255,.09); transform: scale(1.12); }

.attach {
  margin-top: 10px; display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; border: 1px solid rgba(95,208,111,.32);
  border-radius: 11px; background: rgba(95,208,111,.06);
}
.attach[hidden] { display: none; }
.attach img {
  width: 54px; height: 54px; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--line-hi); flex: 0 0 auto;
}
.attach-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.attach-meta b { font-size: 12.5px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-meta span { font: 500 11.5px/1 var(--mono); color: var(--dim); }
.attach-x {
  margin-left: auto; background: transparent; border: 1px solid var(--line-hi);
  color: var(--muted); border-radius: 8px; padding: 6px 10px; cursor: pointer;
  font: 600 12px/1 var(--sans);
}
.attach-x:hover { color: #ff9c9c; border-color: rgba(255,120,120,.45); }

/* 留言里的图片 */
.msg-shot { display: inline-block; margin-top: 8px; line-height: 0; }
.msg-shot img {
  max-width: min(440px, 100%); max-height: 320px; width: auto; height: auto;
  border-radius: 10px; border: 1px solid var(--line-hi);
  background: #0b0e13; cursor: zoom-in;
  transition: border-color .16s, transform .16s;
}
.msg-shot:hover img { border-color: var(--line-hi); transform: translateY(-1px); }

@media (max-width: 560px) {
  .emoji-pop { width: 100%; }
  .msg-shot img { max-height: 240px; }
}

/* ===== 四个入口 ===== */
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.card.violet {
  --accent: #b08cff; --accent-soft: rgba(176,140,255,.14);
  --accent-line: rgba(176,140,255,.34); --glow: rgba(176,140,255,.12);
  --accent-glow: rgba(176,140,255,.26);
}
@media (max-width: 1080px) { .grid4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px) { .grid4 { grid-template-columns: 1fr; } }

/* ===== 存档下载 ===== */
.dl-note {
  display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap;
  margin: 0 0 16px; padding: 12px 15px;
  border: 1px solid var(--line); border-left: 2px solid var(--accent, #b08cff);
  border-radius: 11px; background: rgba(176,140,255,.06);
  font-size: 13px; color: var(--muted); line-height: 1.6;
}
.dl-note b { color: var(--ink); font-size: 12.5px; letter-spacing: .2px; }
.dl-note code {
  font: 500 12px/1 var(--mono); color: #d9c9ff;
  background: rgba(176,140,255,.12); padding: 2px 6px; border-radius: 5px;
}
.dl-form { margin-bottom: 8px; }
.code-row { display: flex; gap: 10px; align-items: stretch; }
.code-row input { flex: 1; }
.code-row .btn { margin-left: 0; white-space: nowrap; }

.dl-list { display: flex; flex-direction: column; gap: 10px; }
.dl-item {
  display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--line); border-radius: 13px; background: var(--panel);
  transition: border-color .16s, background .16s;
}
.dl-item:hover { border-color: var(--line-hi); background: var(--panel-hi); }
.dl-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.dl-main b { font-size: 14px; }
.dl-time { font: 500 11.5px/1 var(--mono); color: var(--dim); }
.dl-meta { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; min-width: 0; }
.dl-meta code {
  font: 500 11.5px/1.4 var(--mono); color: var(--muted);
  max-width: 42vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dl-meta span { font: 600 12.5px/1 var(--mono); color: #cbb8ff; }
.dl-btn { text-decoration: none; }
.dl-alt {
  font: 600 12px/1 var(--sans); color: var(--muted);
  border: 1px solid var(--line-hi); border-radius: 8px;
  padding: 9px 11px; white-space: nowrap;
  transition: color .16s, border-color .16s;
}
.dl-alt:hover { color: var(--ink); border-color: var(--muted); }
.dl-alt-hint {
  margin: 14px 0 0; font-size: 12.5px; color: var(--dim); line-height: 1.7;
}
.dl-alt-hint b { color: #cbb8ff; }
.dl-alt-hint code {
  font: 500 12px/1 var(--mono); color: var(--muted);
  background: var(--panel-hi); padding: 2px 5px; border-radius: 5px;
}
.dl-lock { font-size: 12.5px; color: var(--dim); white-space: nowrap; }

@media (max-width: 700px) {
  .dl-item { grid-template-columns: 1fr auto; row-gap: 8px; }
  .dl-meta { grid-column: 1 / -1; align-items: flex-start; }
  .dl-meta code { max-width: 70vw; }
  .code-row { flex-direction: column; }
}
