/* =========================================
   甫白传 · 样式表
   1. 变量与基础
   2. 背景层 / 特效层
   3. 导航
   4. 页面与排版
   5. 首页
   6. 成员 / 群友的话
   7. 发电 / 加入
   8. 页脚
   9. 移动端适配
   10. 减少动效
   ========================================= */

/* ---------- 1. 变量与基础 ---------- */
:root {
    --bg-color: #fcfcfc;
    --grid-color: #f0f0f0;
    --text-main: #111111;
    --text-dim: #888888;
    --border-color: #eaeaea;
    --accent: #000000;
    --afdian-color: #946ce6;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", sans-serif;
    line-height: 1.7;
    letter-spacing: 0.5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
    word-break: break-word;
    cursor: crosshair;
    background-image:
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 40px 40px;
    background-position: center top;
}

/* 可点击的东西恢复手型光标 */
a, button, .nav-item, .member-card, [id$="-trigger"] {
    cursor: pointer;
}

/* ---------- 2. 背景层 / 特效层 ---------- */
#dmc-bg-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
    filter: blur(3px) brightness(0.95);
    transform: scale(1.05); /* 防止模糊导致边缘漏白 */
}
#dmc-bg-container.active { opacity: 1; }

/* 静态半透明遮罩，保证文字清晰 */
#dmc-bg-container::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(252, 252, 252, 0.75);
    z-index: 10;
}

.dmc-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
}
.dmc-layer.active { opacity: 1; }

#canvas-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 2;
}

/* ---------- 3. 导航 ---------- */
.nav-bar {
    width: 100%;
    max-width: 1000px;
    padding: 30px 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 40px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: rgba(252, 252, 252, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 100;
    transition: all 0.3s ease;
}

.nav-item {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
    padding-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
    flex: 0 0 auto;
}
.nav-item:hover,
.nav-item.active {
    color: var(--text-main);
    font-weight: 700;
}
.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--accent);
    animation: lineExpand 0.3s ease-out forwards;
}

@keyframes lineExpand {
    from { transform: scaleX(0); transform-origin: left; }
    to   { transform: scaleX(1); transform-origin: left; }
}

/* ---------- 4. 页面与排版 ---------- */
.container {
    max-width: 1000px;
    width: 100%;
    padding: 0 20px 100px;
    min-height: 70vh;
    z-index: 10;
    position: relative;
}

.page { display: none; }
.page.active {
    display: block;
    animation: slideIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(20px) scale(0.99); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

h1 {
    font-size: 4rem;
    font-weight: 900;
    color: var(--text-main);
    margin-bottom: 10px;
    letter-spacing: 5px;
    text-transform: uppercase;
}

/* 内页标题（原来是内联样式，这里统一成类） */
.page-title {
    font-size: 2.5rem;
    letter-spacing: 2px;
}

h2 {
    font-size: 1.2rem;
    color: var(--text-main);
    margin-bottom: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    text-transform: uppercase;
    letter-spacing: 2px;
}
h2::before {
    content: "";
    display: inline-block;
    width: 12px;
    height: 12px;
    background: var(--accent);
    margin-right: 15px;
    border-radius: 2px;
    flex-shrink: 0;
}

p {
    color: var(--text-dim);
    margin-bottom: 20px;
    font-size: 1rem;
    max-width: 700px;
}

ul {
    list-style: none;
    margin-bottom: 30px;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
}
li {
    position: relative;
    padding: 15px 20px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-dim);
    font-size: 0.95rem;
    transition: 0.3s;
}
li:hover {
    border-color: var(--text-main);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.03);
}

strong {
    color: var(--text-main);
    font-weight: 700;
    display: block;
    margin-bottom: 5px;
    font-size: 1.1rem;
}

.highlight {
    color: #d32f2f;
    font-weight: 700;
    background: rgba(211, 47, 47, 0.1);
    padding: 2px 6px;
    border-radius: 3px;
}

/* ---------- 5. 首页 ---------- */
.hero-section {
    position: relative;
    height: 60vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    overflow: hidden;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 50px;
}

.hero-title {
    font-size: 7rem;
    font-weight: 900;
    color: var(--text-main);
    z-index: 10;
    letter-spacing: 20px;
    line-height: 1;
}

.hero-subtitle {
    z-index: 10;
    color: var(--text-main);
    font-size: 1.2rem;
    margin-top: 20px;
    letter-spacing: 2px;
    font-weight: 600;
    border-right: 3px solid var(--text-main);
    padding-right: 5px;
    animation: blink 1s step-end infinite;
    overflow: hidden;
    display: inline-block;
    min-height: 1.5em;
}

@keyframes blink { 50% { border-color: transparent; } }

.hero-btns {
    display: flex;
    gap: 20px;
    z-index: 10;
    margin-top: 40px;
    flex-wrap: wrap;
}

.cta-btn {
    display: inline-block;
    padding: 15px 40px;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    color: #fff;
    background-color: var(--accent);
    border: none;
    border-radius: 2px;
    text-decoration: none;
    text-align: center;
    transition: 0.3s;
    letter-spacing: 2px;
    text-transform: uppercase;
}
.cta-btn:hover {
    background-color: #333;
    transform: translateX(5px);
}

/* 鬼泣特殊按钮 */
.dmc-btn {
    background-color: #b31b1b; /* 鬼泣红 */
    display: none; /* 默认隐藏，等待解锁 */
    animation: slideIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.dmc-btn:hover {
    background-color: #e02222;
    box-shadow: 0 0 15px rgba(224, 34, 34, 0.5);
}
.dmc-btn.show { display: inline-block; }

#word-cloud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}
.floating-word {
    position: absolute;
    color: var(--text-main);
    opacity: 0.05;
    font-weight: 900;
    user-select: none;
    white-space: nowrap;
    font-family: monospace;
}

/* ---------- 6. 成员 / 群友的话 ---------- */
.members-container { margin-top: 60px; }

.member-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.member-card {
    border: 1px solid var(--border-color);
    padding: 20px 18px;
    background: #fff;
    transition: 0.3s;
    display: flex;
    align-items: center;
    gap: 14px;
}
.member-card:hover { border-color: var(--text-main); }

.member-avatar {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-color);
    background: var(--grid-color);
    transition: 0.3s;
    position: relative;
    overflow: hidden;
}
.member-card:hover .member-avatar { border-color: var(--text-main); }

.member-info { min-width: 0; flex: 1; }
.member-role {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.member-name {
    font-size: 1.2rem;
    color: var(--text-main);
    font-weight: 700;
    line-height: 1.3;
}

.chat-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 800px;
    margin-top: 30px;
}

.chat-box {
    background: #fff;
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--text-main);
    padding: 20px 25px;
    position: relative;
    transition: 0.3s;
}
.chat-box:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.04);
    transform: translateX(5px);
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.8rem;
    color: var(--text-dim);
    font-family: monospace;
    gap: 10px;
}
.chat-user {
    font-weight: 700;
    color: var(--text-main);
    font-size: 0.95rem;
}
.chat-tag {
    border: 1px solid var(--border-color);
    padding: 2px 6px;
    border-radius: 3px;
    white-space: nowrap;
}
.chat-content {
    font-size: 0.95rem;
    color: var(--text-main);
    line-height: 1.8;
}

.chat-image {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin-top: 15px;
    border: 1px solid var(--border-color);
    display: block;
}

.easter-egg {
    display: none;
    background: #fdfdfd;
    border-left-color: var(--afdian-color);
    animation: slideIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.easter-egg .chat-user { color: var(--afdian-color); }
.easter-egg.show { display: block; }

/* ---------- 7. 发电 / 加入 ---------- */
.join-btn {
    display: block;
    width: 100%;
    max-width: 600px;
    padding: 25px;
    margin-top: 20px;
    background: #fff;
    color: var(--text-main);
    border: 2px solid var(--border-color);
    border-radius: 4px;
    text-align: left;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}
.join-btn:hover {
    border-color: var(--text-main);
    background: var(--text-main);
    color: #fff;
}
.join-btn:hover strong { color: #fff; }
.join-btn:hover span { color: #ccc; }
.join-btn strong {
    color: var(--text-main);
    font-size: 1.3rem;
    display: block;
    margin-bottom: 5px;
    transition: 0.3s;
}
.join-btn span {
    font-size: 0.9rem;
    color: var(--text-dim);
    transition: 0.3s;
}

.tag {
    display: inline-block;
    padding: 2px 8px;
    border: 1px solid var(--text-dim);
    border-radius: 4px;
    font-size: 0.75rem;
    margin-left: 10px;
}

.support-card {
    max-width: 600px;
    background: #fff;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    margin-top: 30px;
    transition: 0.3s;
    position: relative;
    overflow: hidden;
}
.support-card:hover {
    border-color: var(--afdian-color);
    box-shadow: 0 10px 30px rgba(148, 108, 230, 0.1);
}
.support-icon { font-size: 3rem; margin-bottom: 15px; }
.support-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 10px;
}
.support-desc {
    font-size: 0.95rem;
    color: var(--text-dim);
    margin-bottom: 30px;
    line-height: 1.8;
}
.afdian-btn {
    display: inline-block;
    padding: 15px 40px;
    background-color: var(--afdian-color);
    color: #fff;
    font-size: 1.1rem;
    font-weight: bold;
    text-decoration: none;
    border-radius: 4px;
    transition: 0.3s;
    letter-spacing: 1px;
}
.afdian-btn:hover {
    background-color: #7b55c7;
    box-shadow: 0 5px 15px rgba(148, 108, 230, 0.4);
    transform: translateY(-2px);
}

/* ---------- 8. 页脚 ---------- */
footer {
    width: 100%;
    max-width: 1000px;
    padding: 30px 20px;
    border-top: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: var(--text-dim);
    text-align: center;
    letter-spacing: 1px;
    z-index: 10;
}

/* ---------- 9. 移动端适配 ---------- */
@media screen and (max-width: 768px) {
    /* 导航改成横向滚动，不再折成三行占半屏 */
    .nav-bar {
        padding: 12px 16px;
        gap: 0 22px;
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }
    .nav-bar::-webkit-scrollbar { display: none; }
    .nav-item { font-size: 0.8rem; }

    .container { padding: 0 15px 80px; }

    .hero-section {
        height: auto;
        min-height: 50vh;
        padding: 60px 0 40px;
        margin-bottom: 30px;
    }
    .hero-title { font-size: 3.5rem; letter-spacing: 8px; }
    .hero-subtitle { font-size: 0.9rem; white-space: normal; }

    .hero-btns { margin-top: 25px; gap: 15px; width: 100%; }
    .cta-btn { flex: 1; padding: 12px 15px; font-size: 0.85rem; }

    .page-title { font-size: 1.8rem; }
    p { font-size: 0.9rem; }
    ul, .member-grid { grid-template-columns: 1fr; }
    .member-card, li { padding: 15px; }
    .chat-box { padding: 15px; }
    .chat-header { margin-bottom: 15px; }
    .chat-content { font-size: 0.9rem; }
    .join-btn { padding: 20px; }
    .join-btn strong { font-size: 1.1rem; }
    .support-card { padding: 30px 15px; }
}

/* ---------- 10. 减少动效 ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
    #canvas-layer, #word-cloud { display: none; }
}
