/* ========================================
   KAGE-AI Site - style.css
   咖哥AI Personal Portal
   ======================================== */

/* --- CSS Variables --- */
:root {
    --color-bg: #fafafa;
    --color-surface: #ffffff;
    --color-text: #1a1a2e;
    --color-text-secondary: #555;
    --color-text-muted: #888;
    --color-primary: #c8702a;
    --color-primary-dark: #a85a1e;
    --color-primary-light: #f5e6d3;
    --color-accent: #2d5016;
    --color-border: #e8e8e8;
    --color-hero-bg: #1a1a2e;
    --color-hero-text: #f0f0f0;
    --color-section-alt: #f3f0eb;
    --color-badge-new: #d4442a;
    --color-badge-free: #2d8a4e;
    --color-badge-rating: #c8702a;

    --font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB",
        "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-mono: "SF Mono", "Fira Code", "Consolas", monospace;

    --nav-height: 60px;
    --container-max: 1100px;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --transition: 0.25s ease;
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--nav-height);
}

body {
    font-family: var(--font-family);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

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

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

ul {
    list-style: none;
}

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

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
}

/* --- Navigation --- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    transition: box-shadow var(--transition);
}

.navbar.scrolled {
    box-shadow: var(--shadow-md);
}

.nav-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.02em;
}

.nav-logo:hover {
    color: var(--color-primary-light);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 6px 14px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    transition: all var(--transition);
}

.nav-link:hover,
.nav-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.nav-lang {
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 0.8rem;
    padding: 4px 10px;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: all var(--transition);
}

/* --- Hero Section --- */
.hero {
    padding: 120px 0 80px;
    background: var(--color-hero-bg);
    color: var(--color-hero-text);
}

.hero-content {
    display: flex;
    align-items: center;
    gap: 48px;
}

.hero-avatar {
    flex-shrink: 0;
}

.avatar-img {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.2);
}

.hero-text {
    flex: 1;
}

.hero-name {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 4px;
    letter-spacing: 0.02em;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 16px;
}

.hero-tagline {
    font-size: 1.3rem;
    color: var(--color-primary-light);
    font-weight: 600;
    margin-bottom: 16px;
}

.hero-intro {
    font-size: 1rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.75);
    max-width: 560px;
    margin-bottom: 24px;
}

.hero-links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.hero-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: var(--radius);
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9rem;
    transition: all var(--transition);
}

.hero-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.4);
}

/* --- Section Base --- */
.section {
    padding: 80px 0;
}

.section:nth-child(even) {
    background: var(--color-section-alt);
}

.section-header {
    text-align: center;
    margin-bottom: 48px;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--color-text);
}

.section-subtitle {
    font-size: 1.05rem;
    color: var(--color-text-secondary);
}

.section-stat {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    margin-top: 8px;
}

.section-stat strong {
    color: var(--color-primary);
    font-size: 1.2rem;
}

/* --- Cards --- */
.card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
}

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

.card-body {
    padding: 20px;
}

.card-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--color-text);
    line-height: 1.4;
}

.card-desc {
    font-size: 0.88rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin-bottom: 12px;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.card-links {
    display: flex;
    gap: 8px;
}

/* --- Book Cards Grid --- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.book-cover {
    height: 160px;
    background: linear-gradient(135deg, var(--color-hero-bg), #2d2d5e);
    display: flex;
    align-items: center;
    justify-content: center;
}

.book-cover-placeholder {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
}

.book-year {
    font-size: 1.5rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.3);
}

/* --- Course Cards List --- */
.course-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.course-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px;
    text-decoration: none;
    color: inherit;
}

.course-card:hover {
    color: inherit;
}

.course-icon {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: var(--color-primary-light);
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.course-card .card-body {
    flex: 1;
    padding: 0;
}

.course-card .card-title {
    margin-bottom: 4px;
}

.course-card .card-desc {
    margin-bottom: 8px;
}

.course-arrow {
    font-size: 1.5rem;
    color: var(--color-text-muted);
    flex-shrink: 0;
    transition: transform var(--transition);
}

.course-card:hover .course-arrow {
    transform: translateX(4px);
    color: var(--color-primary);
}

/* --- Badges --- */
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--color-primary-light);
    color: var(--color-primary);
}

.badge-new {
    background: var(--color-badge-new);
    color: #fff;
}

.badge-free {
    background: var(--color-badge-free);
    color: #fff;
}

.badge-rating {
    background: var(--color-primary-light);
    color: var(--color-primary);
}

.badge-high {
    background: var(--color-badge-free);
    color: #fff;
}

.meta-publisher {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: 8px 20px;
    border-radius: var(--radius);
    font-size: 0.88rem;
    font-weight: 500;
    transition: all var(--transition);
    cursor: pointer;
    border: none;
    text-align: center;
}

.btn-sm {
    padding: 4px 14px;
    font-size: 0.8rem;
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
    background: transparent;
}

.btn-sm:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.btn-primary {
    background: var(--color-primary);
    color: #fff;
    padding: 12px 32px;
    font-size: 1rem;
}

.btn-primary:hover {
    background: var(--color-primary-dark);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* --- WeChat Section --- */
.wechat-content {
    display: flex;
    align-items: center;
    gap: 48px;
    max-width: 700px;
    margin: 0 auto;
}

.wechat-qr {
    flex-shrink: 0;
}

.qr-placeholder {
    width: 180px;
    height: 180px;
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--color-text-muted);
    background: var(--color-surface);
}

.qr-placeholder p {
    font-size: 0.85rem;
}

.wechat-info h3 {
    font-size: 1.3rem;
    margin-bottom: 12px;
    color: var(--color-text);
}

.wechat-info p {
    color: var(--color-text-secondary);
    margin-bottom: 12px;
}

.wechat-info ul {
    list-style: disc;
    padding-left: 20px;
    margin-bottom: 16px;
}

.wechat-info li {
    color: var(--color-text-secondary);
    font-size: 0.92rem;
    margin-bottom: 4px;
}

.wechat-cta {
    color: var(--color-primary);
    font-weight: 500;
}

/* --- Knowledge Planet Section --- */
.planet-content {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.planet-info h3 {
    font-size: 1.3rem;
    margin-bottom: 12px;
}

.planet-info p {
    color: var(--color-text-secondary);
    margin-bottom: 12px;
}

.planet-info ul {
    list-style: disc;
    text-align: left;
    display: inline-block;
    padding-left: 20px;
    margin-bottom: 24px;
}

.planet-info li {
    color: var(--color-text-secondary);
    font-size: 0.92rem;
    margin-bottom: 4px;
}

/* --- Footer --- */
.footer {
    background: var(--color-hero-bg);
    color: rgba(255, 255, 255, 0.6);
    padding: 40px 0;
}

.footer-content {
    text-align: center;
}

.footer-brand {
    font-size: 1rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 12px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 16px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.88rem;
}

.footer-links a:hover {
    color: rgba(255, 255, 255, 0.9);
}

.footer-copy {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.35);
}

/* ========================================
   Responsive Design
   ======================================== */

/* Tablet */
@media (max-width: 768px) {
    .hero {
        padding: 100px 0 60px;
    }

    .hero-content {
        flex-direction: column;
        text-align: center;
        gap: 24px;
    }

    .hero-intro {
        max-width: 100%;
    }

    .hero-links {
        justify-content: center;
    }

    .hero-name {
        font-size: 2rem;
    }

    .card-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .section {
        padding: 60px 0;
    }

    .section-title {
        font-size: 1.6rem;
    }

    .wechat-content {
        flex-direction: column;
        text-align: center;
    }

    .wechat-info ul {
        text-align: left;
    }

    /* Mobile nav */
    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background: rgba(26, 26, 46, 0.98);
        flex-direction: column;
        padding: 16px 24px;
        gap: 4px;
        transform: translateY(-100%);
        opacity: 0;
        pointer-events: none;
        transition: all 0.3s ease;
    }

    .nav-menu.open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .nav-link {
        display: block;
        padding: 10px 16px;
        width: 100%;
        text-align: left;
    }

    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }
}

/* Mobile */
@media (max-width: 480px) {
    .hero {
        padding: 90px 0 48px;
    }

    .avatar-img {
        width: 140px;
        height: 140px;
    }

    .hero-name {
        font-size: 1.75rem;
    }

    .hero-tagline {
        font-size: 1.1rem;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .course-card {
        padding: 16px;
        gap: 12px;
    }

    .course-icon {
        width: 44px;
        height: 44px;
    }

    .section {
        padding: 48px 0;
    }

    .qr-placeholder {
        width: 150px;
        height: 150px;
    }
}

/* --- Animations --- */
@media (prefers-reduced-motion: no-preference) {
    .card,
    .hero-link,
    .btn {
        transition: transform 0.25s ease, box-shadow 0.25s ease;
    }
}

/* --- Print --- */
@media print {
    .navbar,
    .nav-toggle {
        display: none;
    }

    .hero {
        padding-top: 20px;
        background: #fff;
        color: #000;
    }

    .section {
        padding: 20px 0;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
