/* ============================================================
   奇妙猫咪世界维基百科 - 样式表
   基于 original_styles.css 扩展
   ============================================================ */

/* ===== 设计令牌：亮色/暗色 CSS 变量 ===== */
:root {
    --bg-page: radial-gradient(circle at 12% 8%, rgba(255, 218, 122, 0.55), transparent 26rem), radial-gradient(circle at 86% 18%, rgba(104, 207, 188, 0.42), transparent 24rem), linear-gradient(135deg, #fff7cf 0%, #e7f7f1 48%, #fde6ef 100%);
    --bg-card: rgba(255, 255, 255, 0.72);
    --bg-nav: rgba(255, 255, 255, 0.95);
    --bg-card-alt: rgba(255, 255, 255, 0.82);
    --text-primary: #263238;
    --text-secondary: #666;
    --accent-primary: #237c72;
    --accent-primary-hover: #174e49;
    --accent-gold: #f2b84b;
    --accent-rose: #c45d77;
    --shadow: rgba(75, 112, 106, 0.18);
    --border-subtle: rgba(35, 124, 114, 0.18);
    --border-card: rgba(255, 255, 255, 0.8);
    --bg-modal: rgba(255, 255, 255, 0.9);
    --bg-thumb: #f4fbf8;
}

[data-theme="dark"] {
    --bg-page: radial-gradient(circle at 12% 8%, rgba(255, 218, 122, 0.18), transparent 26rem), radial-gradient(circle at 86% 18%, rgba(77, 212, 176, 0.15), transparent 24rem), linear-gradient(135deg, #1a1a2e 0%, #16213e 48%, #0f3460 100%);
    --bg-card: rgba(30, 30, 50, 0.80);
    --bg-nav: rgba(18, 18, 35, 0.92);
    --bg-card-alt: rgba(22, 22, 42, 0.82);
    --text-primary: #dde4e8;
    --text-secondary: #b0b6bc;
    --accent-primary: #4dd4b0;
    --accent-primary-hover: #3bb89a;
    --accent-gold: #f5c96a;
    --accent-rose: #e88298;
    --shadow: rgba(0, 0, 0, 0.35);
    --border-subtle: rgba(77, 212, 176, 0.18);
    --border-card: rgba(40, 40, 65, 0.55);
    --bg-modal: rgba(22, 22, 42, 0.92);
    --bg-thumb: #1e1e35;
}

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

body {
    font-family: 'Arial', sans-serif;
    background: var(--bg-page);
    min-height: 100vh;
    color: var(--text-primary);
    transition: background 0.4s ease, color 0.3s ease;
}

/* ===== 导航栏样式 ===== */
.navbar {
    background: var(--bg-nav);
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent-primary);
    white-space: nowrap;
    margin-right: 1rem;
}

.nav-menu {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    justify-content: flex-end;
    flex: 1;
}

.music-toggle {
    position: relative;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    margin-left: 0.75rem;
    border: 1px solid rgba(35, 124, 114, 0.25);
    border-radius: 50%;
    background: var(--accent-primary);
    color: #fff;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 5px 14px rgba(35, 124, 114, 0.2);
    transition: background 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

.music-toggle:hover {
    transform: translateY(-1px);
}

.music-toggle.is-muted {
    background: var(--bg-card);
    color: var(--text-secondary);
    opacity: 0.82;
}

.music-toggle.is-muted::after {
    content: '';
    position: absolute;
    top: 9px;
    left: 19px;
    width: 2px;
    height: 22px;
    border-radius: 2px;
    background: var(--accent-rose);
    transform: rotate(-42deg);
}

.theme-toggle {
    position: relative;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    margin-left: 0.5rem;
    border: 1px solid var(--border-subtle);
    border-radius: 50%;
    background: var(--bg-card);
    color: var(--accent-gold);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.theme-toggle:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--shadow);
}

.nav-btn {
    padding: 0.4rem 1rem;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    white-space: nowrap;
}

.nav-btn.active,
.nav-btn:hover {
    background: var(--accent-primary);
    color: white;
}

.legal-nav-btn {
    border: 1px solid rgba(196, 93, 119, 0.35);
    color: var(--accent-rose);
    font-weight: 700;
}

.legal-nav-btn.active,
.legal-nav-btn:hover {
    background: var(--accent-rose);
    color: #fff;
}

/* 数据加载状态 */
.nav-btn.nav-loading {
    color: var(--text-secondary);
    cursor: wait;
    animation: pulse 1.2s ease-in-out infinite;
}

.nav-btn.nav-error {
    color: #c44;
    cursor: not-allowed;
    text-decoration: line-through;
    text-decoration-color: rgba(204,68,68,0.4);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ===== 导航栏分组 ===== */
.nav-group {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-group + .nav-group {
    margin-left: 0.15rem;
    padding-left: 0.5rem;
    border-left: 1.5px solid var(--border-subtle);
}

.nav-group-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    white-space: nowrap;
    padding: 0 0.15rem;
    user-select: none;
    pointer-events: none;
}

/* ===== 主要内容区域 ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.hero-panel {
    min-height: 280px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
    gap: 2rem;
    align-items: center;
    padding: 2rem;
    border-radius: 8px;
    background: var(--bg-card);
    box-shadow: 0 18px 45px var(--shadow);
    border: 1px solid var(--border-card);
}

.hero-copy h1 {
    font-size: clamp(2rem, 6vw, 4.4rem);
    line-height: 1.05;
    color: var(--accent-primary-hover);
    margin: 0.45rem 0 0.75rem;
}

.hero-copy p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.7;
    max-width: 34rem;
}

.hero-kicker,
.section-kicker {
    display: inline-block;
    color: var(--accent-rose);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.hero-art {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 8px;
    background: var(--bg-card);
    box-shadow: inset 0 0 0 1px rgba(35, 124, 114, 0.12);
}

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

/* ===== 搜索容器样式 ===== */
.search-container {
    padding: 1rem 0;
    margin-bottom: 0.5rem;
}

.search-box {
    position: relative;
}

#search-input {
    width: 100%;
    padding: 1rem 3rem 1rem 1.5rem;
    border: 2px solid var(--border-subtle);
    border-radius: 999px;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
    background: var(--bg-nav);
    backdrop-filter: blur(10px);
    color: var(--text-primary);
}

#search-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

/* 搜索占位轮播 - CSS animation 实现，无 JS 定时器 */
.placeholder-cycler {
    position: absolute;
    left: 1.5rem;
    right: 5.5rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    overflow: hidden;
    height: 1.2rem;
}

.placeholder-cycler span {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    opacity: 0;
    animation: placeholderCycle 9s infinite;
    color: var(--text-secondary);
    font-size: 1rem;
    white-space: nowrap;
}

.placeholder-cycler span:nth-child(1) { animation-delay: 0s; }
.placeholder-cycler span:nth-child(2) { animation-delay: 3s; }
.placeholder-cycler span:nth-child(3) { animation-delay: 6s; }

@keyframes placeholderCycle {
    0%      { opacity: 0; transform: translateY(8px); }
    3%      { opacity: 1; transform: translateY(0); }
    27%     { opacity: 1; transform: translateY(0); }
    33%     { opacity: 0; transform: translateY(-8px); }
    100%    { opacity: 0; transform: translateY(-8px); }
}

/* 聚焦或有值时隐藏轮播 */
.search-box:focus-within .placeholder-cycler,
.search-box.has-value .placeholder-cycler {
    display: none;
}

#search-input:focus {
    border-color: var(--accent-primary);
    background: var(--bg-card);
    box-shadow: 0 0 0 4px rgba(104, 207, 188, 0.22);
}

.search-button {
    position: absolute;
    right: 60px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--accent-primary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.search-button:hover {
    background: var(--bg-card);
}

.clear-button {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.clear-button:hover {
    background: var(--bg-card);
    color: var(--text-secondary);
}

.search-results-info {
    text-align: center;
    color: var(--accent-primary-hover);
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: var(--bg-card);
    border-radius: 10px;
    backdrop-filter: blur(5px);
}

/* 跨模块搜索结果 */
.cross-module-results {
    margin-bottom: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.cross-module-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 1rem;
    background: var(--bg-card-alt);
    backdrop-filter: blur(5px);
    border: 1px solid var(--border-card);
    border-radius: 999px;
    color: var(--accent-primary-hover);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
}

.cross-module-chip:hover {
    background: var(--bg-card);
    transform: translateY(-2px);
}

.cross-module-chip .chip-count {
    background: var(--accent-primary);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
}

.quick-panel {
    margin: 0 0 2rem;
}

.quick-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: end;
    margin-bottom: 1rem;
}

.quick-header h2 {
    color: var(--accent-primary-hover);
    font-size: 2rem;
    margin-top: 0.2rem;
}

.result-pill {
    color: var(--accent-primary-hover);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
    padding: 0.45rem 0.85rem;
    font-size: 0.86rem;
    white-space: nowrap;
}

.module-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 0.85rem;
    margin-bottom: 1.5rem;
}

.module-tile {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) auto;
    gap: 0.8rem;
    align-items: center;
    min-height: 86px;
    padding: 0.72rem;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    background: var(--bg-card-alt);
    color: inherit;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 8px 24px var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.module-tile:hover,
.module-tile.active {
    transform: translateY(-3px);
    border-color: rgba(35, 124, 114, 0.48);
    box-shadow: 0 14px 28px var(--shadow);
}

.module-thumb {
    width: 64px;
    height: 64px;
    overflow: hidden;
    border-radius: 8px;
    background: var(--bg-thumb);
}

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

.module-info {
    min-width: 0;
}

.module-name {
    display: block;
    color: var(--accent-primary-hover);
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.module-desc {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--text-secondary);
    font-size: 0.78rem;
    line-height: 1.45;
}

.module-count {
    align-self: start;
    color: var(--accent-rose);
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

/* ===== 标签页内容 ===== */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ===== 关于 / 法律声明 ===== */
.legal-page {
    margin-top: 2rem;
    padding: 2rem;
    border: 2px solid rgba(196, 93, 119, 0.28);
    border-radius: 8px;
    background: var(--bg-card-alt);
    box-shadow: 0 14px 34px var(--shadow);
}

.legal-page h2 {
    margin: 0.35rem 0 1rem;
    color: var(--accent-primary-hover);
    font-size: clamp(1.8rem, 4vw, 3rem);
    line-height: 1.15;
}

.legal-highlight {
    margin: 1rem 0 1.4rem;
    padding: 1rem 1.2rem;
    border-left: 5px solid var(--accent-rose);
    border-radius: 8px;
    background: rgba(196, 93, 119, 0.12);
    color: var(--text-primary);
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.8;
}

.legal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.legal-card {
    padding: 1.1rem;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    background: var(--bg-card);
}

.legal-card h3 {
    margin-bottom: 0.55rem;
    color: var(--accent-primary-hover);
    font-size: 1rem;
}

.legal-card p,
.legal-footnote {
    color: var(--text-secondary);
    line-height: 1.75;
}

.legal-card a {
    color: var(--accent-primary-hover);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.legal-footnote {
    margin-top: 1.2rem;
    font-size: 0.9rem;
}

/* ===== 备案页脚 ===== */
.site-footer {
    padding: 1.5rem 1rem 2rem;
    text-align: center;
    color: var(--text-secondary);
}

.icp-link {
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-decoration: none;
    transition: color 0.2s ease;
}

.icp-link:hover {
    color: var(--accent-primary-hover);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ===== 关系图谱 ===== */
#relationship-graph-container {
    border-radius: 12px;
    overflow: hidden;
    background: rgba(30, 30, 50, 0.63);
    box-shadow: 0 8px 32px var(--shadow);
    border: 1px solid var(--border-card);
}

/* ===== 子标签 ===== */
.sub-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.sub-tab-btn {
    padding: 0.5rem 1.2rem;
    border: 2px solid var(--border-card);
    border-radius: 999px;
    background: var(--bg-card-alt);
    color: var(--accent-primary-hover);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    backdrop-filter: blur(5px);
}

.sub-tab-btn.active,
.sub-tab-btn:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--border-card);
}

/* ===== 模块通用内容区 ===== */
.module-content {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== 页面互动猫咪 ===== */
.pet-cat {
    --pet-x: 24px;
    --pet-y: 72vh;
    --pet-facing: 1;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 90;
    width: 148px;
    height: 128px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    transform: translate3d(var(--pet-x), var(--pet-y), 0);
    transform-origin: 50% 90%;
    filter: drop-shadow(0 8px 12px rgba(69, 88, 74, 0.18));
    transition: filter 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.pet-cat:hover {
    filter: drop-shadow(0 10px 16px rgba(69, 88, 74, 0.26));
}

.pet-cat:focus-visible {
    outline: none;
}

.pet-cat-body {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 148px;
    height: 118px;
    display: block;
    transform: scaleX(var(--pet-facing));
    transform-origin: 50% 90%;
}

.pet-cat-sprite {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    user-select: none;
}

.pet-cat-shadow {
    position: absolute;
    left: 22px;
    right: 20px;
    bottom: 7px;
    height: 16px;
    border-radius: 50%;
    background: rgba(49, 72, 63, 0.18);
    transform-origin: 50% 50%;
}

.pet-cat-bubble {
    position: absolute;
    left: 50%;
    bottom: 96px;
    min-width: 58px;
    max-width: 92px;
    padding: 0.35rem 0.5rem;
    border: 1px solid rgba(242, 184, 75, 0.55);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: #9b5b1f;
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1.2;
    opacity: 0;
    transform: translate(-50%, 8px) scale(0.92);
    box-shadow: 0 8px 20px rgba(93, 68, 39, 0.14);
    pointer-events: none;
    white-space: nowrap;
}

.pet-cat.is-walk .pet-cat-shadow {
    animation: petShadowStep 0.46s ease-in-out infinite;
}

.pet-cat.is-heart .pet-cat-bubble,
.pet-cat.is-spark .pet-cat-bubble,
.pet-cat.is-hop .pet-cat-bubble {
    animation: petBubble 1s ease both;
}

.pet-cat.is-heart::before,
.pet-cat.is-spark::before,
.pet-cat.is-hop::before {
    position: absolute;
    left: 50%;
    bottom: 72px;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    color: #c45d77;
    font-size: 1.65rem;
    pointer-events: none;
    animation: petPop 0.9s ease both;
}

.pet-cat.is-heart::before {
    content: "♡";
}

.pet-cat.is-spark::before {
    content: "✦";
    color: #f2b84b;
}

.pet-cat.is-hop::before {
    content: "!";
    color: #237c72;
    font-weight: 800;
}

@keyframes petShadowStep {
    0%, 100% { transform: scaleX(1); opacity: 0.2; }
    50% { transform: scaleX(0.82); opacity: 0.14; }
}

@keyframes petBubble {
    0% { opacity: 0; transform: translate(-50%, 8px) scale(0.92); }
    18%, 78% { opacity: 1; transform: translate(-50%, 0) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -10px) scale(0.98); }
}

@keyframes petPop {
    0% { opacity: 0; transform: translate(-50%, 8px) scale(0.4); }
    24% { opacity: 1; transform: translate(-50%, -10px) scale(1.05); }
    100% { opacity: 0; transform: translate(-50%, -34px) scale(0.85); }
}

/* ===== 角色网格布局（原版） ===== */
.character-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

/* ===== 角色卡片样式（原版核心） ===== */
.character-card {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.character-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #237c72, #f2b84b, #c45d77);
}

.character-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.character-card.highlight {
    border: 2px solid var(--accent-primary);
    box-shadow: 0 10px 30px var(--shadow);
}

.character-avatar {
    width: 120px;
    height: 120px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid var(--accent-primary);
    position: relative;
}

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

.character-name {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.character-race {
    color: var(--accent-primary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* ===== 通用信息卡片（非角色模块用） ===== */
.info-card {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 10px 26px rgba(75, 112, 106, 0.14);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    cursor: default;
}

.info-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #237c72, #f2b84b, #c45d77);
}

.info-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(75, 112, 106, 0.22);
}

.info-card .card-title {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.item-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    overflow: hidden;
    border-radius: 8px;
    background: linear-gradient(135deg, #f8fff9, #fff7de);
    border: 1px solid var(--border-subtle);
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.info-card .card-subtitle {
    color: var(--accent-primary);
    font-size: 0.85rem;
    margin-bottom: 0.8rem;
}

.info-card .card-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

.info-card .card-meta {
    margin-top: 0.8rem;
    padding-top: 0.8rem;
    border-top: 1px solid var(--border-subtle);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* 模块列表（信箱/表格型） */
.module-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    align-items: start;
}

.module-section-title {
    color: var(--accent-primary-hover);
    text-align: center;
    margin-bottom: 1rem;
}

/* NPC卡片特殊样式 */
.npc-card::before {
    background: linear-gradient(90deg, #ff6b6b, #ee5a24);
}

.npc-card .character-avatar {
    border-color: #ff6b6b;
}

.npc-card .character-race {
    color: #ff6b6b;
}

/* ===== 空状态样式 ===== */
.empty-state {
    text-align: center;
    color: var(--accent-primary-hover);
    font-size: 1.2rem;
    padding: 3rem;
    background: var(--bg-card);
    border-radius: 8px;
    backdrop-filter: blur(5px);
    margin: 2rem auto;
    max-width: 500px;
    grid-column: 1 / -1;
}

.character-grid .empty-state {
    grid-column: 1 / -1;
    justify-self: center;
}

/* ===== 角色关系图谱嵌入区 ===== */
.graph-section-title {
    font-size: 1.3rem;
    color: var(--accent-primary);
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px dashed var(--border-subtle);
}

/* ===== 信箱描述区 ===== */
.mailbox-description {
    color: var(--accent-primary-hover);
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    background: var(--bg-card);
    border-radius: 12px;
    backdrop-filter: blur(5px);
    font-size: 0.9rem;
    line-height: 1.6;
    text-align: center;
}

/* ===== 邀请卡样式 ===== */
.invitation-card {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border-left: 4px solid var(--accent-primary);
}

.invitation-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

.invitation-card .inv-sender {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
}

.invitation-card .inv-map {
    display: inline-block;
    background: var(--accent-primary);
    color: white;
    padding: 0.2rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    margin-bottom: 0.8rem;
}

.invitation-card .inv-task {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.invitation-card .inv-condition {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.invitation-card .inv-reward {
    color: var(--accent-primary);
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    gap: 0.55rem;
    align-items: center;
}

.invitation-card .inv-reward img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border-radius: 8px;
    background: #fff7de;
    border: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

/* ===== 食谱卡片 ===== */
.recipe-card .card-ingredients {
    margin-top: 0.8rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.recipe-card .ingredient-tag {
    background: #fff4d6;
    color: #9b6420;
    padding: 0.2rem 0.7rem;
    border-radius: 12px;
    font-size: 0.8rem;
    border: 1px solid #f2d27a;
}

/* ===== 模态框样式（原版） ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: var(--bg-modal);
    margin: 2% auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    color: var(--text-secondary);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--bg-modal);
    transition: all 0.3s ease;
}

.close:hover {
    color: var(--accent-primary);
    background: var(--bg-card);
}

.character-detail {
    display: flex;
    padding: 2rem;
    gap: 2rem;
}

.character-detail .character-avatar {
    width: 200px;
    height: 200px;
    flex-shrink: 0;
    border: 6px solid var(--accent-primary);
}

.character-info {
    flex: 1;
}

.character-info h2 {
    color: var(--text-primary);
    font-size: 2rem;
    margin-bottom: 1.5rem;
    border-bottom: 3px solid var(--accent-primary);
    padding-bottom: 0.5rem;
}

.info-section {
    margin-bottom: 1.5rem;
}

.info-section h3 {
    color: var(--accent-primary);
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    border-left: 4px solid var(--accent-primary);
    padding-left: 0.5rem;
}

.info-section p,
.info-section div {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

/* ===== 好朋友和食物列表样式（原版） ===== */
.friends-list,
.food-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.friend-item,
.food-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--bg-card);
    border-radius: 12px;
    padding: 0.8rem;
    border: 2px solid var(--border-subtle);
    transition: all 0.3s ease;
    min-width: 80px;
}

.friend-item:hover,
.food-item:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

.friend-avatar,
.food-image {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 0.5rem;
    border: 2px solid var(--accent-primary);
}

.food-image {
    border-radius: 8px;
}

.friend-name,
.food-name {
    font-size: 0.85rem;
    color: var(--text-primary);
    text-align: center;
    font-weight: 500;
    line-height: 1.2;
}

/* ===== 旧的标签样式保留 ===== */
.friend-tag,
.food-tag {
    background: var(--bg-card);
    color: var(--accent-primary);
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.9rem;
    border: 1px solid var(--accent-primary);
}

/* ===== 响应式设计 ===== */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .hero-panel {
        grid-template-columns: 1fr;
        padding: 1rem;
        gap: 1rem;
    }

    .hero-art {
        max-height: 220px;
    }

    .quick-header {
        align-items: start;
        flex-direction: column;
    }

    .quick-header h2 {
        font-size: 1.55rem;
    }

    .module-overview {
        grid-template-columns: 1fr;
    }

    .character-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }

    .module-list {
        grid-template-columns: 1fr;
    }

    .character-detail {
        flex-direction: column;
        padding: 1rem;
    }

    .character-detail .character-avatar {
        width: 150px;
        height: 150px;
        margin: 0 auto;
    }

    .navbar {
        padding: 1rem;
        flex-direction: column;
        gap: 0.5rem;
    }

    .music-toggle {
        position: absolute;
        top: 0.75rem;
        right: 0.75rem;
        margin: 0;
    }

    .nav-menu {
        justify-content: center;
    }

    .nav-group + .nav-group {
        margin-left: 0;
        padding-left: 0.35rem;
    }

    .nav-group-label {
        font-size: 0.6rem;
    }

    .nav-btn {
        font-size: 0.75rem;
        padding: 0.35rem 0.8rem;
    }

    .page-title {
        font-size: 2rem;
    }

    .friends-list,
    .food-list {
        gap: 0.8rem;
    }

    .friend-item,
    .food-item {
        min-width: 70px;
        padding: 0.6rem;
    }

    .friend-avatar,
    .food-image {
        width: 40px;
        height: 40px;
    }

    .friend-name,
    .food-name {
        font-size: 0.8rem;
    }

    .sub-tabs {
        gap: 0.3rem;
    }

    .sub-tab-btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.9rem;
    }
}

@media (max-width: 480px) {
    .hero-copy h1 {
        font-size: 2rem;
    }

    .module-tile {
        grid-template-columns: 54px minmax(0, 1fr);
    }

    .module-thumb {
        width: 54px;
        height: 54px;
    }

    .module-count {
        grid-column: 2;
        justify-self: start;
    }

    .character-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        margin: 5% auto;
    }

    .navbar {
        padding: 0.8rem;
    }

    .nav-brand {
        font-size: 1.2rem;
    }

    .nav-btn {
        font-size: 0.7rem;
        padding: 0.3rem 0.6rem;
    }

    .nav-group {
        gap: 0.15rem;
    }

    .nav-group + .nav-group {
        padding-left: 0.25rem;
    }

    .nav-group-label {
        font-size: 0.55rem;
    }
}
