/* ============================================================
   主页：共用结构 + 三套主题（雨夜 / 绘梨衣 / 幽香）各自的外观与布局
   ============================================================ */

/* ---------- 共用结构（尺寸全部用 rem） ---------- */
.card { position: relative; }
.profile { padding: 1.35rem 1.4rem 1.25rem; }
.profile-head { display: flex; align-items: center; gap: .9rem; }
.avatar-wrap { position: relative; flex: none; display: grid; place-items: center; }
.avatar { width: 4.8rem; height: 4.8rem; border-radius: 50%; background: #fff; position: relative; }
.avatar-petals, .profile-duck { display: none; }
.profile-id { flex: 1; min-width: 0; }
.profile h1 { margin: 0; font-size: 2.2rem; line-height: 1.05; }
.tagline { margin: .3rem 0 0; font-size: .92rem; color: var(--muted); }
.profile-head .lang-switch { align-self: flex-start; }

.tags { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; margin: 1rem 0 0; padding: 0; }
.tags li { font-size: .9rem; padding: .2rem .75rem; }
.bio { margin: .85rem 0 0; font-size: 1.08rem; line-height: 1.6; }
.facts { margin: .9rem 0 0; display: grid; gap: .45rem; font-size: 1rem; }
.facts div { display: grid; grid-template-columns: 5.6em 1fr; gap: .7rem; align-items: baseline; }
:lang(en) .facts div, :lang(ja) .facts div { grid-template-columns: 7.4em 1fr; }
.facts dt { white-space: nowrap; color: var(--accent); }
.facts dd { margin: 0; color: var(--muted); }

.links-title { margin: 0 0 .7rem; display: flex; align-items: baseline; gap: .6rem; }
.lt-deco { display: none; }
.lt-text { font-size: .82rem; color: var(--muted); letter-spacing: .06em; }
.links ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; }
.link { display: flex; align-items: center; gap: .75rem; padding: .62rem .8rem; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.chip { width: 2.35rem; height: 2.35rem; flex: none; display: grid; place-items: center; transition: background .18s ease, color .18s ease; }
.chip svg { width: 1.3rem; height: 1.3rem; fill: currentColor; }
.link-text { display: grid; min-width: 0; line-height: 1.25; }
.link-text b { font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-text small { font-size: .78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.music-entry { display: flex; align-items: center; gap: .9rem; padding: .75rem 1rem .75rem .8rem; transition: transform .18s ease, box-shadow .18s ease; }
.music-covers { display: flex; flex: none; }
.music-covers img { width: 2.9rem; height: 2.9rem; margin-left: -1rem; object-fit: cover; background: #ccc; }
.music-covers img:first-child { margin-left: 0; }
.music-text { display: grid; flex: 1; min-width: 0; line-height: 1.3; }
.music-text b { font-size: 1rem; }
.music-text small { font-size: .76rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.music-arrow { font-size: 1.4rem; color: var(--accent); transition: transform .18s ease; }
.music-entry:hover .music-arrow { transform: translateX(.3rem); }

.credit { font-size: .7rem; color: var(--muted); text-align: center; }
.nametag, .rain, .type-deco { display: none; }

/* ============================================================
   雨夜 RAIN —— 16:9 / 21:9 横屏
   夜色玻璃：低不透明度、细白边、无硬阴影；琥珀色窗灯做强调，衬线斜体做标题
   ============================================================ */
@media (min-aspect-ratio: 17/10), (pointer: fine) and (min-aspect-ratio: 6/5) {
  body { overflow: hidden; text-shadow: 0 1px 3px rgba(0, 0, 0, .75), 0 0 .7rem rgba(0, 0, 0, .45); }
  .page {
    position: fixed; inset: 0;
    display: grid;
    /* 左栏：个人卡 + 歌单 + 星月时钟；右栏：车票式链接；中间留给人物 */
    grid-template-columns: minmax(24rem, 31vw) 1fr minmax(18rem, 22vw);
    grid-template-rows: auto auto auto 1fr;
    column-gap: 2.5vw; row-gap: 1rem;
    padding: 3.4vh 2.6vw;
  }
  .profile { grid-column: 1; grid-row: 1; }
  .music-entry { grid-column: 1; grid-row: 2; }
  .links { grid-column: 3; grid-row: 1 / 5; align-self: center; max-height: 100%; overflow: auto; scrollbar-width: none; padding: .3rem; }
  .credit { display: none; }

  .card, .link {
    background: linear-gradient(160deg, rgba(34, 38, 54, .08), rgba(14, 16, 24, .03));
    border: 1px solid var(--card-line);
    border-radius: 1.1rem;
    box-shadow: 0 .8rem 2.4rem rgba(0, 0, 0, .18), inset 0 1px 0 rgba(255, 255, 255, .08);
    -webkit-backdrop-filter: blur(10px) saturate(1.2) brightness(.85); backdrop-filter: blur(10px) saturate(1.2) brightness(.85);
  }
  .avatar { border: 1px solid rgba(255, 255, 255, .5); box-shadow: 0 0 0 .3rem rgba(242, 196, 109, .16); }
  .profile h1 { font-family: var(--serif); font-weight: 600; font-style: italic; font-size: 3.1rem; letter-spacing: .01em; text-shadow: 0 0 1.2rem rgba(242, 196, 109, .25); }
  .tagline { color: var(--accent); letter-spacing: .08em; }
  .tags li { border: 1px solid rgba(255, 255, 255, .22); border-radius: 999px; color: var(--muted); }
  .tags li:first-child { border-color: var(--accent-2); background: rgba(199, 55, 47, .55); color: #fff; }
  .bio { color: rgba(242, 238, 232, .92); }
  .facts div { border-top: 1px solid rgba(255, 255, 255, .08); padding-top: .4rem; }
  .lang-switch { border: 1px solid rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .05); }
  .lang-switch button[aria-pressed="true"] { background: var(--accent); color: #1A1D26; }

  .links-title { flex-direction: column; align-items: flex-end; gap: 0; margin-bottom: .8rem; }
  .lt-deco { display: block; font-family: var(--serif); font-style: italic; font-weight: 600; font-size: 1.9rem; line-height: 1; color: var(--accent); text-shadow: 0 0 1rem rgba(242, 196, 109, .3); }
  .lt-text { font-size: .74rem; }
  .links ul { gap: .5rem; }
  .link { border-radius: .9rem; }
  .chip { border-radius: 50%; border: 1px solid rgba(255, 255, 255, .3); color: #fff; background: rgba(255, 255, 255, .05); }
  .link:hover { background: linear-gradient(160deg, rgba(60, 54, 44, .3), rgba(20, 18, 16, .15)); box-shadow: 0 0 0 1px rgba(242, 196, 109, .45), 0 0 1.6rem rgba(242, 196, 109, .2); transform: translateX(-.25rem); }
  .link:hover .chip { background: var(--brand); border-color: transparent; }

  .music-covers img { border-radius: .5rem; border: 1px solid rgba(255, 255, 255, .35); box-shadow: 0 .2rem .6rem rgba(0, 0, 0, .4); }
  .music-entry:hover { box-shadow: 0 0 0 1px rgba(242, 196, 109, .45), 0 0 1.6rem rgba(242, 196, 109, .2); }

  /* 雨丝 */
  .rain {
    display: block; position: fixed; inset: -20% 0 0 0; z-index: 0; pointer-events: none; opacity: .3;
    background-image:
      repeating-linear-gradient(104deg, transparent 0 46px, rgba(255, 255, 255, .22) 46px 47px, transparent 47px 120px),
      repeating-linear-gradient(101deg, transparent 0 80px, rgba(255, 255, 255, .14) 80px 81px, transparent 81px 190px);
    background-size: 100% 220px, 100% 300px;
    animation: rain .9s linear infinite;
  }
  @keyframes rain { to { background-position: -40px 220px, -60px 300px; } }
}
/* 16:10 等较方的电脑窗口：人物占比更大，两栏稍收窄 */
@media (pointer: fine) and (min-aspect-ratio: 6/5) and (max-aspect-ratio: 17/10) {
  .page { grid-template-columns: minmax(22rem, 30vw) 1fr minmax(16rem, 21vw); }
}
/* 横屏但很矮（手机横屏等）：左栏内容可滚动 */
@media (min-aspect-ratio: 17/10) and (max-height: 560px), (pointer: fine) and (min-aspect-ratio: 6/5) and (max-height: 560px) {
  .page { overflow: auto; grid-template-columns: minmax(18rem, 36vw) 1fr minmax(14rem, 26vw); padding: 1rem 1.4rem; }
  .profile { padding: 1rem; }
  .facts { display: none; }
}

/* ============================================================
   绘梨衣 ERII —— 4:3 / 16:10 平板
   墨黑排版拼贴（呼应壁纸的 Feel / 感じる）、笔记本纸片、胶带、橡皮鸭贴纸
   ============================================================ */
@media (pointer: coarse) and (min-aspect-ratio: 3/5) and (max-aspect-ratio: 17/10) {
  .card {
    background: var(--card-bg);
    border: 2px solid #111;
    border-radius: .3rem;
    box-shadow: .4rem .4rem 0 #111;
    -webkit-backdrop-filter: blur(4px) brightness(1.08); backdrop-filter: blur(4px) brightness(1.08);
  }
  .profile { transform: rotate(-.5deg); }
  .profile::before { /* 胶带 */
    content: ""; position: absolute; top: -.75rem; left: 1.6rem; width: 5.5rem; height: 1.5rem;
    background: rgba(255, 236, 190, .78); transform: rotate(-4deg);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .15);
  }
  .profile-duck { display: block; position: absolute; top: -2.2rem; right: 1rem; width: 4.4rem; height: 4.1rem; transform: rotate(10deg); filter: drop-shadow(.15rem .2rem 0 rgba(0, 0, 0, .25)); }
  .avatar { border: 2px solid #111; border-radius: .3rem; }
  .profile h1 { font-size: 2.6rem; letter-spacing: -.01em; transform: skewX(-9deg); transform-origin: left bottom;
    background: linear-gradient(transparent 62%, rgba(200, 16, 46, .28) 62%, rgba(200, 16, 46, .28) 88%, transparent 88%); width: fit-content; padding-right: .3rem; }
  .tagline { color: var(--accent); }
  .profile-head .lang-switch { margin-right: 4.4rem; }
  .lang-switch { border: 2px solid #111; background: #fff; border-radius: .3rem; }
  .lang-switch button { border-radius: .15rem; color: #111; }
  .lang-switch button[aria-pressed="true"] { background: #111; color: #fff; }
  .tags li { border: 2px solid #111; background: rgba(255, 255, 255, .7); }
  .tags li:first-child { background: var(--accent); border-color: var(--accent); color: #fff; }
  .bio {
    line-height: 1.9rem; padding: 0 .2rem;
    background: repeating-linear-gradient(transparent 0 calc(1.9rem - 1px), rgba(17, 17, 17, .14) calc(1.9rem - 1px) 1.9rem);
  }
  .facts dt { color: var(--accent); }
  .facts dd { color: #333; }

  .links-title { gap: .8rem; position: relative; }
  .lt-deco { display: block; font-size: 2.2rem; line-height: 1; font-style: italic; transform: skewX(-10deg); color: #111; letter-spacing: -.02em; }
  .links-title::after { content: ""; position: absolute; left: -.4rem; right: 40%; top: 1.15rem; height: 2px; background: #111; }
  .lt-text { color: #333; font-size: .8rem; }
  .link {
    background: rgba(255, 255, 255, .36); border: 2px solid #111; border-left: .5rem solid var(--brand);
    border-radius: .25rem; box-shadow: .3rem .3rem 0 #111;
    -webkit-backdrop-filter: blur(4px) brightness(1.08); backdrop-filter: blur(4px) brightness(1.08);
  }
  .links li:nth-child(3n+2) .link { transform: rotate(.6deg); }
  .links li:nth-child(4n+1) .link { transform: rotate(-.5deg); }
  .chip { background: #111; color: #fff; border-radius: .2rem; }
  .link:hover { transform: translate(-.15rem, -.15rem) rotate(0); box-shadow: .45rem .45rem 0 var(--accent); }
  .music-covers img { border: 2px solid #111; border-radius: .15rem; }
  .music-entry:hover { transform: translate(-.15rem, -.15rem); box-shadow: .55rem .55rem 0 var(--accent); }
  .music-text b { font-size: 1.05rem; }
  .credit { color: #333; }
}
/* 横屏平板：左边内容，右边立绘；背景压一层大字排版 */
@media (pointer: coarse) and (min-aspect-ratio: 6/5) and (max-aspect-ratio: 17/10) {
  body { overflow: hidden; }
  .page {
    position: fixed; top: 0; bottom: 0; left: 0;
    width: max(53vw, 36rem);
    overflow: auto;
    display: flex; flex-direction: column; justify-content: center; gap: 1.1rem;
    padding: 4vh 3rem 3vh;
  }
  .page > * { width: 100%; max-width: 42rem; }
  .links ul { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .credit { text-align: left; }
  .type-deco { /* 横版壁纸自带排版字，这层不再需要 */
    display: none !important; position: fixed; left: -1rem; bottom: -2.5rem; z-index: 0; pointer-events: none;
    font-style: italic; color: rgba(17, 17, 17, .07); line-height: .85; transform: skewX(-10deg);
  }
  .td-1 { display: block; font-size: 12rem; letter-spacing: -.04em; }
  .td-2 { position: fixed; left: 2rem; top: 1.2rem; font-size: 1.1rem; color: rgba(17, 17, 17, .5); transform: none; font-style: normal; letter-spacing: .3em; }
}
/* 偏方的横屏（4:3 等）左栏较窄：链接卡片收紧，仍保持三列，避免整页超出一屏 */
@media (pointer: coarse) and (min-aspect-ratio: 6/5) and (max-aspect-ratio: 3/2) {
  .page { padding-left: 2rem; padding-right: 2rem; gap: .9rem; }
  .link { padding: .5rem .55rem; gap: .5rem; }
  .chip { width: 2rem; height: 2rem; }
  .chip svg { width: 1.1rem; height: 1.1rem; }
  .link-text b { font-size: .86rem; }
}

/* ============================================================
   幽香 YUUKA —— 手机
   向日葵花田：通透的奶油玻璃、大圆角、头像是花心、叶绿和向日葵黄
   ============================================================ */
@media (max-aspect-ratio: 3/5), (pointer: fine) and (max-aspect-ratio: 6/5) {
  .page { text-shadow: 0 0 .4rem rgba(255, 250, 232, .9), 0 0 .15rem rgba(255, 250, 232, .9); }
  .card, .link {
    background: var(--card-bg);
    border: 1px solid var(--card-line);
    box-shadow: 0 .6rem 1.6rem rgba(120, 80, 0, .12);
    -webkit-backdrop-filter: blur(10px) saturate(1.4) brightness(1.06); backdrop-filter: blur(10px) saturate(1.4) brightness(1.06);
  }
  .card { border-radius: 1.6rem; }
  .avatar-petals { display: block; position: absolute; width: 6.6rem; height: 6.6rem; animation: spin 40s linear infinite; }
  .avatar-wrap { width: 6.6rem; height: 6.6rem; margin: -.6rem 0 -.6rem -.5rem; }
  .avatar { width: 3.7rem; height: 3.7rem; border: 2px solid #3B2A10; }
  @keyframes spin { to { transform: rotate(360deg); } }
  .profile h1 { font-size: 2rem; color: #2F4A1E; }
  .tagline { color: var(--accent-2); }
  .lang-switch { background: rgba(255, 255, 255, .6); border: 1px solid rgba(255, 255, 255, .8); }
  .lang-switch button[aria-pressed="true"] { background: var(--accent-2); }
  .profile-head .lang-switch { position: absolute; top: -1rem; right: 1.1rem; box-shadow: 0 .3rem .8rem rgba(120, 80, 0, .15); }
  .tags li { border-radius: 999px 999px 999px .3rem; border: 1.5px solid rgba(78, 125, 49, .55); color: #3B5A26; background: rgba(255, 255, 255, .35); }
  .tags li:first-child { background: #F5B82E; border-color: #F5B82E; color: #3B2A10; }
  .facts dt { color: var(--accent-2); }

  .links-title { justify-content: center; gap: .5rem; }
  .links-title::before, .links-title::after { content: ""; flex: 1; height: 1.5px; background: linear-gradient(90deg, transparent, rgba(78, 125, 49, .6)); }
  .links-title::after { background: linear-gradient(90deg, rgba(78, 125, 49, .6), transparent); }
  .lt-text { padding: .15rem .8rem; border-radius: 999px; background: rgba(255, 252, 238, .75); color: #3B5A26; }
  .links ul { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .links li:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .link { border-radius: 1.2rem; padding: .55rem .65rem; gap: .6rem; }
  .chip { width: 2.2rem; height: 2.2rem; border-radius: 50%; background: #fff; color: var(--brand); box-shadow: 0 0 0 .14rem #F5B82E; }
  .link-text b { font-size: .9rem; }
  .link-text small { font-size: .7rem; }
  .link:active { transform: scale(.97); }
  .music-covers img { width: 2.6rem; height: 2.6rem; border-radius: .45rem; border: 2px solid #fff; margin-left: -.9rem; box-shadow: 0 .15rem .4rem rgba(0, 0, 0, .18); }
  .music-entry { border-radius: 999px; }
  .music-arrow { color: var(--accent-2); }
  .credit { align-self: center; padding: .15rem .8rem; border-radius: 999px; background: rgba(255, 252, 238, .7); }
}

/* ============================================================
   竖屏共用（幽香手机 / 绘梨衣竖屏平板）：壁纸固定，内容从下往上滑
   ============================================================ */
@media (max-aspect-ratio: 6/5) {
  .page {
    display: flex; flex-direction: column; gap: 1rem;
    margin: 0 auto;
    padding: var(--sheet-top) 1rem calc(1.8rem + env(safe-area-inset-bottom));
  }
  .nametag {
    display: inline-flex; align-items: center; gap: .4rem;
    position: fixed; top: calc(.9rem + env(safe-area-inset-top)); left: 1rem; z-index: 2;
    padding: .35rem .9rem .35rem .45rem; border-radius: 999px; font-size: .95rem;
    transition: opacity .25s ease, transform .25s ease;
  }
  .nametag svg { width: 1.4rem; height: 1.4rem; }
  body.scrolled .nametag { opacity: 0; transform: translateY(-.5rem); pointer-events: none; }
  .profile::after { /* 上滑提示条 */
    content: ""; position: absolute; top: -1.35rem; left: 50%; width: 2.8rem; height: .3rem; border-radius: .2rem;
    transform: translateX(-50%); background: rgba(255, 255, 255, .92); box-shadow: 0 0 0 1px rgba(0, 0, 0, .25);
  }
}
@media (max-aspect-ratio: 3/5), (pointer: fine) and (max-aspect-ratio: 6/5) {
  .page { --sheet-top: 60svh; max-width: 36rem; }
  .nametag { background: rgba(255, 250, 232, .6); border: 1px solid rgba(255, 255, 255, .8); color: #2F4A1E;
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: 0 .3rem .9rem rgba(120, 80, 0, .15); }
  .nametag-duck { display: none; }
}
@media (pointer: coarse) and (min-aspect-ratio: 3/5) and (max-aspect-ratio: 6/5) {
  .page { --sheet-top: 56svh; max-width: 46rem; padding-left: 2rem; padding-right: 2rem; gap: 1.2rem;
    text-shadow: 0 0 .35rem rgba(255, 255, 255, .95), 0 0 .12rem #fff; }
  .facts dd { color: #222; }
  .links ul { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .nametag { background: #fff; border: 2px solid #111; border-radius: .3rem; box-shadow: .25rem .25rem 0 #111; }
  .nametag-flower { display: none; }
  .links-title, .credit { width: fit-content; background: rgba(255, 255, 255, .78); padding: .2rem .7rem; border: 2px solid #111; }
  .profile::after { display: none; }
}
