/* 基础样式 */
:root {
    --primary-color: #0071e3;
    --primary-light: #4595e6;
    --primary-dark: #0051aa;
    --secondary-color: #f5f5f7;
    --text-primary: #1d1d1f;
    --text-secondary: #6e6e73;
    --text-tertiary: #86868b;
    --white: #ffffff;
    --gray-light: #f5f5f7;
    --gray-medium: #e8e8ed;
    --gray-dark: #d2d2d7;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-primary);
    background-color: var(--gray-light);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-dark);
}

h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
}

h2 {
    font-size: clamp(1.5rem, 3vw, 2.5rem);
}

h3 {
    font-size: clamp(1.25rem, 2vw, 1.75rem);
}

p {
    margin-bottom: 1rem;
}

ul, ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* 按钮样式 */
.btn-primary {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--white);
    padding: 10px 20px;
    border-radius: var(--radius-full);
    font-weight: 500;
    text-align: center;
    transition: all var(--transition-normal);
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.btn-secondary {
    display: inline-block;
    background-color: var(--white);
    color: var(--primary-color);
    padding: 10px 20px;
    border-radius: var(--radius-full);
    font-weight: 500;
    text-align: center;
    transition: all var(--transition-normal);
    border: 1px solid var(--primary-color);
    cursor: pointer;
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-sm);
}

.navbar.scrolled {
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow-md);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-primary);
    font-weight: 500;
    position: relative;
}

.nav-links a.active {
    color: var(--primary-color);
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 3px;
}

.community-link {
    display: flex;
    align-items: center;
    gap: 5px;
}

.community-link i {
    font-size: 0.8rem;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-primary);
}

.mobile-menu {
    display: none;
    flex-direction: column;
    padding: 1rem 20px;
    background-color: var(--white);
    box-shadow: var(--shadow-md);
    position: absolute;
    top: 70px;
    left: 0;
    width: 100%;
    gap: 1rem;
}

.mobile-menu a {
    color: var(--text-primary);
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--gray-medium);
}

.mobile-menu a:last-child {
    border-bottom: none;
}

/* 英雄区样式 */
.hero {
    padding: 150px 0 100px;
    position: relative;
    overflow: hidden;
    text-align: center;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f0f7ff 0%, #e6f0ff 100%);
    z-index: -1;
}

.hero h1 {
    margin-bottom: 1.5rem;
}

.highlight {
    color: var(--primary-color);
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto 2rem;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* 特色区域样式 */
.features {
    padding: 100px 0;
    background-color: var(--white);
}

.features h2 {
    text-align: center;
    margin-bottom: 2rem;
}

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

.feature-card {
    background-color: var(--gray-light);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-sm);
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-md);
}

.feature-icon {
    width: 60px;
    height: 60px;
    background-color: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto 1.5rem;
}

/* 可拖动卡片区域 */
.draggable-cards {
    padding: 100px 0;
    background-color: var(--gray-light);
}

.draggable-cards h2 {
    text-align: center;
    margin-bottom: 1rem;
}

.draggable-cards p {
    text-align: center;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto 3rem;
}

.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.draggable-card {
    background-color: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    cursor: move;
}

.draggable-card:hover {
    box-shadow: var(--shadow-md);
}

.draggable-card.dragging {
    opacity: 0.8;
    transform: scale(1.02);
    box-shadow: var(--shadow-lg);
}

.card-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.card-content {
    padding: 1.5rem;
}

.card-content h3 {
    margin-bottom: 0.5rem;
}

.card-meta {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.card-meta span {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    background-color: var(--gray-light);
    padding: 3px 10px;
    border-radius: var(--radius-full);
}

/* 文章区域样式 */
.articles-section {
    padding: 100px 0;
    background-color: var(--white);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.view-all {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
}

.masonry-grid {
    column-count: 1;
    column-gap: 2rem;
}

@media (min-width: 768px) {
    .masonry-grid {
        column-count: 2;
    }
}

@media (min-width: 1024px) {
    .masonry-grid {
        column-count: 3;
    }
}

.masonry-item {
    break-inside: avoid;
    margin-bottom: 2rem;
    background-color: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
}

.masonry-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.article-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.article-content {
    padding: 1.5rem;
}

.article-category {
    display: inline-block;
    font-size: 0.85rem;
    color: var(--primary-color);
    background-color: rgba(0, 113, 227, 0.1);
    padding: 3px 10px;
    border-radius: var(--radius-full);
    margin-bottom: 0.5rem;
}

.article-content h3 {
    margin-bottom: 0.5rem;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--text-tertiary);
}

/* 订阅区域 */
.subscribe {
    padding: 100px 0;
    background-color: var(--primary-color);
    color: var(--white);
    text-align: center;
}

.subscribe h2 {
    color: var(--white);
    margin-bottom: 1rem;
}

.subscribe p {
    max-width: 700px;
    margin: 0 auto 2rem;
    opacity: 0.9;
}

.subscribe-form {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    max-width: 600px;
    margin: 0 auto;
}

.subscribe-form input {
    flex: 1;
    min-width: 250px;
    padding: 12px 20px;
    border-radius: var(--radius-full);
    border: none;
    font-size: 1rem;
}

.subscribe-form button {
    white-space: nowrap;
}

/* 页脚样式 */
.footer {
    background-color: var(--text-primary);
    color: var(--white);
    padding: 50px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

@media (min-width: 768px) {
    .footer-content {
        grid-template-columns: 2fr 1fr 1fr 1fr;
    }
}

.footer-brand .logo {
    color: var(--white);
    margin-bottom: 1rem;
    display: inline-block;
}

.footer-brand p {
    color: var(--text-tertiary);
    margin-bottom: 1.5rem;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    color: var(--white);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
}

.social-links a:hover {
    background-color: var(--primary-color);
    transform: translateY(-3px);
}

.footer-links h4 {
    color: var(--white);
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

.footer-links ul {
    list-style: none;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.8rem;
}

.footer-links a {
    color: var(--text-tertiary);
    transition: all var(--transition-normal);
}

.footer-links a:hover {
    color: var(--white);
    padding-left: 5px;
}

.footer-bottom {
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.85rem;
}

/* 文章列表页样式 */
.articles-header {
    padding: 120px 0 50px;
    background-color: var(--white);
}

.articles-header h1 {
    margin-bottom: 1rem;
}

.articles-header p {
    color: var(--text-secondary);
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.articles-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.search-box {
    flex: 1;
    min-width: 300px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 12px 20px 12px 40px;
    border-radius: var(--radius-full);
    border: 1px solid var(--gray-dark);
    background-color: var(--gray-light);
    font-size: 1rem;
    transition: all var(--transition-normal);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: var(--white);
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.1);
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
}

.filter-dropdowns {
    display: flex;
    gap: 1rem;
}

.filter-dropdowns select {
    padding: 12px 30px 12px 20px;
    border-radius: var(--radius-full);
    border: 1px solid var(--gray-dark);
    background-color: var(--gray-light);
    font-size: 1rem;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236e6e73' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    transition: all var(--transition-normal);
}

.filter-dropdowns select:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: var(--white);
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.1);
}

.articles-list {
    padding: 50px 0;
    background-color: var(--gray-light);
}

.articles-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

@media (min-width: 768px) {
    .articles-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .articles-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.article-card {
    background-color: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.article-card-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.article-card-content {
    padding: 1.5rem;
}

.article-card-meta {
    margin-top: 1rem;
}

.author-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0.5rem;
}

.author-info img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
}

.article-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-tertiary);
}

.article-stats i {
    margin-right: 5px;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.page-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background-color: var(--white);
    color: var(--text-primary);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-btn:hover:not(.active):not(:disabled) {
    background-color: var(--gray-light);
}

.page-btn.active {
    background-color: var(--primary-color);
    color: var(--white);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 文章详情页样式 */
.article-detail {
    padding: 120px 0 50px;
    background-color: var(--white);
}

.article-header {
    max-width: 800px;
    margin: 0 auto 2rem;
}

.article-header h1 {
    margin-bottom: 1.5rem;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--gray-medium);
}

.author-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.author-info img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.author-name {
    font-weight: 600;
    display: block;
}

.author-title {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.publish-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    color: var(--text-secondary);
}

.publish-info i {
    margin-right: 5px;
}

.article-share {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.article-share a {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--gray-light);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
}

.article-share a:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

.article-image {
    max-width: 1000px;
    margin: 0 auto 3rem;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.article-image img {
    width: 100%;
    height: auto;
}

.image-caption {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    padding: 0.5rem 0;
}

.article-content {
    max-width: 800px;
    margin: 0 auto 3rem;
    font-size: 1.1rem;
}

.article-content h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.article-content h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.article-content p {
    margin-bottom: 1.5rem;
}

.article-content ul, 
.article-content ol {
    margin-bottom: 1.5rem;
}

.article-callout {
    background-color: rgba(0, 113, 227, 0.1);
    border-left: 4px solid var(--primary-color);
    padding: 1rem 1.5rem;
    margin: 2rem 0;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.article-callout i {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-top: 4px;
}

.article-tags {
    max-width: 800px;
    margin: 0 auto 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-medium);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.article-tags a {
    font-size: 0.85rem;
    color: var(--primary-color);
    background-color: rgba(0, 113, 227, 0.1);
    padding: 5px 12px;
    border-radius: var(--radius-full);
    transition: all var(--transition-normal);
}

.article-tags a:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

.author-profile {
    max-width: 800px;
    margin: 0 auto 3rem;
    padding: 2rem;
    background-color: var(--gray-light);
    border-radius: var(--radius-lg);
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.author-profile img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.author-social {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.author-social a {
    color: var(--text-primary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
}

.author-social a:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

.article-comments {
    max-width: 800px;
    margin: 0 auto 3rem;
}

.comment-form {
    margin-bottom: 2rem;
}

.comment-form textarea {
    width: 100%;
    padding: 1rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-dark);
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    min-height: 120px;
    margin-bottom: 1rem;
    transition: all var(--transition-normal);
}

.comment-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.1);
}

.comments-list {
    margin-bottom: 2rem;
}

.comment {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--gray-medium);
}

.comment:last-child {
    border-bottom: none;
}

.comment img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.comment-content {
    flex: 1;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.comment-author {
    font-weight: 600;
}

.comment-time {
    color: var(--text-tertiary);
    font-size: 0.85rem;
}

.comment-actions {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.comment-actions button {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all var(--transition-normal);
}

.comment-actions button:hover {
    color: var(--primary-color);
}

.reply {
    margin-top: 1rem;
    margin-left: 1rem;
    padding-left: 1rem;
    border-left: 2px solid var(--gray-medium);
    display: flex;
    gap: 1rem;
}

.reply-author {
    font-weight: 600;
}

.author-badge {
    font-size: 0.7rem;
    background-color: var(--primary-color);
    color: var(--white);
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 5px;
}

.load-more-comments {
    width: 100%;
    padding: 12px;
    border-radius: var(--radius-full);
    border: 1px solid var(--primary-color);
    background-color: var(--white);
    color: var(--primary-color);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.load-more-comments:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

.related-articles {
    max-width: 800px;
    margin: 0 auto;
}

.related-articles-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 768px) {
    .related-articles-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.related-article {
    display: block;
    background-color: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
}

.related-article:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.related-article img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.related-article h4 {
    padding: 1rem;
    font-size: 1rem;
    margin: 0;
    color: var(--text-primary);
}

/* 响应式样式 */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .mobile-menu.active {
        display: flex;
    }
    
    .hero {
        padding: 120px 0 80px;
    }
    
    .features,
    .draggable-cards,
    .articles-section,
    .subscribe {
        padding: 80px 0;
    }
    
    .article-meta {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .publish-info {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .hero-buttons {
        flex-direction: column;
    }
    
    .hero-buttons a {
        width: 100%;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .filter-dropdowns {
        flex-direction: column;
        width: 100%;
    }
    
    .filter-dropdowns select {
        width: 100%;
    }
}
