@import url("https://fonts.googleapis.com/css2?family=Cinzel+Decorative:wght@700&family=Cormorant+Unicase:wght@700&family=Kaisei+Tokumin:wght@700&family=Yuji+Syuku&family=Song+Myung&family=Gowun+Batang:wght@700&family=ZCOOL+XiaoWei&family=Liu+Jian+Mao+Cao&family=Zhi+Mang+Xing&display=swap");

:root {
  --bg: #070611;
  --panel: rgba(18, 15, 36, 0.9);
  --panel-soft: rgba(27, 22, 54, 0.82);
  --line: rgba(255, 255, 255, 0.12);
  --text: rgba(255, 255, 255, 0.94);
  --text-soft: rgba(255, 255, 255, 0.72);
  --text-fade: rgba(255, 255, 255, 0.52);
  --purple: #8d73ff;
  --fantasy-font: "ZCOOL XiaoWei", "Zhi Mang Xing", "STKaiti", "KaiTi", "Songti SC", serif;
  --story-card-title-font: "ZCOOL XiaoWei", "Zhi Mang Xing", "STKaiti", "KaiTi", "Songti SC", serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100svh;
  color: var(--text);
  background: var(--bg);
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "SF Pro Text",
    "PingFang SC",
    "Noto Sans SC",
    "Microsoft YaHei",
    sans-serif;
    overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(118, 95, 214, 0.58) rgba(8, 6, 18, 0.14);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-overflow-scrolling: touch;
}

button,

input,

select,

textarea {

  font: inherit;

}

button {

  color: inherit;

  border: 0;

  cursor: pointer;

}

  

img {
  display: block;
  max-width: 100%;
  backface-visibility: hidden;
}

.page-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 50% 0%, rgba(132, 95, 255, 0.28), transparent 34%),
    radial-gradient(circle at 10% 18%, rgba(72, 39, 150, 0.22), transparent 30%),
    radial-gradient(circle at 85% 60%, rgba(26, 113, 166, 0.12), transparent 28%),
    linear-gradient(180deg, #0b0921 0%, #070611 44%, #090712 100%);
}

/* ===== Top Bar ===== */

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: 54px 1fr 54px;
  align-items: center;
  gap: 12px;
  padding:
    calc(env(safe-area-inset-top, 0px) + 14px)
    16px
    10px;
  background: linear-gradient(
    180deg,
    rgba(7, 6, 17, 0.98) 0%,
    rgba(7, 6, 17, 0.88) 72%,
    rgba(7, 6, 17, 0) 100%
  );
}

.top-btn {
  width: 52px;
  height: 52px;
  border-radius: 20px;
  background: rgba(27, 23, 48, 0.95);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 30px;
  line-height: 1;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
}

.top-btn.dots {
  font-size: 18px;
  letter-spacing: 0.12em;
}

.topbar-pill {
  justify-self: center;
  min-width: 150px;
  padding: 14px 24px;
  border-radius: 22px;
  text-align: center;
  letter-spacing: 0.24em;
  font-size: 18px;
  background: rgba(44, 32, 92, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.2);
}

/* ===== Menu ===== */

.menu-panel {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 80px);
  right: 16px;
  z-index: 200;
  width: 184px;
  padding: 10px;
  border-radius: 24px;
  background: rgba(14, 12, 30, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.38);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px) scale(0.98);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.menu-panel.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.menu-item {
  width: 100%;
  min-height: 48px;
  margin: 0 0 9px;
  padding: 0 15px;
  border-radius: 17px;
  background: rgba(37, 31, 69, 0.94);
  text-align: left;
  font-size: 16px;
}

.menu-item:last-child {
  margin-bottom: 0;
}

/* ===== Page Layout ===== */

.page-shell {
  width: min(100%, 480px);
  margin: 0 auto;
  padding: 6px 16px calc(42px + env(safe-area-inset-bottom, 0px));
}

.hero {
  padding: 6px 2px 14px;
}

.hero-eyebrow {
  margin: 0 0 8px;
  color: rgba(218, 209, 255, 0.68);
  font-size: 12px;
  letter-spacing: 0.28em;
}

.hero-title {
  margin: 0 0 10px;
  font-size: 25px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.hero-rating {
  display: none;
}

/* ===== Story Grid ===== */

.story-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
  align-items: start;
}

.story-card {
  position: relative;
  width: 100%;
  padding: 0;
  border-radius: 24px;
  overflow: hidden;
  background: rgba(18, 15, 32, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.24);
  transform: translateZ(0);
  content-visibility: auto;
  contain-intrinsic-size: 230px;
}

.story-card:active {
  transform: scale(0.985);
}

.story-card.active {
  border-color: color-mix(in srgb, var(--accent-color) 78%, white 18%);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent-color) 66%, transparent),
    0 0 18px color-mix(in srgb, var(--accent-color) 28%, transparent),
    0 10px 24px rgba(0, 0, 0, 0.28);
}

.story-cover {
  position: relative;
  aspect-ratio: 0.74;
  overflow: hidden;
}

.story-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.story-like-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 6;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  padding: 0;
  color: rgba(255, 235, 245, 0.94);
  font-size: 24px;
  line-height: 1;
  background:
    radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.28), transparent 42%),
    rgba(12, 9, 24, 0.66);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.38),
    0 0 18px rgba(255, 126, 185, 0.18),
    inset 0 1px 1px rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px) saturate(1.18);
  -webkit-backdrop-filter: blur(12px) saturate(1.18);
}

.story-like-btn.liked {
  color: #ffd6e8;
  background:
    radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.32), transparent 42%),
    linear-gradient(145deg, rgba(255, 91, 154, 0.86), rgba(127, 92, 255, 0.68));
  border-color: rgba(255, 218, 236, 0.42);
  box-shadow:
    0 10px 26px rgba(0, 0, 0, 0.42),
    0 0 24px rgba(255, 91, 154, 0.38),
    inset 0 1px 1px rgba(255, 255, 255, 0.12);
}

.story-like-btn:active {
  transform: scale(0.94);
}

.story-badge {
  display: none;
}

.story-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 56px 10px 11px;
  background: linear-gradient(
    180deg,
    rgba(5, 4, 12, 0) 0%,
    rgba(5, 4, 12, 0.18) 26%,
    rgba(5, 4, 12, 0.82) 78%,
    rgba(5, 4, 12, 0.96) 100%
  );
}

.story-title {
  margin: 0;
  font-family: var(--story-card-title-font);
  color: var(--accent-color);
  font-size: 15px;
  line-height: 1.32;
  font-weight: 700;
  letter-spacing: 0.055em;
  -webkit-text-stroke: 0.35px rgba(255, 255, 255, 0.34);
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.16),
    0 2px 7px rgba(0, 0, 0, 0.92),
    0 0 12px color-mix(in srgb, var(--accent-color) 48%, transparent),
    0 0 24px color-mix(in srgb, var(--accent-color) 26%, transparent);
}

.story-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.story-tag {
  padding: 4px 8px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 10px;
  line-height: 1;
  background: rgba(13, 11, 24, 0.56);
  border: 1px solid rgba(255, 255, 255, 0.11);
}

.empty-state {
  grid-column: 1 / -1;
  padding: 28px 18px;
  border-radius: 24px;
  background: rgba(26, 22, 48, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-soft);
  text-align: center;
  line-height: 1.6;
}

/* ===== Modal - Commercial Fantasy Panel ===== */

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  background: rgba(5, 4, 12, 0.72);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease;
}

.modal-layer.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  position: relative;
  width: min(calc(100vw - 32px), 400px);
  height: min(78svh, 640px);
  max-height: calc(100svh - 40px);
  padding: 28px 26px 26px;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 34px;
  background:
    radial-gradient(circle at 50% 0%, rgba(150, 118, 255, 0.16), transparent 46%),
    linear-gradient(180deg, rgba(20, 15, 38, 0.98), rgba(9, 7, 20, 0.98));
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.8),
    inset 0 1px 1px rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
  width: 44px;
  height: 44px;
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.94);
  font-size: 27px;
  line-height: 1;
  display: grid;
  place-items: center;
  box-shadow:
    0 10px 26px rgba(0, 0, 0, 0.28),
    inset 0 1px 1px rgba(255, 255, 255, 0.05);
}

.modal-eyebrow {
  flex: 0 0 auto;
  margin: 0 54px 10px 0;
  color: rgba(215, 203, 255, 0.72);
  font-size: 12px;
  letter-spacing: 0.18em;
}

.modal-title {
  flex: 0 0 auto;
  margin: 0 54px 24px 0;
  font-size: 25px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: 0.02em;
}

#modalContent {
  flex: 1;
  min-height: 0;
  display: block;
  overflow-y: auto;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
}

.modal-preview {
  overflow: hidden;
  border-radius: 24px;
  margin-bottom: 15px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
  box-shadow:
    0 18px 36px rgba(0, 0, 0, 0.34),
    inset 0 1px 1px rgba(255, 255, 255, 0.04);
}

.modal-preview img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.modal-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 16px;
}

.modal-chip {
  padding: 7px 11px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(34, 28, 60, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 12px;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.modal-btn {
  min-height: 48px;
  border-radius: 16px;
  background: rgba(35, 29, 62, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 15px;
  font-weight: 700;
}

.modal-btn.primary {
  background: linear-gradient(135deg, #7357ff, #a18aff);
}

.modal-btn.danger {
  width: auto;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.92);
  font-size: 14px;
  white-space: nowrap;
}

.modal-empty-state {
  min-height: 260px;
  margin: 28px 0 8px;
  padding: 34px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  border: 0;
  border-radius: 30px;
  background:
    radial-gradient(circle at 50% 28%, rgba(206, 188, 255, 0.13), transparent 46%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.018));
  text-align: center;
}

.modal-empty-icon {
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 255, 255, 0.16), transparent 58%),
    rgba(255, 255, 255, 0.045);
  color: rgba(238, 230, 255, 0.92);
  font-size: 26px;
  box-shadow:
    0 18px 38px rgba(0, 0, 0, 0.42),
    inset 0 1px 1px rgba(255, 255, 255, 0.06);
}

.modal-empty-state p {
  max-width: 280px;
  margin: 0;
  color: rgba(244, 238, 255, 0.82);
  font-size: 16px;
  line-height: 1.95;
  letter-spacing: 0.02em;
}

.modal-note {
  margin: 24px 0 0;
  color: rgba(244, 238, 255, 0.76);
  font-size: 15px;
  line-height: 1.75;
}

.modal-option-list {
  display: grid;
  gap: 12px;
}

.modal-option {
  width: 100%;
  min-height: 54px;
  padding: 0 16px;
  border-radius: 18px;
  background: rgba(34, 28, 60, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: rgba(255, 255, 255, 0.92);
  text-align: left;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.035),
    0 8px 22px rgba(0, 0, 0, 0.18);
}

.modal-option strong {
  min-width: 0;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-option span {
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
}

.modal-option.active {
  border-color: rgba(175, 151, 255, 0.95);
  box-shadow:
    inset 0 0 0 1px rgba(175, 151, 255, 0.42),
    0 0 22px rgba(145, 115, 255, 0.18);
}

.entered-story-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.entered-story-main span {
  color: rgba(216, 205, 255, 0.68);
  font-size: 12px;
  letter-spacing: 0.04em;
}
.comment-chip {

  cursor: pointer;

  color: rgba(245, 239, 255, 0.96);

  background:

    radial-gradient(circle at 35% 20%, rgba(255, 255, 255, 0.18), transparent 46%),

    linear-gradient(135deg, rgba(122, 91, 255, 0.72), rgba(82, 58, 168, 0.78));

  box-shadow:

    0 0 18px rgba(141, 115, 255, 0.2),

    inset 0 1px 1px rgba(255, 255, 255, 0.08);

}

.comment-chip:active {

  transform: scale(0.96);

}

.comment-panel {

  display: grid;

  gap: 16px;

}

.comment-list {

  display: grid;

  gap: 10px;

}

.comment-item {

  display: grid;

  gap: 10px;

  padding: 14px;

  border-radius: 20px;

  background:

    radial-gradient(circle at 12% 0%, rgba(155, 126, 255, 0.12), transparent 42%),

    rgba(18, 14, 38, 0.82);

  border: 1px solid rgba(230, 220, 255, 0.1);

  box-shadow:

    inset 0 1px 1px rgba(255, 255, 255, 0.04),

    0 10px 24px rgba(0, 0, 0, 0.18);

}

.comment-item p {

  margin: 0;

  color: rgba(245, 239, 255, 0.88);

  font-size: 14px;

  line-height: 1.7;

  word-break: break-word;

}

.comment-delete-btn {

  justify-self: end;

  min-height: 32px;

  padding: 0 12px;

  border-radius: 999px;

  color: rgba(255, 225, 238, 0.9);

  background: rgba(255, 255, 255, 0.07);

  border: 1px solid rgba(255, 180, 210, 0.12);

  font-size: 12px;

}

.comment-empty {

  min-height: 150px;

  display: grid;

  place-items: center;

  gap: 10px;

  padding: 24px;

  border-radius: 24px;

  text-align: center;

  background:

    radial-gradient(circle at 50% 28%, rgba(206, 188, 255, 0.12), transparent 46%),

    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.018));

  border: 1px solid rgba(255, 255, 255, 0.06);

}

.comment-empty span {

  color: rgba(255, 241, 183, 0.92);

  font-size: 24px;

}

.comment-empty p {

  margin: 0;

  color: rgba(244, 238, 255, 0.78);

  font-size: 14px;

  line-height: 1.7;

}

.comment-form {

  display: grid;

  gap: 12px;

}

.comment-form textarea {

  width: 100%;

  min-height: 92px;

  resize: none;

  border-radius: 18px;

  padding: 13px 14px;

  color: rgba(255, 255, 255, 0.94);

  background:

    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025)),

    rgba(13, 10, 30, 0.88);

  border: 1px solid rgba(230, 220, 255, 0.12);

  outline: none;

  line-height: 1.6;

}

.comment-form textarea::placeholder {

  color: rgba(255, 255, 255, 0.38);

}

.comment-form textarea:focus {

  border-color: rgba(165, 140, 255, 0.7);

  box-shadow:

    0 0 0 1px rgba(165, 140, 255, 0.18),

    0 0 22px rgba(141, 115, 255, 0.18),

    inset 0 1px 1px rgba(255, 255, 255, 0.06);

}

.comment-meta {

  display: flex;

  align-items: center;

  justify-content: space-between;

  gap: 12px;

}

.comment-author-btn {

  display: inline-flex;

  align-items: center;

  gap: 10px;

  min-width: 0;

  border: 0;

  padding: 0;

  color: inherit;

  background: transparent;

  text-align: left;

  font: inherit;

}

.comment-avatar,

.public-profile-avatar {

  width: 42px;

  height: 42px;

  flex: 0 0 auto;

  overflow: hidden;

  border-radius: 999px;

  border: 1px solid rgba(255, 255, 255, 0.22);

  background: rgba(255, 255, 255, 0.08);

}

.comment-avatar img,

.public-profile-avatar img {

  width: 100%;

  height: 100%;

  object-fit: cover;

  transform: scale(var(--profile-avatar-scale, 1));

}

.comment-author-text {

  display: grid;

  min-width: 0;

}

.comment-author-text strong {

  overflow: hidden;

  color: rgba(255, 255, 255, 0.94);

  font-size: 14px;

  line-height: 1.25;

  text-overflow: ellipsis;

  white-space: nowrap;

}

.comment-author-text small {

  overflow: hidden;

  color: rgba(255, 255, 255, 0.52);

  font-size: 11px;

  line-height: 1.3;

  text-overflow: ellipsis;

  white-space: nowrap;

}

.public-profile-card {

  display: grid;

  justify-items: center;

  gap: 16px;

  padding: 10px 0 4px;

  text-align: center;

}

.public-profile-avatar {

  width: 88px;

  height: 88px;

}

.public-profile-body {

  display: grid;

  gap: 6px;

}

.public-profile-body strong {

  color: rgba(255, 255, 255, 0.96);

  font-size: 18px;

}

.public-profile-body span {

  color: rgba(244, 216, 138, 0.86);

  font-size: 12px;

  letter-spacing: 0.08em;

}

.public-profile-body p {

  margin: 6px 0 0;

  color: rgba(255, 255, 255, 0.66);

  font-size: 14px;

  line-height: 1.7;

}
/* ===== Profile Modal - Game Archive Card ===== */

.profile-form {
  display: grid;
  gap: 15px;
  padding: 2px 0 4px;
}

.profile-avatar-section {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 14px;
  border-radius: 26px;
  background:
    radial-gradient(circle at 18% 12%, rgba(188, 164, 255, 0.16), transparent 46%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025));
  border: 1px solid rgba(226, 214, 255, 0.12);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.055),
    0 14px 34px rgba(0, 0, 0, 0.24);
}

.profile-current-avatar {
  position: relative;
  width: 112px;
  height: 112px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 34px;
  background:
    radial-gradient(circle at 50% 12%, rgba(255, 255, 255, 0.18), transparent 42%),
    linear-gradient(180deg, rgba(39, 31, 78, 0.92), rgba(10, 8, 24, 0.98));
  border: 1px solid rgba(233, 224, 255, 0.2);
  box-shadow:
    0 16px 38px rgba(0, 0, 0, 0.42),
    0 0 28px rgba(141, 115, 255, 0.16),
    inset 0 1px 1px rgba(255, 255, 255, 0.08);
}

.profile-current-avatar::before {
  content: "";
  position: absolute;
  inset: 7px;
  z-index: 2;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  pointer-events: none;
}

.profile-current-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(var(--profile-avatar-scale, 1));
  transform-origin: center;
  transition: transform 0.16s ease;
}

.profile-avatar-tools {
  min-width: 0;
  display: grid;
  gap: 11px;
}

.profile-avatar-grid {
  display: flex;
  gap: 9px;
  max-width: 100%;
  overflow-x: auto;
  padding: 1px 1px 8px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.profile-avatar-grid::-webkit-scrollbar {
  display: none;
}

.profile-avatar-option {
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  padding: 3px;
  overflow: hidden;
  border-radius: 19px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.025)),
    rgba(18, 14, 38, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.05),
    0 8px 18px rgba(0, 0, 0, 0.24);
}

.profile-avatar-option img {
  width: 100%;
  height: 100%;
  border-radius: 15px;
  object-fit: cover;
}

.profile-avatar-option.active {
  border-color: rgba(185, 165, 255, 0.95);
  box-shadow:
    0 0 0 1px rgba(185, 165, 255, 0.34),
    0 0 20px rgba(141, 115, 255, 0.28),
    0 10px 22px rgba(0, 0, 0, 0.28);
}

.profile-avatar-option:active {
  transform: scale(0.96);
}

.profile-avatar-size-field {
  display: grid;
  gap: 8px;
}

.profile-avatar-size-field span,
.profile-field span {
  color: rgba(226, 216, 255, 0.72);
  font-size: 12px;
  letter-spacing: 0.14em;
}

.profile-avatar-size-field input[type="range"] {
  width: 100%;
  accent-color: #9d84ff;
}

.profile-field {
  display: grid;
  gap: 8px;
}

.profile-field input,
.profile-field select,
.profile-field textarea {
  width: 100%;
  min-height: 46px;
  border-radius: 16px;
  padding: 0 14px;
  color: rgba(255, 255, 255, 0.94);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025)),
    rgba(13, 10, 30, 0.88);
  border: 1px solid rgba(230, 220, 255, 0.12);
  outline: none;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.045),
    0 8px 18px rgba(0, 0, 0, 0.18);
}

.profile-field input:focus,
.profile-field select:focus,
.profile-field textarea:focus {
  border-color: rgba(165, 140, 255, 0.7);
  box-shadow:
    0 0 0 1px rgba(165, 140, 255, 0.18),
    0 0 22px rgba(141, 115, 255, 0.18),
    inset 0 1px 1px rgba(255, 255, 255, 0.06);
}

.profile-field textarea {
  min-height: 82px;
  padding-top: 12px;
  line-height: 1.55;
  resize: none;
}

.profile-field input::placeholder,
.profile-field textarea::placeholder {
  color: rgba(255, 255, 255, 0.38);
}

.profile-field select {
  appearance: none;
  -webkit-appearance: none;
}

.profile-id {
  min-height: 46px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  border-radius: 16px;
  color: rgba(242, 236, 255, 0.96);
  font-size: 14px;
  letter-spacing: 0.04em;
  word-break: break-all;
  background:
    radial-gradient(circle at 12% 0%, rgba(155, 126, 255, 0.14), transparent 42%),
    rgba(10, 8, 24, 0.76);
  border: 1px solid rgba(230, 220, 255, 0.1);
}

.profile-form .modal-btn.primary {
  width: 100%;
  min-height: 52px;
  margin-top: 2px;
  border-radius: 19px;
  background:
    radial-gradient(circle at 30% 0%, rgba(255, 255, 255, 0.28), transparent 36%),
    linear-gradient(135deg, #6f55ff, #a58cff);
  box-shadow:
    0 0 24px rgba(141, 115, 255, 0.26),
    0 14px 30px rgba(0, 0, 0, 0.34);
}

/* ===== Floating Dock - Same As Home ===== */

.floating-dock {
  position: fixed;
  right: 24px;
  bottom: calc(26px + env(safe-area-inset-bottom, 0px));
  z-index: 250;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  touch-action: none;
  user-select: none;
}

.dock-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  opacity: 0;
  transform: translateY(10px) scale(0.95);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.dock-options.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.dock-options button {
  min-width: 88px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  padding: 12px 16px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 14px;
  font-weight: 800;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03)),
    rgba(12, 10, 28, 0.72);
  backdrop-filter: blur(18px) saturate(1.18);
  -webkit-backdrop-filter: blur(18px) saturate(1.18);
  box-shadow:
    0 12px 34px rgba(0, 0, 0, 0.36),
    0 0 24px rgba(155, 107, 255, 0.14);
}

.dock-options button:active {
  transform: scale(0.98);
}

.floating-orb {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  border: 1px solid rgba(210, 220, 255, 0.22);
  color: #fff1b7;
  font-size: 30px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 28% 22%, rgba(255, 255, 255, 0.42), transparent 34%),
    linear-gradient(145deg, rgba(155, 107, 255, 0.95), rgba(66, 200, 255, 0.74));
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  box-shadow:
    0 0 22px rgba(155, 107, 255, 0.48),
    0 0 46px rgba(66, 200, 255, 0.2),
    0 16px 42px rgba(0, 0, 0, 0.4),
    inset 0 1px 14px rgba(255, 255, 255, 0.2);
  animation: orbPulse 3.2s ease-in-out infinite;
  cursor: grab;
}

.floating-orb:active {
  cursor: grabbing;
}

@keyframes orbPulse {
  0%,
  100% {
    transform: scale(1);
    filter: brightness(1);
  }

  50% {
    transform: scale(1.045);
    filter: brightness(1.1);
  }
}

/* ===== Toast ===== */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  z-index: 360;
  max-width: calc(100vw - 42px);
  padding: 11px 15px;
  border-radius: 999px;
  background: rgba(25, 20, 48, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 13px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(16px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== Language Title Fonts ===== */

html[lang^="zh"] {
  --story-card-title-font: "ZCOOL XiaoWei", "Zhi Mang Xing", "Liu Jian Mao Cao", "STKaiti", "KaiTi", "Songti SC", serif;
}

html[lang="en"] {
  --story-card-title-font: "Cinzel Decorative", "Cormorant Unicase", Georgia, serif;
}

html[lang="ja"] {
  --story-card-title-font: "Kaisei Tokumin", "Yuji Syuku", "Hiragino Mincho ProN", "Yu Mincho", serif;
}

html[lang="ko"] {
  --story-card-title-font: "Song Myung", "Gowun Batang", "Apple SD Gothic Neo", serif;
}

html[lang="ms"] {
  --story-card-title-font: "Cinzel Decorative", "Cormorant Unicase", Georgia, serif;
}

html[lang^="zh"] .story-title {
  font-size: clamp(17px, 4.1vw, 23px);
  letter-spacing: 0.08em;
}

html[lang="en"] .story-title,
html[lang="ms"] .story-title {
  font-size: clamp(14px, 3.25vw, 19px);
  letter-spacing: 0.075em;
  text-transform: none;
}

html[lang="ja"] .story-title {
  font-size: clamp(14px, 3.35vw, 20px);
  letter-spacing: 0.045em;
}

html[lang="ko"] .story-title {
  font-size: clamp(14px, 3.25vw, 19px);
  letter-spacing: 0.035em;
}

/* ===== Fallback ===== */

@supports not (color: color-mix(in srgb, red, blue)) {
  .story-card.active {
    border-color: rgba(175, 151, 255, 0.9);
    box-shadow:
      0 0 0 1px rgba(175, 151, 255, 0.5),
      0 0 18px rgba(142, 111, 255, 0.26);
  }

  .story-title {
    text-shadow:
      0 1px 0 rgba(255, 255, 255, 0.16),
      0 2px 7px rgba(0, 0, 0, 0.92),
      0 0 18px rgba(141, 115, 255, 0.32);
  }
}

/* ===== Small Screens ===== */

@media (max-width: 380px) {
  .page-shell {
    padding-left: 14px;
    padding-right: 14px;
  }

  .story-grid {
    gap: 11px;
  }

  .story-card {
    border-radius: 22px;
  }

  .hero-title {
    font-size: 23px;
  }

  .modal-card {
    width: calc(100vw - 28px);
    height: min(80svh, 620px);
    padding: 26px 22px 24px;
    border-radius: 32px;
  }

  .profile-avatar-section {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
  }

  .profile-current-avatar {
    width: 96px;
    height: 96px;
    border-radius: 30px;
  }

  .profile-current-avatar::before {
    border-radius: 24px;
  }

  .profile-avatar-option {
    width: 50px;
    height: 50px;
    border-radius: 17px;
  }

  .floating-dock {
    right: 22px;
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  }

  .floating-orb {
    width: 76px;
    height: 76px;
  }
}