/* ============================================
   慕阳的个人网站 - 主样式表
   版本: 3.0
   ============================================ */

:root {
    --c-bg: #08080f;
    --c-bg-elevated: #12121a;
    --c-bg-card: rgba(255, 255, 255, 0.025);
    --c-bg-card-hover: rgba(255, 255, 255, 0.05);
    --c-accent: #818cf8;
    --c-accent-2: #06b6d4;
    --c-accent-3: #a78bfa;
    --c-accent-glow: rgba(129, 140, 248, 0.25);
    --c-text: #f1f5f9;
    --c-text-2: #94a3b8;
    --c-text-3: #64748b;
    --c-border: rgba(255, 255, 255, 0.06);
    --c-border-hover: rgba(255, 255, 255, 0.12);
    --c-glass: rgba(18, 18, 26, 0.7);
    --font: 'Inter', 'PingFang SC', 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Inter', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
    --shadow: 0 4px 24px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.5);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-spring: cubic-bezier(0.22, 1.2, 0.36, 1);
}

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

html {
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: var(--c-text);
    background: var(--c-bg);
    line-height: 1.75;
    font-size: 16px;
    min-width: 320px;
    overflow-x: hidden;
}

::selection {
    background: rgba(129, 140, 248, 0.4);
    color: #fff;
}

/* ============================================
   加载动画
   ============================================ */
.loader {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: var(--c-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}
.loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.loader-content {
    text-align: center;
}
.loader-logo {
    font-family: var(--font-display);
    font-size: 36px;
    font-weight: 700;
    letter-spacing: 0.08em;
    background: linear-gradient(135deg, var(--c-accent), var(--c-accent-2), var(--c-accent-3));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 28px;
    animation: loaderPulse 2s ease-in-out infinite;
}
@keyframes loaderPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}
.loader-track {
    width: 180px;
    height: 3px;
    background: rgba(255,255,255,0.08);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin: 0 auto 16px;
}
.loader-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--c-accent), var(--c-accent-2));
    border-radius: var(--radius-full);
    box-shadow: 0 0 12px var(--c-accent-glow);
    transition: width 0.3s ease;
}
.loader-text {
    font-size: 13px;
    color: var(--c-text-3);
    letter-spacing: 0.12em;
}

/* ============================================
   背景
   ============================================ */
.background {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}
.background canvas {
    width: 100%;
    height: 140%;
}
.background .cover {
    position: absolute;
    bottom: -42%;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(0deg, var(--c-bg) 30%, transparent);
}
.background::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cdefs%3E%3Cpattern id='g' width='60' height='60' patternUnits='userSpaceOnUse'%3E%3Ccircle cx='30' cy='30' r='1' fill='rgba(255,255,255,0.03)'/%3E%3C/pattern%3E%3C/defs%3E%3Crect width='100%25' height='100%25' fill='url(%23g)'/%3E%3C/svg%3E");
    opacity: 0.6;
    z-index: 2;
}
#startrack {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 140%;
}

/* ============================================
   导航
   ============================================ */
.main-nav {
    position: fixed;
    left: 24px;
    bottom: 24px;
    z-index: 2333;
    transform: rotate(-90deg) translateZ(0);
    transform-origin: 0 0;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 22px;
    background: var(--c-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-full);
    border: 1px solid var(--c-border);
    box-shadow: 0 4px 24px rgba(0,0,0,0.3);
    transition: border-color 0.3s ease;
}
.main-nav:hover {
    border-color: var(--c-border-hover);
}
.main-nav a {
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 500;
    color: var(--c-text-2);
    text-decoration: none;
    white-space: nowrap;
    letter-spacing: 0.06em;
    transition: all 0.3s ease;
    position: relative;
}
.main-nav a::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 0;
    height: 1.5px;
    background: linear-gradient(90deg, var(--c-accent), var(--c-accent-2));
    border-radius: var(--radius-full);
    transition: width 0.3s var(--ease-out);
}
.main-nav a:hover,
.main-nav a.active {
    color: var(--c-text);
}
.main-nav a:hover::after,
.main-nav a.active::after {
    width: 100%;
}
.main-nav a.active {
    color: var(--c-accent);
    text-shadow: 0 0 12px var(--c-accent-glow);
}
.nav-separator {
    width: 3px;
    height: 3px;
    background: var(--c-text-3);
    border-radius: 50%;
    flex-shrink: 0;
}

/* ============================================
   主内容
   ============================================ */
.main {
    position: relative;
    z-index: 1;
}
.container {
    width: min(1000px, 90%);
    margin: 0 auto;
}
.ch {
    width: 100%;
    padding: 100px 0;
}

.chtitle {
    padding-bottom: 40px;
    font-size: clamp(24px, 4vw, 30px);
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--c-text-2);
    position: relative;
}
.chtitle span {
    background: linear-gradient(135deg, var(--c-accent), var(--c-accent-2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.chtitle::after {
    content: "";
    display: block;
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, var(--c-accent), transparent);
    margin-top: 18px;
    border-radius: var(--radius-full);
}

/* ============================================
   Hero
   ============================================ */
.intro {
    min-height: 100vh;
    display: flex;
    align-items: center;
}
.hello {
    text-align: center;
    animation: fadeUp 1s var(--ease-out) both;
}
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(40px); }
    to   { opacity: 1; transform: translateY(0); }
}
.hello h1 {
    font-size: clamp(16px, 3vw, 20px);
    font-weight: 400;
    margin-bottom: 28px;
    letter-spacing: 0.06em;
    color: var(--c-text-2);
}
.hello h1 p { display: inline; }
.hello h2 {
    font-size: clamp(32px, 7vw, 52px);
    font-weight: 800;
    letter-spacing: 0.04em;
    background: linear-gradient(135deg, #fff 20%, var(--c-accent) 50%, var(--c-accent-2) 80%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 4s ease infinite;
}
@keyframes gradientShift {
    0%, 100% { background-position: 0% center; }
    50% { background-position: 100% center; }
}

/* 指示器 */
.status-indicator {
    display: flex;
    gap: 8px;
}
.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(0,0,0,0.3);
}
.dot-red    { background: #ff5f56; box-shadow: 0 0 10px rgba(255,95,86,0.4); }
.dot-yellow { background: #ffbd2e; box-shadow: 0 0 10px rgba(255,189,46,0.4); }
.dot-green  { background: #27c93f; box-shadow: 0 0 10px rgba(39,201,63,0.4); }

/* ============================================
   About
   ============================================ */
.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
}
.introduct {
    text-align: center;
}
.avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    margin-bottom: 28px;
    object-fit: cover;
    box-shadow:
        0 0 0 3px rgba(129,140,248,0.25),
        0 0 40px rgba(129,140,248,0.12),
        0 8px 32px rgba(0,0,0,0.4);
    transition: all 0.5s var(--ease-bounce);
}
.avatar:hover {
    transform: scale(1.06);
    box-shadow:
        0 0 0 4px rgba(129,140,248,0.5),
        0 0 60px rgba(129,140,248,0.25),
        0 12px 48px rgba(0,0,0,0.5);
}
.tagline {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--c-accent-2), var(--c-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.greeting {
    color: var(--c-text-3);
    font-style: italic;
    margin-bottom: 20px;
}
.introduct p {
    margin-bottom: 14px;
    color: rgba(241,245,249,0.75);
    line-height: 1.9;
    font-size: 15px;
}
.introduct sup {
    font-size: 0.6em;
    color: var(--c-accent);
}

/* Roll 按钮 */
.roll-button-wrapper {
    margin: 32px 0 8px;
}
.roll-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 32px;
    background: rgba(129,140,248,0.1);
    border: 1px solid rgba(129,140,248,0.2);
    border-radius: var(--radius-full);
    color: var(--c-text);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all 0.4s var(--ease-bounce);
    box-shadow: 0 0 24px rgba(129,140,248,0.08);
    position: relative;
    overflow: hidden;
}
.roll-button::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(129,140,248,0.15), transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
}
.roll-button:hover {
    transform: translateY(-3px);
    border-color: rgba(129,140,248,0.5);
    box-shadow: 0 8px 36px rgba(129,140,248,0.25);
}
.roll-button:hover::before { opacity: 1; }
.roll-button:active {
    transform: translateY(0) scale(0.97);
}
.roll-description {
    display: block;
    margin-top: 10px;
    color: var(--c-text-3);
    font-size: 13px;
}

/* Roll 标签 */
.roll-tag {
    display: none;
    min-height: 52px;
    margin: 16px 0;
}
.roll-tag.active { display: block; }
.roll-tag span {
    display: inline-block;
    padding: 10px 24px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-full);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: tagPop 0.45s var(--ease-bounce);
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}
.roll-tag span::before {
    content: '#';
    margin-right: 6px;
    color: var(--c-accent-2);
    font-weight: 700;
}
@keyframes tagPop {
    from { transform: scale(0.8); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

/* ============================================
   技能
   ============================================ */
.skills-section {
    background: var(--c-bg-card);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    padding: 36px 32px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: border-color 0.3s ease;
}
.skills-section:hover {
    border-color: var(--c-border-hover);
}
.skills-section .chtitle {
    font-size: 20px;
    padding-bottom: 24px;
    margin-bottom: 4px;
}
.skills-section .chtitle::after {
    width: 36px;
    height: 2px;
    margin-top: 12px;
}
.skill-list { list-style: none; }
.skill-item {
    margin-bottom: 24px;
}
.skill-item:last-child { margin-bottom: 0; }
.skill-name {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.03em;
}
.skill-name::after {
    content: attr(data-value);
    font-size: 12px;
    color: var(--c-text-3);
    font-weight: 500;
}
.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255,255,255,0.06);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 4px;
}
.progress-fill {
    height: 100%;
    border-radius: var(--radius-full);
    position: relative;
    transition: width 1.5s var(--ease-out);
}
.progress-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.25) 50%, transparent 100%);
    animation: shimmer 2.5s infinite;
}
.skill-item:nth-child(1) .progress-fill {
    background: linear-gradient(90deg, #818cf8, #6366f1);
    box-shadow: 0 0 12px rgba(99,102,241,0.3);
}
.skill-item:nth-child(2) .progress-fill {
    background: linear-gradient(90deg, #06b6d4, #22d3ee);
    box-shadow: 0 0 12px rgba(6,182,212,0.3);
}
.skill-item:nth-child(3) .progress-fill {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
    box-shadow: 0 0 12px rgba(245,158,11,0.3);
}
.skill-item:nth-child(4) .progress-fill {
    background: linear-gradient(90deg, #a78bfa, #c084fc);
    box-shadow: 0 0 12px rgba(167,139,250,0.3);
}
@keyframes shimmer {
    from { transform: translateX(-100%); }
    to   { transform: translateX(100%); }
}
.skill-desc {
    font-size: 12px;
    color: var(--c-text-3);
    display: block;
    margin-top: 2px;
}

/* ============================================
   链接卡片
   ============================================ */
.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 48px;
}
.link-card {
    display: block;
    text-decoration: none;
    color: var(--c-text);
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    transition: transform 0.4s var(--ease-bounce), box-shadow 0.4s ease;
    box-shadow: var(--shadow-sm);
}
.link-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg), 0 0 40px rgba(129,140,248,0.1);
}
.link-card-inner {
    padding: 48px 24px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
    background-color: var(--bg-color, #333);
    color: var(--text-color, #fff);
}
.link-card-inner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.08), transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
}
.link-card-inner::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--c-accent-glow), transparent 60%);
    opacity: 0;
    transition: opacity 0.4s ease;
}
.link-card:hover .link-card-inner::before,
.link-card:hover .link-card-inner::after {
    opacity: 1;
}
.link-title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.04em;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* 社交链接 */
.social-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
}
.social-card {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px 16px;
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--c-text);
    font-weight: 600;
    letter-spacing: 0.03em;
    position: relative;
    overflow: hidden;
    transition: all 0.4s var(--ease-bounce);
    box-shadow: var(--shadow-sm);
    background-color: var(--bg-color, #333);
}
.social-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.08), transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
}
.social-card::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: calc(var(--radius) + 1px);
    padding: 1px;
    background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
}
.social-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}
.social-card:hover::before { opacity: 1; }
.social-card:hover::after { opacity: 1; }
.social-card i {
    font-size: 22px;
    transition: transform 0.35s var(--ease-bounce);
}
.social-card:hover i {
    transform: scale(1.2);
}

/* ============================================
   友链信息
   ============================================ */
.friend-info {
    background: var(--c-bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--c-border);
    padding: 36px 32px;
    border-radius: var(--radius);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.friend-info:hover {
    border-color: var(--c-border-hover);
    box-shadow: 0 0 32px rgba(129,140,248,0.06);
}
.friend-info-list {
    list-style: none;
}
.friend-info-list li {
    margin-bottom: 16px;
    font-size: 15px;
    display: flex;
    align-items: baseline;
    gap: 12px;
    word-break: break-all;
}
.friend-info-list li:last-child { margin-bottom: 0; }
.info-label {
    color: var(--c-accent-2);
    font-weight: 600;
    flex-shrink: 0;
    font-size: 13px;
}

/* ============================================
   底部
   ============================================ */
.footer {
    text-align: center;
    padding: 72px 0 48px;
    position: relative;
    background: linear-gradient(180deg, transparent, rgba(0,0,0,0.4));
}
.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
}
.footer h3 {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 18px;
    letter-spacing: 0.06em;
    background: linear-gradient(135deg, #fff, var(--c-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.copyright {
    color: var(--c-text-2);
    margin-bottom: 8px;
    font-size: 14px;
}
.runtime {
    color: var(--c-accent-2);
    font-weight: 700;
}
.slogan {
    font-style: italic;
    color: var(--c-text-3);
    font-size: 14px;
    margin-bottom: 8px;
}

/* ICP / 备案 */
.footer-icp {
    margin-top: 24px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}
.icp-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--c-text-3);
    font-size: 13px;
    text-decoration: none;
    transition: color 0.3s ease;
}
.icp-link:hover { color: var(--c-text-2); }
.icp-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    opacity: 0.55;
    transition: opacity 0.3s ease;
}
.icp-link:hover .icp-icon { opacity: 0.85; }
.icp-separator {
    color: var(--c-text-3);
    opacity: 0.25;
    font-size: 13px;
    user-select: none;
}

/* ============================================
   滚动显示动画
   ============================================ */
.reveal {
    opacity: 0;
    transform: translateY(36px);
    transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ============================================
   工具类
   ============================================ */
.clear::after {
    content: "";
    display: block;
    height: 0;
    visibility: hidden;
    clear: both;
}

/* ============================================
   响应式
   ============================================ */
@media screen and (max-width: 768px) {
    .main-nav {
        left: 8px;
        bottom: 8px;
        padding: 8px 14px;
        gap: 10px;
    }
    .main-nav a { font-size: 10px; }
    .ch { padding: 60px 0; }
    .chtitle { padding-bottom: 24px; }
    .about-content { grid-template-columns: 1fr; gap: 36px; }
    .links-grid { grid-template-columns: 1fr; }
    .social-links { grid-template-columns: repeat(2, 1fr); }
    .skills-section { padding: 28px 20px; }
    .friend-info { padding: 24px 20px; }
    .friend-info-list li { font-size: 14px; flex-direction: column; gap: 2px; }
    .hello h2 { font-size: clamp(28px, 8vw, 40px); }
    .loader-logo { font-size: 28px; }
}

@media screen and (max-width: 480px) {
    .social-links { grid-template-columns: 1fr; }
    .avatar { width: 120px; height: 120px; }
    .link-card-inner { padding: 36px 18px; }
    .footer { padding: 48px 0 32px; }
    .footer h3 { font-size: 20px; }
    .skills-section { padding: 24px 16px; }
    .roll-button { padding: 10px 24px; font-size: 14px; }
}

@media screen and (min-width: 1400px) {
    .container { width: 80%; max-width: 1200px; }
    .links-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ============================================
   打印
   ============================================ */
@media print {
    .main-nav, .background, .loader { display: none !important; }
    body { background: #fff; color: #000; }
    .ch { animation: none; }
}

/* ============================================
   无障碍
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .loader { display: none !important; }
}

@media (prefers-contrast: high) {
    :root {
        --c-text-2: #ccc;
        --c-text-3: #bbb;
    }
    .progress-bar { border: 1px solid #fff; }
}
