/**
 * 鸿蒙风格个人主页系统 - 前台样式
 * HarmonyOS Design Style
 */

/* ===== 基础变量 ===== */
:root {
    --primary-color: #3B82F6;
    --primary-gradient: linear-gradient(135deg, #3B82F6 0%, #60A5FA 100%);
    --secondary-color: #8B5CF6;
    --accent-color: #F59E0B;
    
    --bg-gradient-start: #667eea;
    --bg-gradient-end: #764ba2;
    
    --glass-bg: rgba(255, 255, 255, 0.25);
    --glass-bg-hover: rgba(255, 255, 255, 0.35);
    --glass-border: rgba(255, 255, 255, 0.3);
    --glass-border-hover: rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    --glass-shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.15);
    
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    
    --border-radius-sm: 12px;
    --border-radius-md: 20px;
    --border-radius-lg: 24px;
    --border-radius-xl: 32px;
    
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    --container-max-width: 800px;
    --section-gap: 40px;
}

/* ===== 重置样式 ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition-fast);
}

img {
    max-width: 100%;
    height: auto;
}

/* ===== 背景装饰 ===== */
.bg-decoration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.bg-circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 20s infinite ease-in-out;
}

.bg-circle-1 {
    width: 600px;
    height: 600px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    top: -200px;
    right: -100px;
    animation-delay: 0s;
}

.bg-circle-2 {
    width: 500px;
    height: 500px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    bottom: -150px;
    left: -100px;
    animation-delay: -5s;
}

.bg-circle-3 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -10s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(30px, -30px) scale(1.05);
    }
    50% {
        transform: translate(-20px, 20px) scale(0.95);
    }
    75% {
        transform: translate(-30px, -20px) scale(1.02);
    }
}

/* ===== 容器 ===== */
.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 60px 20px;
    position: relative;
    z-index: 1;
}

/* ===== 毛玻璃卡片 ===== */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--glass-shadow);
    transition: var(--transition-normal);
}

.glass-card:hover {
    background: var(--glass-bg-hover);
    border-color: var(--glass-border-hover);
    box-shadow: var(--glass-shadow-hover);
    transform: translateY(-4px);
}

/* ===== 个人资料区域 ===== */
.profile-section {
    margin-bottom: var(--section-gap);
}

.profile-card {
    padding: 48px 32px;
    text-align: center;
}

.avatar-wrapper {
    margin-bottom: 24px;
}

.avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    transition: var(--transition-normal);
}

.avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-gradient);
    color: white;
    font-size: 48px;
    font-weight: 600;
    margin: 0 auto;
}

.nickname {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.bio {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.8;
    max-width: 500px;
    margin: 0 auto;
}

/* ===== 链接导航区域 ===== */
.links-section {
    margin-bottom: var(--section-gap);
}

.links-card {
    padding: 24px;
}

.links-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
}

.link-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--border-radius-xl);
    transition: var(--transition-normal);
}

.link-item:hover {
    background: rgba(255, 255, 255, 0.6);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.link-emoji {
    font-size: 20px;
}

.link-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

/* ===== 区域标题 ===== */
.section-header {
    margin-bottom: 24px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.title-icon {
    font-size: 28px;
}

/* ===== 文章列表区域 ===== */
.articles-section {
    margin-bottom: var(--section-gap);
}

.articles-grid {
    display: grid;
    gap: 20px;
}

.article-card {
    overflow: hidden;
}

.article-cover {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.article-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-slow);
}

.article-card:hover .article-cover img {
    transform: scale(1.05);
}

.article-content {
    padding: 24px;
}

.article-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
    line-height: 1.4;
}

.article-title a {
    color: var(--text-primary);
}

.article-title a:hover {
    color: var(--primary-color);
}

.article-summary {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 16px;
}

.article-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-light);
}

.article-date::before {
    content: '📅 ';
}

.load-more {
    text-align: center;
    margin-top: 32px;
}

/* ===== 按钮 ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    transition: var(--transition-normal);
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

.btn-glass {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
}

.btn-glass:hover {
    background: rgba(255, 255, 255, 0.45);
    transform: translateY(-2px);
}

/* ===== 留言板区域 ===== */
.messages-section {
    margin-bottom: var(--section-gap);
}

.message-form-card {
    padding: 24px;
    margin-bottom: 20px;
}

.message-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.message-form .form-group {
    margin-bottom: 0;
}

.message-form input,
.message-form textarea {
    width: 100%;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--border-radius-md);
    font-size: 15px;
    transition: var(--transition-fast);
}

.message-form input:focus,
.message-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.7);
}

.message-form input::placeholder,
.message-form textarea::placeholder {
    color: var(--text-light);
}

.message-form textarea {
    resize: vertical;
    min-height: 100px;
    margin-bottom: 16px;
}

.messages-list {
    display: grid;
    gap: 16px;
}

.message-card {
    padding: 20px 24px;
}

.message-card:hover {
    transform: none;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.message-author {
    font-weight: 600;
    color: var(--text-primary);
}

.message-time {
    font-size: 13px;
    color: var(--text-light);
}

.message-content {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 15px;
}

/* ===== 空状态 ===== */
.empty-card {
    padding: 48px 32px;
    text-align: center;
    color: var(--text-light);
}

.empty-card:hover {
    transform: none;
}

/* ===== 页脚 ===== */
.site-footer {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

.site-footer p {
    margin-bottom: 8px;
}

.powered-by {
    font-size: 12px;
    opacity: 0.7;
}

/* ===== 响应式设计 ===== */
@media (max-width: 640px) {
    :root {
        --section-gap: 32px;
    }
    
    .container {
        padding: 40px 16px;
    }
    
    .profile-card {
        padding: 36px 24px;
    }
    
    .avatar {
        width: 100px;
        height: 100px;
    }
    
    .nickname {
        font-size: 26px;
    }
    
    .bio {
        font-size: 15px;
    }
    
    .links-grid {
        gap: 12px;
    }
    
    .link-item {
        padding: 10px 16px;
    }
    
    .section-title {
        font-size: 20px;
    }
    
    .article-content {
        padding: 20px;
    }
    
    .article-title {
        font-size: 18px;
    }
    
    .message-form .form-row {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 1024px) {
    .articles-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .article-card:first-child {
        grid-column: span 2;
    }
}

/* ===== 动画效果 ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.glass-card {
    animation: fadeInUp 0.6s ease forwards;
}

.profile-card {
    animation-delay: 0.1s;
}

.links-card {
    animation-delay: 0.2s;
}

.articles-section .glass-card {
    animation-delay: 0.3s;
}

.messages-section .glass-card {
    animation-delay: 0.4s;
}

/* ===== 滚动条美化 ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* ===== 选中文字样式 ===== */
::selection {
    background: var(--primary-color);
    color: white;
}
