/* reshapeit.cn 个人主页样式：共享外壳 + 五套完整主题（body[data-style] 切换）。
   零依赖：系统字体栈、纯 CSS 背景，无外部资源。 */

* { margin: 0; padding: 0; box-sizing: border-box; }

html { height: 100%; }

body {
  min-height: 100%;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

#app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  transition: opacity 0.18s ease;
}
#app.swap { opacity: 0; }

a { text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

/* ============ 风格切换器（各主题通过局部变量换装） ============ */

#styleBtn {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 100;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  display: grid;
  place-items: center;
  color: var(--sw-fg, #e8c47c);
  background: var(--sw-bg, rgba(13, 12, 38, 0.72));
  border: 1px solid var(--sw-border, rgba(232, 196, 124, 0.35));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
#styleBtn:hover { transform: translateY(-2px) rotate(8deg); box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35); }

#stylePanel {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: calc(max(18px, env(safe-area-inset-bottom)) + 62px);
  z-index: 100;
  width: 240px;
  padding: 8px;
  border-radius: 16px;
  background: var(--sw-panel-bg, rgba(13, 12, 38, 0.9));
  border: 1px solid var(--sw-border, rgba(232, 196, 124, 0.3));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}
#stylePanel button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  text-align: left;
  color: var(--sw-fg, #e8dcc0);
  transition: background 0.12s ease;
}
#stylePanel button:hover { background: var(--sw-hover, rgba(232, 196, 124, 0.12)); }
#stylePanel button.active { background: var(--sw-active, rgba(232, 196, 124, 0.2)); }
#stylePanel .sp-glyph { font-size: 20px; width: 24px; text-align: center; }
#stylePanel .sp-text { display: flex; flex-direction: column; line-height: 1.35; }
#stylePanel .sp-text b { font-size: 14px; font-weight: 600; }
#stylePanel .sp-text small { font-size: 11px; opacity: 0.6; }

/* ================================================================
   一、星穹 st-mystic（默认）——深空金纹，呼应秘塔罗
   ================================================================ */

body[data-style="mystic"] {
  --gold: #e8c47c;
  --gold-bright: #f7e6b5;
  --gold-dim: rgba(232, 196, 124, 0.55);
  --ink: #0a091e;
  --muted: #9d97c9;
  --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: "Avenir Next", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  --sw-fg: var(--gold-bright);
  --sw-bg: rgba(13, 12, 38, 0.72);
  --sw-border: rgba(232, 196, 124, 0.35);
  --sw-hover: rgba(232, 196, 124, 0.12);
  --sw-active: rgba(232, 196, 124, 0.2);
  background: radial-gradient(120% 90% at 50% 0%, #1a1745 0%, #100e30 46%, var(--ink) 100%);
  color: #d8d2f0;
  font-family: var(--sans);
}
body[data-style="mystic"] ::selection { background: rgba(232, 196, 124, 0.35); color: #fff; }

.st-mystic .my-bg { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.st-mystic .my-bg i { position: absolute; inset: -50%; background-repeat: repeat; }
.st-mystic .my-bg i:nth-child(1) {
  background-image:
    radial-gradient(1.4px 1.4px at 22px 34px, #fff, transparent),
    radial-gradient(1px 1px at 108px 76px, #cdbdf5, transparent),
    radial-gradient(1.2px 1.2px at 58px 150px, #fff, transparent);
  background-size: 170px 190px;
  animation: my-tw 4.2s ease-in-out infinite;
}
.st-mystic .my-bg i:nth-child(2) {
  background-image:
    radial-gradient(1px 1px at 44px 20px, #f7e6b5, transparent),
    radial-gradient(1.6px 1.6px at 132px 118px, #fff, transparent),
    radial-gradient(1px 1px at 90px 62px, #b9a8ee, transparent);
  background-size: 210px 160px;
  animation: my-tw 5.6s ease-in-out 1.2s infinite;
}
.st-mystic .my-bg i:nth-child(3) {
  background:
    radial-gradient(45% 32% at 78% 12%, rgba(138, 108, 255, 0.16), transparent 70%),
    radial-gradient(50% 36% at 16% 82%, rgba(232, 196, 124, 0.1), transparent 70%);
}
@keyframes my-tw { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }

.st-mystic .my-wrap {
  position: relative;
  z-index: 1;
  flex: 1;
  width: min(1020px, 92vw);
  margin: 0 auto;
  padding: clamp(40px, 9vh, 96px) 0 96px;
  display: flex;
  flex-direction: column;
}
.st-mystic .my-head { text-align: center; }
.st-mystic .my-orn { font-size: 13px; letter-spacing: 0.4em; color: var(--gold-dim); margin-bottom: 26px; }
.st-mystic .my-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(3rem, 9vw, 5.2rem);
  letter-spacing: 0.04em;
  color: var(--gold-bright);
  text-shadow: 0 0 42px rgba(232, 196, 124, 0.35);
}
.st-mystic .my-title span { color: var(--muted); font-size: 0.55em; }
.st-mystic .my-sub {
  margin-top: 14px;
  font-size: 12px;
  letter-spacing: 0.62em;
  text-indent: 0.62em;
  color: #8a6cff;
}
.st-mystic .my-lead {
  margin-top: 30px;
  font-family: var(--serif);
  font-size: clamp(1rem, 2.4vw, 1.15rem);
  line-height: 2;
  color: #cfc9ea;
}
.st-mystic .my-cards {
  margin-top: clamp(44px, 7vh, 76px);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}
.st-mystic .my-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 34px 30px 28px;
  border: 1px solid rgba(232, 196, 124, 0.28);
  border-radius: 6px;
  background: linear-gradient(160deg, rgba(20, 17, 56, 0.72), rgba(12, 11, 34, 0.72));
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.st-mystic .my-card::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(232, 196, 124, 0.16);
  border-radius: 3px;
  pointer-events: none;
}
.st-mystic .my-card:hover {
  transform: translateY(-4px);
  border-color: var(--gold);
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.5), 0 0 34px rgba(232, 196, 124, 0.14);
}
.st-mystic .my-card-glyph { font-size: 26px; color: var(--gold); }
.st-mystic .my-card-zh { font-family: var(--serif); font-size: 1.5rem; color: #efe9ff; }
.st-mystic .my-card-en { font-size: 11px; letter-spacing: 0.42em; color: #8a6cff; }
.st-mystic .my-card-desc { margin-top: 6px; font-size: 0.92rem; line-height: 1.9; color: var(--muted); flex: 1; }
.st-mystic .my-card-go { font-size: 13px; letter-spacing: 0.2em; color: var(--gold-dim); }
.st-mystic .my-card:hover .my-card-go { color: var(--gold-bright); }
.st-mystic .my-foot {
  margin-top: auto;
  padding-top: 56px;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  letter-spacing: 0.14em;
  color: rgba(157, 151, 201, 0.75);
}

/* ================================================================
   二、极简 st-minimal——黑白大字，瑞士网格
   ================================================================ */

body[data-style="minimal"] {
  --paper: #fafafa;
  --ink: #111;
  --hair: #111;
  --sans: "Helvetica Neue", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  --mono: "SF Mono", "Menlo", "Consolas", monospace;
  --sw-fg: #111;
  --sw-bg: #fff;
  --sw-border: #111;
  --sw-hover: rgba(17, 17, 17, 0.06);
  --sw-active: rgba(17, 17, 17, 0.12);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
}
body[data-style="minimal"] ::selection { background: #111; color: #fff; }

.st-minimal .mn-wrap {
  flex: 1;
  width: min(1060px, 92vw);
  margin: 0 auto;
  padding: 28px 0 96px;
  display: flex;
  flex-direction: column;
}
.st-minimal .mn-head {
  display: flex;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1.5px solid var(--hair);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
}
.st-minimal .mn-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(36px, 8vh, 84px) 0;
  border-bottom: 1.5px solid var(--hair);
}
.st-minimal .mn-hero h1 {
  font-weight: 200;
  font-size: clamp(5rem, 17vw, 12rem);
  line-height: 0.98;
  letter-spacing: 0.06em;
}
.st-minimal .mn-hero p {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 2;
  text-align: right;
  color: #444;
  white-space: nowrap;
}
.st-minimal .mn-row {
  display: grid;
  grid-template-columns: 64px 1fr 2fr 40px;
  align-items: center;
  gap: 18px;
  padding: 30px 14px;
  border-bottom: 1px solid var(--hair);
  color: var(--ink);
  transition: background 0.12s ease, color 0.12s ease;
}
.st-minimal .mn-idx { font-family: var(--mono); font-size: 12px; color: #888; }
.st-minimal .mn-name { font-size: clamp(1.4rem, 3.4vw, 2rem); font-weight: 500; }
.st-minimal .mn-name em { display: block; font-style: normal; font-family: var(--mono); font-size: 10px; letter-spacing: 0.34em; color: #999; margin-top: 6px; }
.st-minimal .mn-desc { font-size: 0.9rem; line-height: 1.8; color: #555; }
.st-minimal .mn-arrow { font-size: 22px; font-weight: 300; justify-self: end; transition: transform 0.15s ease; }
.st-minimal .mn-row:hover { background: var(--ink); color: var(--paper); }
.st-minimal .mn-row:hover .mn-idx,
.st-minimal .mn-row:hover .mn-name em,
.st-minimal .mn-row:hover .mn-desc { color: rgba(250, 250, 250, 0.72); }
.st-minimal .mn-row:hover .mn-arrow { transform: translateX(6px); }
.st-minimal .mn-foot {
  margin-top: auto;
  padding-top: 48px;
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 12px;
  color: #888;
}

/* ================================================================
   三、终端 st-terminal——命令行会话
   ================================================================ */

body[data-style="terminal"] {
  --bg: #07090b;
  --fg: #c8d0c8;
  --green: #7ef29a;
  --green-dim: #3f9e5d;
  --amber: #e8c47c;
  --mono: "SF Mono", "Menlo", "Consolas", "Cascadia Code", monospace;
  --sw-fg: var(--green);
  --sw-bg: rgba(7, 9, 11, 0.8);
  --sw-border: rgba(126, 242, 154, 0.4);
  --sw-hover: rgba(126, 242, 154, 0.1);
  --sw-active: rgba(126, 242, 154, 0.18);
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
}
body[data-style="terminal"] ::selection { background: rgba(126, 242, 154, 0.3); }

.st-terminal { justify-content: center; padding: 40px 18px; }
.st-terminal .tm-win {
  width: min(760px, 100%);
  border: 1px solid rgba(126, 242, 154, 0.25);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(10, 14, 12, 0.92);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6), 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 60px rgba(126, 242, 154, 0.06);
}
.st-terminal .tm-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  background: rgba(126, 242, 154, 0.06);
  border-bottom: 1px solid rgba(126, 242, 154, 0.18);
}
.st-terminal .tm-bar i { width: 11px; height: 11px; border-radius: 50%; background: var(--green-dim); opacity: 0.5; }
.st-terminal .tm-bar i:first-child { opacity: 1; }
.st-terminal .tm-bar span { margin-left: 10px; font-size: 12px; color: var(--green-dim); letter-spacing: 0.04em; }
.st-terminal .tm-body { padding: 22px 20px 26px; font-size: clamp(13px, 1.9vw, 15px); line-height: 2.05; min-height: 340px; }
.st-terminal .tm-line { white-space: pre-wrap; word-break: break-all; }
.st-terminal .tm-cmd { color: var(--fg); }
.st-terminal .tm-out { color: #6d7a6f; }
.st-terminal .tm-link { display: block; color: var(--green); border-bottom: 1px dotted rgba(126, 242, 154, 0.35); width: fit-content; max-width: 100%; }
.st-terminal .tm-link:hover { background: var(--green); color: #06120a; }
.st-terminal .tm-in { animation: tm-appear 0.12s ease; }
@keyframes tm-appear { from { opacity: 0; } to { opacity: 1; } }
.st-terminal .tm-body .tm-cmd:last-of-type::after {
  content: "█";
  margin-left: 2px;
  color: var(--green);
  animation: tm-blink 1.1s steps(1) infinite;
}
@keyframes tm-blink { 50% { opacity: 0; } }

/* ================================================================
   四、杂志 st-editorial——纸墨衬线，创刊号
   ================================================================ */

body[data-style="editorial"] {
  --paper: #f6f1e7;
  --ink: #221c14;
  --ink-soft: #6b6154;
  --rule: #b9ad99;
  --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
  --sw-fg: var(--ink);
  --sw-bg: rgba(246, 241, 231, 0.9);
  --sw-border: #b9ad99;
  --sw-hover: rgba(34, 28, 20, 0.07);
  --sw-active: rgba(34, 28, 20, 0.13);
  background:
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(34, 28, 20, 0.012) 3px 4px),
    var(--paper);
  color: var(--ink);
  font-family: var(--serif);
}
body[data-style="editorial"] ::selection { background: rgba(34, 28, 20, 0.85); color: var(--paper); }

.st-editorial .ed-wrap {
  flex: 1;
  width: min(860px, 92vw);
  margin: 0 auto;
  padding: clamp(36px, 8vh, 80px) 0 96px;
  display: flex;
  flex-direction: column;
}
.st-editorial .ed-mast { text-align: center; border-top: 3px double var(--ink); padding-top: 22px; }
.st-editorial .ed-issue { font-family: var(--sans); font-size: 12px; letter-spacing: 0.3em; color: var(--ink-soft); }
.st-editorial .ed-title {
  margin-top: 18px;
  font-size: clamp(2.6rem, 9vw, 5rem);
  font-weight: 900;
  letter-spacing: 0.16em;
  text-indent: 0.16em;
}
.st-editorial .ed-motto { margin-top: 16px; font-size: 0.95rem; letter-spacing: 0.5em; text-indent: 0.5em; color: var(--ink-soft); }
.st-editorial .ed-lead {
  margin: 40px 0 8px;
  font-size: 1.05rem;
  line-height: 2.2;
  text-align: justify;
}
.st-editorial .ed-drop {
  float: left;
  font-size: 3.4em;
  line-height: 0.9;
  font-weight: 900;
  padding: 6px 12px 0 0;
}
.st-editorial .ed-arts {
  margin-top: 34px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0 44px;
}
.st-editorial .ed-art { border-top: 1px solid var(--ink); padding-top: 20px; }
.st-editorial .ed-kicker { font-family: var(--sans); font-size: 11px; letter-spacing: 0.3em; color: var(--ink-soft); }
.st-editorial .ed-head { margin-top: 14px; font-size: clamp(1.5rem, 4vw, 2rem); font-weight: 700; }
.st-editorial .ed-dek { margin-top: 12px; font-size: 0.95rem; line-height: 2; color: var(--ink-soft); }
.st-editorial .ed-more {
  display: inline-block;
  margin-top: 18px;
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.14em;
  color: var(--ink);
  border-bottom: 1.5px solid var(--ink);
  padding-bottom: 3px;
  transition: background 0.12s ease, color 0.12s ease;
}
.st-editorial .ed-more:hover { background: var(--ink); color: var(--paper); }
.st-editorial .ed-colo {
  margin-top: auto;
  padding-top: 56px;
  border-top: 3px double var(--ink);
  display: flex;
  justify-content: space-between;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-soft);
}

/* ================================================================
   五、极光 st-aurora——渐变玻璃
   ================================================================ */

body[data-style="aurora"] {
  --bg: #0b1020;
  --fg: #eef0ff;
  --muted: rgba(238, 240, 255, 0.6);
  --sans: "Avenir Next", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  --sw-fg: #fff;
  --sw-bg: rgba(255, 255, 255, 0.08);
  --sw-border: rgba(255, 255, 255, 0.25);
  --sw-hover: rgba(255, 255, 255, 0.12);
  --sw-active: rgba(255, 255, 255, 0.2);
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
}
body[data-style="aurora"] ::selection { background: rgba(177, 94, 255, 0.4); }

.st-aurora .au-bg { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; filter: blur(70px); }
.st-aurora .au-bg i { position: absolute; width: 46vmax; height: 46vmax; border-radius: 50%; opacity: 0.5; }
.st-aurora .au-bg i:nth-child(1) { background: #6d5efc; top: -12%; left: -8%; animation: au-drift 16s ease-in-out infinite; }
.st-aurora .au-bg i:nth-child(2) { background: #b15eff; bottom: -18%; right: -6%; animation: au-drift 20s ease-in-out -6s infinite reverse; }
.st-aurora .au-bg i:nth-child(3) { background: #35d0c5; bottom: -22%; left: 22%; opacity: 0.34; animation: au-drift 24s ease-in-out -12s infinite; }
@keyframes au-drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(6vmax, -4vmax) scale(1.12); }
}

.st-aurora .au-wrap {
  position: relative;
  z-index: 1;
  flex: 1;
  width: min(980px, 92vw);
  margin: 0 auto;
  padding: clamp(48px, 10vh, 110px) 0 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.st-aurora .au-hi { font-size: 13px; letter-spacing: 0.3em; color: var(--muted); }
.st-aurora .au-head h1 {
  margin-top: 22px;
  font-size: clamp(1.9rem, 5.6vw, 3.1rem);
  font-weight: 700;
  line-height: 1.5;
  background: linear-gradient(100deg, #fff 20%, #c9b8ff 50%, #8fe8df 80%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.st-aurora .au-sub { margin-top: 16px; font-size: 0.95rem; color: var(--muted); }
.st-aurora .au-cards {
  margin-top: clamp(40px, 8vh, 72px);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
  width: 100%;
}
.st-aurora .au-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 40px 30px 32px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  color: var(--fg);
  transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}
.st-aurora .au-card:hover {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.32);
}
.st-aurora .au-glyph { font-size: 30px; text-shadow: 0 0 24px rgba(177, 94, 255, 0.7); }
.st-aurora .au-card h2 { font-size: 1.4rem; font-weight: 600; }
.st-aurora .au-en { font-size: 11px; letter-spacing: 0.4em; color: #b3a6ff; }
.st-aurora .au-desc { margin-top: 8px; font-size: 0.9rem; line-height: 1.9; color: var(--muted); }
.st-aurora .au-go { margin-top: 14px; font-size: 13px; color: #8fe8df; }
.st-aurora .au-foot {
  margin-top: auto;
  padding-top: 64px;
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: center;
  font-size: 12px;
  color: var(--muted);
}

/* ============ 响应式 ============ */

@media (max-width: 760px) {
  .st-mystic .my-cards { grid-template-columns: 1fr; }
  .st-minimal .mn-hero { flex-direction: column; align-items: flex-start; }
  .st-minimal .mn-hero p { text-align: left; white-space: normal; }
  .st-minimal .mn-row { grid-template-columns: 40px 1fr 28px; }
  .st-minimal .mn-desc { display: none; }
  .st-editorial .ed-arts { grid-template-columns: 1fr; gap: 30px; }
  .st-aurora .au-cards { grid-template-columns: 1fr; }
}

/* ============ 动效减弱 ============ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  #app.swap { opacity: 1; }
}
