/* ============================================
   个人主页样式 - 基于 shadcn/ui 设计系统
   MCP 美化组件: card / button / badge / avatar / hover-card
   ============================================ */

/* --- CSS 变量 (shadcn 配色方案) --- */
:root {
    --background: #f8fafc;
    --foreground: #0f172a;
    --card: #ffffff;
    --card-foreground: #0f172a;
    --primary: #6366f1;
    --primary-foreground: #ffffff;
    --secondary: #f1f5f9;
    --secondary-foreground: #1e293b;
    --muted: #f1f5f9;
    --muted-foreground: #64748b;
    --accent: #f1f5f9;
    --accent-foreground: #1e293b;
    --destructive: #ef4444;
    --destructive-foreground: #ffffff;
    --border: #e2e8f0;
    --input: #e2e8f0;
    --ring: #6366f1;
    --radius: 0.75rem;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: var(--background);
    color: var(--foreground);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* --- 导航栏 (shadcn style) --- */
.navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 50;
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    transition: all 0.3s;
}
.navbar.scrolled { background: rgba(255,255,255,0.95); box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.navbar .container {
    display: flex; align-items: center; justify-content: space-between;
    height: 64px;
}
.logo {
    font-size: 1.25rem; font-weight: 700;
    color: var(--foreground);
    letter-spacing: -0.3px;
}
.nav-links { display: flex; gap: 2px; }
.nav-links a {
    padding: 8px 16px; border-radius: calc(var(--radius) - 2px);
    font-size: 0.875rem; font-weight: 500;
    color: var(--muted-foreground);
    transition: all 0.2s;
}
.nav-links a:hover, .nav-links a.active {
    background: var(--accent);
    color: var(--accent-foreground);
}

/* --- Hero --- */
.hero {
    position: relative;
    min-height: 90vh;
    display: flex; align-items: center; justify-content: center;
    padding: 120px 0 80px;
    overflow: hidden;
}
.hero .container {
    text-align: center;
    position: relative;
    z-index: 1;
}
.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -1.5px;
    margin-bottom: 16px;
}
@media (max-width: 640px) { .hero h1 { font-size: 2.25rem; } }
.highlight { color: var(--primary); }
.hero .subtitle {
    font-size: 1.25rem;
    color: var(--muted-foreground);
    margin-bottom: 12px;
    font-weight: 500;
}
.hero .description {
    font-size: 1rem;
    color: var(--muted-foreground);
    max-width: 540px;
    margin: 0 auto 32px;
    line-height: 1.8;
}
.cta-buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* --- 按钮 (shadcn exact style) --- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 24px;
    border-radius: calc(var(--radius) - 2px);
    font-size: 0.875rem; font-weight: 500;
    line-height: 1.5;
    cursor: pointer;
    transition: all 0.15s;
    border: 1px solid transparent;
    text-decoration: none;
    white-space: nowrap;
}
.btn-primary {
    background: var(--primary);
    color: var(--primary-foreground);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.btn-primary:hover {
    background: #5558e6;
    box-shadow: 0 2px 8px rgba(99,102,241,0.3);
}
.btn-secondary {
    background: var(--secondary);
    color: var(--secondary-foreground);
    border-color: var(--border);
}
.btn-secondary:hover {
    background: #e2e8f0;
}
.btn-small, .btn-download {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 14px;
    border-radius: calc(var(--radius) - 4px);
    font-size: 0.8125rem; font-weight: 500;
    cursor: pointer; transition: all 0.15s;
    border: 1px solid var(--border);
    text-decoration: none;
}
.btn-small { background: var(--secondary); color: var(--secondary-foreground); }
.btn-small:hover { background: #e2e8f0; }
.btn-download { background: var(--primary); color: var(--primary-foreground); border-color: var(--primary); }
.btn-download:hover { opacity: 0.9; }

/* --- 章节 (shadcn section pattern) --- */
.section {
    position: relative;
    padding: 80px 0;
}
.section-alt { background: var(--card); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-header {
    text-align: center;
    margin-bottom: 48px;
}
.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}
.section-subtitle {
    font-size: 0.9375rem;
    color: var(--muted-foreground);
    max-width: 480px;
    margin: 0 auto;
}

/* --- 卡片 (shadcn Card exact pattern) --- */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
    transition: all 0.2s;
    display: flex; flex-direction: column;
}
.card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border-color: #cbd5e1;
}
.card-header {
    padding: 24px 24px 0;
    flex: 1;
}
.card-icon {
    height: 180px;
    overflow: hidden;
    border-radius: calc(var(--radius) - 4px);
    background: var(--secondary);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 16px;
}
.card-icon img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; }
.card-header h3 {
    font-size: 1.0625rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--card-foreground);
}
.card-desc {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    line-height: 1.6;
}
.card-footer {
    padding: 12px 24px 24px;
    display: flex; align-items: center; gap: 10px;
    margin-top: 8px;
}

/* --- 徽章 (shadcn Badge) --- */
.version-badge {
    display: inline-flex; align-items: center;
    padding: 2px 10px;
    border-radius: 9999px;
    font-size: 0.75rem; font-weight: 600;
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

/* --- 联系方式 (shadcn Card variant) --- */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    max-width: 700px;
    margin: 0 auto;
}
.contact-item {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 20px;
    text-align: center;
    transition: all 0.2s;
}
.contact-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border-color: #cbd5e1;
}
.contact-item i {
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 12px;
    display: block;
}
.contact-item h3 { font-size: 0.9375rem; font-weight: 600; margin-bottom: 6px; }
.contact-item p { font-size: 0.8125rem; color: var(--muted-foreground); }

/* --- Footer (shadcn style) --- */
.footer {
    border-top: 1px solid var(--border);
    padding: 32px 0;
    text-align: center;
    font-size: 0.8125rem;
    color: var(--muted-foreground);
}
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 8px; }

/* --- 空状态 --- */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-state i { font-size: 2.5rem; color: var(--muted-foreground); margin-bottom: 12px; }
.empty-state p { color: var(--muted-foreground); font-size: 0.875rem; }

/* --- 反馈按钮 --- */
.feedback-fab {
    position: fixed; bottom: 24px; right: 24px;
    width: 48px; height: 48px;
    border-radius: 9999px;
    background: var(--primary);
    color: var(--primary-foreground);
    border: none; cursor: pointer;
    font-size: 1.25rem;
    box-shadow: 0 2px 8px rgba(99,102,241,0.3);
    transition: all 0.2s;
    z-index: 1000;
    display: flex; align-items: center; justify-content: center;
}
.feedback-fab:hover { box-shadow: 0 4px 16px rgba(99,102,241,0.4); transform: translateY(-2px); }

/* --- 反馈弹窗 --- */
.feedback-modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 2000; display: none;
    align-items: center; justify-content: center;
}
.feedback-modal-overlay.active { display: flex; }
.feedback-modal {
    background: var(--card);
    border-radius: var(--radius);
    width: 90%; max-width: 440px; max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    display: flex; flex-direction: column;
}
.feedback-modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 24px 0;
}
.feedback-modal-header h5 { font-size: 1rem; font-weight: 600; margin: 0; }
.feedback-close {
    background: none; border: none; font-size: 24px;
    color: var(--muted-foreground); cursor: pointer;
    width: 32px; height: 32px; border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
}
.feedback-close:hover { background: var(--accent); }
.feedback-modal-body { padding: 20px 24px; }
.feedback-modal-body .form-group { margin-bottom: 14px; }
.feedback-modal-body label { display: block; font-size: 0.8125rem; font-weight: 500; color: var(--foreground); margin-bottom: 6px; }
.feedback-modal-body .form-control {
    width: 100%; padding: 8px 12px;
    border: 1px solid var(--input);
    border-radius: calc(var(--radius) - 4px);
    font-size: 0.875rem; transition: 0.15s; outline: none;
    font-family: inherit; background: var(--background);
}
.feedback-modal-body .form-control:focus {
    border-color: var(--ring);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}
.feedback-status { padding: 8px 12px; border-radius: 6px; font-size: 0.8125rem; display: none; margin-top: 8px; }
.feedback-status.success { display: block; background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.feedback-status.error { display: block; background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.feedback-status.loading { display: flex; align-items: center; gap: 8px; background: var(--accent); color: var(--muted-foreground); }
.feedback-status.loading::before {
    content: ''; width: 14px; height: 14px;
    border: 2px solid #ddd; border-top-color: var(--primary);
    border-radius: 50%; animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.feedback-modal-footer {
    display: flex; gap: 8px; justify-content: flex-end;
    padding: 16px 24px 20px; border-top: 1px solid var(--border);
}
.feedback-modal-footer .btn {
    padding: 8px 20px; border-radius: calc(var(--radius) - 4px);
    font-size: 0.8125rem; font-weight: 500;
    cursor: pointer; border: 1px solid transparent;
}
.feedback-modal-footer .btn-secondary { background: var(--secondary); color: var(--secondary-foreground); border-color: var(--border); }
.feedback-modal-footer .btn-secondary:hover { background: #e2e8f0; }
.feedback-modal-footer .btn-primary { background: var(--primary); color: var(--primary-foreground); }
.feedback-modal-footer .btn-primary:hover { opacity: 0.9; }

@media (max-width: 640px) {
    .section { padding: 48px 0; }
    .section-title { font-size: 1.375rem; }
    .cards-grid { grid-template-columns: 1fr; }
}

/* --- 滚动提示 (shadcn minimal style) --- */
.hero-scroll { margin-top: 64px; display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--muted-foreground); font-size: 0.75rem; }
.scroll-mouse { width: 20px; height: 32px; border: 2px solid var(--border); border-radius: 10px; position: relative; }
.scroll-dot { width: 3px; height: 6px; background: var(--muted-foreground); border-radius: 2px; position: absolute; top: 5px; left: 50%; transform: translateX(-50%); animation: scrollDot 2s ease-in-out infinite; }
@keyframes scrollDot { 0% { opacity: 1; transform: translateX(-50%) translateY(0); } 100% { opacity: 0; transform: translateX(-50%) translateY(14px); } }
