/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    transition: color 0.3s;
}

/* 夜间模式样式 */
body.dark-mode {
    color: #dfe6e9;
}

/* 容器 */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header wrapper */
.header-wrapper {
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.page-header {
    padding: 70px 0 50px;
    text-align: center;
    transition: transform 0.1s linear, opacity 0.1s linear;
    will-change: transform, opacity;
}

.page-title {
    font-size: 2.4rem;
    font-weight: 800;
    margin-bottom: 12px;
    color: #000000;
}

.typing-container { 
    display: flex; 
    justify-content: center; 
}

.typing-text {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.05rem;
    color: #000000;
    white-space: nowrap;
    overflow: hidden;
    border-right: 3px solid #5e72e4;
    width: 0;
    animation: 
        typing 3s steps(34, end) forwards, 
        blink 0.75s step-end infinite;
}

@keyframes typing { from { width: 0; } to { width: 34ch; } }
@keyframes blink { from, to { border-color: transparent; } 50% { border-color: #5e72e4; } }

/* 呼吸跳动动画 */
@keyframes breathe {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0.33px 0 rgba(0, 0, 0, 0.09),
                    0 0 0 0.25px rgba(0, 0, 0, 0.16),
                    0 2px 8px rgba(0, 0, 0, 0.03),
                    0 8px 50px rgba(0, 0, 0, 0.08),
                    0 1px 3px rgba(0, 0, 0, 0.04),
                    inset 0 0.5px 0 rgba(255, 255, 255, 0.9);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 0.33px 0 rgba(0, 0, 0, 0.09),
                    0 0 0 0.25px rgba(0, 0, 0, 0.16),
                    0 4px 12px rgba(0, 0, 0, 0.05),
                    0 12px 60px rgba(0, 0, 0, 0.12),
                    0 2px 6px rgba(0, 0, 0, 0.06),
                    inset 0 0.5px 0 rgba(255, 255, 255, 0.95);
    }
}

/* 夜间模式呼吸跳动 */
@keyframes breatheDark {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0.33px 0 rgba(255, 255, 255, 0.06),
                    0 0 0 0.25px rgba(255, 255, 255, 0.12),
                    0 2px 8px rgba(0, 0, 0, 0.08),
                    0 8px 50px rgba(0, 0, 0, 0.35),
                    0 1px 3px rgba(0, 0, 0, 0.15),
                    inset 0 0.5px 0 rgba(255, 255, 255, 0.08);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 0.33px 0 rgba(255, 255, 255, 0.06),
                    0 0 0 0.25px rgba(255, 255, 255, 0.12),
                    0 4px 12px rgba(0, 0, 0, 0.12),
                    0 12px 60px rgba(0, 0, 0, 0.45),
                    0 2px 6px rgba(0, 0, 0, 0.2),
                    inset 0 0.5px 0 rgba(255, 255, 255, 0.12);
    }
}

/* 通用呼吸跳动类 - 适用于所有内容卡片 */
.breathe-animation {
    animation: breathe 4s ease-in-out infinite;
}

/* 夜间模式呼吸跳动 */
body.dark-mode .breathe-animation, html.dark-mode .breathe-animation {
    animation: breatheDark 4s ease-in-out infinite;
}

/* 友链列表 */
.link-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

/* 友链项 */
.link-item {
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.75) 0%,
        rgba(255, 255, 255, 0.62) 100%
    );
    backdrop-filter: blur(50px) saturate(190%) contrast(1.05);
    -webkit-backdrop-filter: blur(50px) saturate(190%) contrast(1.05);
    box-shadow: 0 0.33px 0 rgba(0, 0, 0, 0.09),
                0 0 0 0.25px rgba(0, 0, 0, 0.16),
                0 2px 8px rgba(0, 0, 0, 0.03),
                0 10px 50px rgba(0, 0, 0, 0.08),
                0 1px 3px rgba(0, 0, 0, 0.04),
                inset 0 0.5px 0 rgba(255, 255, 255, 0.9);
    border: 0.5px solid rgba(0, 0, 0, 0.06);
    padding: 30px;
    border-radius: 24px;
    margin-bottom: 30px;
    transition: transform 0.6s cubic-bezier(0.25, 0.1, 0.25, 1),
                background 0.6s cubic-bezier(0.25, 0.1, 0.25, 1),
                box-shadow 0.6s cubic-bezier(0.25, 0.1, 0.25, 1),
                border-color 0.6s cubic-bezier(0.25, 0.1, 0.25, 1);
    will-change: transform, box-shadow;
    transform-style: preserve-3d;
    backface-visibility: hidden;
    display: block;
    text-decoration: none;
}

.link-item:hover {
    transform: translateY(-6px) translateZ(0);
    box-shadow: 0 0.33px 0 rgba(0, 0, 0, 0.09),
                0 0 0 0.25px rgba(0, 0, 0, 0.16),
                0 2px 8px rgba(0, 0, 0, 0.03),
                0 16px 65px rgba(0, 0, 0, 0.12),
                0 4px 12px rgba(0, 0, 0, 0.06),
                inset 0 0.5px 0 rgba(255, 255, 255, 0.95);
}

/* 友链信息 */
.link-info {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.link-logo {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    margin-right: 15px;
}

.link-logo-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    color: #636e72;
}

.link-details {
    flex: 1;
}

.link-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    color: #2d3436;
}

.link-description {
    font-size: 0.9rem;
    color: #636e72;
    margin: 5px 0 0 0;
}

/* 无友链提示 */
.no-links {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #95a5a6;
    background: #f8f9fa;
    border-radius: 8px;
}

/* 友链申请卡片 */
.link-apply-card {
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.75) 0%,
        rgba(255, 255, 255, 0.62) 100%
    );
    backdrop-filter: blur(50px) saturate(190%) contrast(1.05);
    -webkit-backdrop-filter: blur(50px) saturate(190%) contrast(1.05);
    box-shadow: 0 0.33px 0 rgba(0, 0, 0, 0.09),
                0 0 0 0.25px rgba(0, 0, 0, 0.16),
                0 2px 8px rgba(0, 0, 0, 0.03),
                0 10px 50px rgba(0, 0, 0, 0.08),
                0 1px 3px rgba(0, 0, 0, 0.04),
                inset 0 0.5px 0 rgba(255, 255, 255, 0.9);
    border: 0.5px solid rgba(0, 0, 0, 0.06);
    padding: 30px;
    border-radius: 24px;
    margin-top: 40px;
    transition: transform 0.6s cubic-bezier(0.25, 0.1, 0.25, 1),
                background 0.6s cubic-bezier(0.25, 0.1, 0.25, 1),
                box-shadow 0.6s cubic-bezier(0.25, 0.1, 0.25, 1),
                border-color 0.6s cubic-bezier(0.25, 0.1, 0.25, 1);
    will-change: transform, box-shadow;
    transform-style: preserve-3d;
    backface-visibility: hidden;
}

.link-apply-card h2 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: #2d3436;
}

.apply-intro {
    margin-bottom: 15px;
    color: #636e72;
}

/* 消息提示 */
.message {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.message.success {
    background: #d4edda;
    color: #155724;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
}

/* 友链申请表单样式 */
.link-apply-form {
    margin-top: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2d3436;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #dfe6e9;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #3498db;
}

.form-text {
    font-size: 0.85rem;
    color: #636e72;
    margin-top: 5px;
}

.btn-submit {
    background: #dfe6e9;
    color: #2d3436;
    border: 1px solid #dfe6e9;
    padding: 12px 30px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s, color 0.3s;
    font-size: 1rem;
}

.btn-submit:hover {
    background: #b2bec3;
}

/* 页脚 */
footer {
    text-align: center;
    padding: 40px 0;
    color: #b2bec3;
    border-top: 1px solid #eee;
    transition: border-top 0.3s, color 0.3s;
}

footer a {
    color: #b2bec3;
    text-decoration: none;
}

/* 深色模式 - Header */
body.dark-mode .page-title {
    color: #ffffff;
}

body.dark-mode .typing-text {
    color: #ffffff;
}

/* 夜间模式样式 */
body.dark-mode .link-item {
    background: linear-gradient(
        180deg,
        rgba(28, 28, 28, 0.75) 0%,
        rgba(18, 18, 18, 0.62) 100%
    );
    box-shadow: 0 0.33px 0 rgba(255, 255, 255, 0.07),
                0 0 0 0.25px rgba(255, 255, 255, 0.12),
                0 2px 8px rgba(0, 0, 0, 0.08),
                0 10px 50px rgba(0, 0, 0, 0.35),
                0 1px 3px rgba(0, 0, 0, 0.15),
                inset 0 0.5px 0 rgba(255, 255, 255, 0.08);
    border: 0.5px solid rgba(255, 255, 255, 0.08);
}

body.dark-mode .link-apply-card {
    background: linear-gradient(
        180deg,
        rgba(28, 28, 28, 0.75) 0%,
        rgba(18, 18, 18, 0.62) 100%
    );
    box-shadow: 0 0.33px 0 rgba(255, 255, 255, 0.07),
                0 0 0 0.25px rgba(255, 255, 255, 0.12),
                0 2px 8px rgba(0, 0, 0, 0.08),
                0 10px 50px rgba(0, 0, 0, 0.35),
                0 1px 3px rgba(0, 0, 0, 0.15),
                inset 0 0.5px 0 rgba(255, 255, 255, 0.08);
    border: 0.5px solid rgba(255, 255, 255, 0.08);
}

body.dark-mode .link-apply-card h2 {
    color: #dfe6e9;
}

body.dark-mode .link-name {
    color: #dfe6e9 !important;
}

body.dark-mode .link-description {
    color: #b2bec3 !important;
}

body.dark-mode .link-logo-placeholder {
    background: #2d3436 !important;
    color: #b2bec3 !important;
}

body.dark-mode .no-links {
    background: #2d3436 !important;
    color: #b2bec3 !important;
}

body.dark-mode .apply-intro {
    color: #b2bec3 !important;
}

/* 深色模式 - 表单元素 */
body.dark-mode .form-group label {
    color: #dfe6e9 !important;
}

body.dark-mode .form-control {
    background: #2d3436;
    border-color: #34495e;
    color: #dfe6e9;
}

body.dark-mode .form-control::placeholder {
    color: #636e72;
}

body.dark-mode .form-control:focus {
    border-color: #3498db;
}

body.dark-mode .form-text {
    color: #b2bec3;
}

/* 深色模式 - 提交按钮 */
body.dark-mode .btn-submit {
    background: #2d3436;
    color: #636e72;
    border-color: #636e72;
}

body.dark-mode .btn-submit:hover {
    background: #34495e;
}

/* 夜间模式页脚 */
body.dark-mode footer {
    color: #636e72;
    border-top: 1px solid #2d3436;
}

body.dark-mode footer a {
    color: #636e72;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .link-list {
        grid-template-columns: 1fr;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .link-item {
        padding: 15px;
    }
    
    .link-apply-card {
        padding: 15px;
    }
    
    .btn-submit {
        width: 100%;
    }
}