/**
 * 飞书宝藏库 - 自定义样式
 * 
 * @author 姚金刚
 * @version 1.0
 * @date 2025-10-03
 */

/* 基础样式重置 */
* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', Roboto, sans-serif;
    line-height: 1.6;
    color: #1f2937;
    background: linear-gradient(135deg, #f5f7fa 0%, #f9fafb 100%);
    min-height: 100vh;
}

/* 渐变文字效果 */
.gradient-text {
    background: linear-gradient(135deg, #3B82F6 0%, #8B5CF6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

/* 温暖渐变 */
.warm-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

/* Hero 区域样式 - 移动端优化 */
.hero-section {
    background: linear-gradient(135deg, #FF9A8B 0%, #FF6B6B 50%, #EE5A6F 100%);
    background: linear-gradient(135deg, #FFB6C1 0%, #FF8A9D 50%, #FF7E8F 100%);
    color: white;
    padding: 3rem 1rem 2rem 1rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    border-radius: 0 0 2rem 2rem;
    box-shadow: 0 4px 20px rgba(255, 107, 107, 0.3);
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: heroFloat 20s ease-in-out infinite;
}

@keyframes heroFloat {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(30px, 30px); }
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 4xl;
    margin: 0 auto;
}

.hero-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.3;
    text-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

@media (max-width: 640px) {
    .hero-title {
        font-size: 1.75rem;
    }
}

.hero-subtitle {
    font-size: 1.125rem;
    margin-bottom: 1.5rem;
    opacity: 0.95;
    line-height: 1.7;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 640px) {
    .hero-subtitle {
        font-size: 1rem;
    margin-bottom: 1rem;
    }
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

@media (max-width: 640px) {
    .hero-stats {
        gap: 1rem;
    margin-top: 1rem;
  }
}

.hero-stat {
    text-align: center;
}

.hero-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    display: block;
}

@media (max-width: 640px) {
    .hero-stat-value {
    font-size: 1.5rem;
  }
}

.hero-stat-label {
    font-size: 0.75rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

@media (max-width: 640px) {
    .hero-stat-label {
    font-size: 0.625rem;
  }
}

/* 卡片悬停效果 */
.card-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateZ(0);
}

.card-hover:hover {
    transform: translateY(-8px) translateZ(0);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 12px 24px -4px rgba(0, 0, 0, 0.1);
}

/* 文章卡片样式 - 移动端优化 */
.article-card {
    background: white;
    border-radius: 1.25rem;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid #F3F4F6;
}

.article-card:active {
    transform: scale(0.98);
}

@media (max-width: 640px) {
    .article-card {
        border-radius: 1rem;
    }
}

.article-card:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

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

.article-card-content {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

@media (max-width: 640px) {
    .article-card-content {
    padding: 1rem;
  }
}

.article-card-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    line-height: 1.4;
    color: #111827;
}

@media (max-width: 640px) {
    .article-card-title {
    font-size: 1rem;
    margin-bottom: 0.5rem;
  }
}

.article-card-excerpt {
    color: #6B7280;
    font-size: 0.875rem;
    line-height: 1.7;
    margin-bottom: 1rem;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 640px) {
    .article-card-excerpt {
    font-size: 0.8125rem;
    -webkit-line-clamp: 2;
  }
}

.article-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid #E5E7EB;
    font-size: 0.75rem;
    color: #9CA3AF;
}

.article-card-category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, #FFB6C1 0%, #FF8A9D 100%);
    color: white;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    box-shadow: 0 2px 4px rgba(255, 107, 107, 0.2);
}

.article-card-date {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}


/* 按钮动画效果 - 移动端优化 */
.btn-primary {
    background: linear-gradient(135deg, #FF9A8B 0%, #FF6B6B 100%);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border-radius: 9999px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #FF6B6B 0%, #EE5A6F 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 107, 107, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
}

@media (max-width: 640px) {
  .btn-primary {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
  }
}

/* 搜索框增强效果 */
.search-input {
    transition: all 0.3s ease;
}

.search-input:focus {
    transform: scale(1.02);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* 加载动画 */
.loading-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* 淡入动画 */
.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

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

/* 滑入动画 */
.slide-in-right {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 文本截断 */
.line-clamp-1 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
}

.line-clamp-2 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.line-clamp-3 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* 响应式设计增强 */
@media (max-width: 768px) {
    .card-hover:hover {
        transform: none;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    }
    
    .search-input:focus {
        transform: none;
    }
}

/* 打印样式 */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .card-hover {
        box-shadow: none !important;
        border: 1px solid #e5e7eb !important;
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .gradient-text {
        background: none;
        -webkit-background-clip: unset;
        -webkit-text-fill-color: unset;
        background-clip: unset;
        color: #000000;
    }
    
    .card-hover {
        border: 2px solid #000000;
    }
}

/* 减少动画模式支持 */
@media (prefers-reduced-motion: reduce) {
    .card-hover,
    .btn-primary,
    .like-button,
    .search-input {
        transition: none;
    }
    
    .card-hover:hover {
        transform: none;
    }
    
    .loading-spinner {
        animation: none;
    }
    
    .fade-in,
    .slide-in-right {
        animation: none;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #111827;
        color: #f9fafb;
    }
    
    .card-hover {
        background-color: #1f2937;
        border-color: #374151;
    }
    
    .gradient-text {
        background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }
}

/* 焦点可见性增强 */
.focus-visible:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* 工具提示样式 */
.tooltip {
    position: relative;
}

.tooltip::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #1f2937;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.tooltip:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-4px);
}

/* 状态指示器 */
.status-online {
    position: relative;
}

.status-online::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 8px;
    height: 8px;
    background-color: #10b981;
    border-radius: 50%;
    border: 2px solid white;
}

/* 徽章样式 */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1;
}

.badge-primary {
    background-color: #dbeafe;
    color: #1e40af;
}

.badge-success {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

.read-more-btn {
    display: inline-flex;
    align-items: center;
    color: #111827;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.read-more-btn:hover {
    color: #2563eb;
}

.article-shell {
    background: #ffffff;
    border: 1px solid #f3f4f6;
    border-radius: 0.75rem;
    overflow: hidden;
}

.article-prose {
    color: #374151;
    font-size: 17px;
    line-height: 1.9;
    max-width: 750px;
    margin: 0 auto;
    padding: 2rem 1rem;
    /* 确保内容完整显示 */
    min-height: 500px;
    overflow: visible;
}

.article-prose h1 {
    color: #111827;
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1.3;
    margin-top: 2rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid #e5e7eb;
}

.article-prose h2 {
    color: #1f2937;
    font-size: 1.875rem;
    font-weight: 700;
    line-height: 1.4;
    margin-top: 3rem;
    margin-bottom: 1.25rem;
    padding-left: 1rem;
    border-left: 4px solid #3b82f6;
}

.article-prose h3 {
    color: #374151;
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.5;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.article-prose h4 {
    color: #4b5563;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.5;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.article-prose p {
    margin-bottom: 1.5rem;
    text-align: justify;
    /* 确保段落完整显示 */
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.article-prose ul,
.article-prose ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.article-prose li {
    margin-bottom: 0.5rem;
    line-height: 1.8;
}

.article-prose ul,
.article-prose ol {
    padding-left: 1.5rem;
}

.article-prose blockquote {
    border-left: 4px solid #3b82f6;
    padding: 1.5rem;
    margin: 2rem 0;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-radius: 0.75rem;
    color: #1e40af;
    font-style: italic;
    font-size: 1.05em;
}

.article-prose code {
    background: #f3f4f6;
    padding: 0.15rem 0.4rem;
    border-radius: 0.35rem;
    font-size: 0.875em;
}

.article-prose pre {
    background: #111827;
    color: #f9fafb;
    padding: 1rem;
    border-radius: 0.75rem;
    overflow-x: auto;
    margin-bottom: 1rem;
}

.article-prose pre code {
    background: transparent;
    padding: 0;
    color: inherit;
}

.article-prose a {
    color: #2563eb;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

.article-prose a:hover {
    color: #1d4ed8;
    border-bottom-color: #1d4ed8;
}

/* 强调文本 */
.article-prose strong {
    color: #1f2937;
    font-weight: 700;
}

/* 分隔线美化 */
.article-prose hr {
    border: none;
    height: 2px;
    background: linear-gradient(90deg, transparent, #e5e7eb, transparent);
    margin: 3rem 0;
}

/* 确保文章内容区域完整显示 */
.article-rail {
    overflow: visible !important;
    max-height: none !important;
}

