/* ═══════════════════════════════════════════════════════════════════════════
   粉笔先生 Portal — Shared Styles
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
    --pk-coral: #FF6B6B;
    --pk-coral-dark: #EE5A5A;
    --pk-sunny: #FFD93D;
    --pk-mint: #6BCB77;
    --pk-mint-dark: #4CAF50;
    --pk-sky: #4D96FF;
    --pk-sky-dark: #3B7FE0;
    --pk-purple: #9B59B6;
    --pk-orange: #FF8C42;
    --pk-bg: #FFFBF5;
    --pk-bg-warm: #FFF8ED;
    --pk-text: #2D3436;
    --pk-text-soft: #636E72;
    --pk-text-light: #999;
    --pk-white: #FFFFFF;
    --pk-radius: 16px;
    --pk-radius-sm: 10px;
    --pk-radius-pill: 100px;
    --pk-shadow: 0 4px 20px rgba(0,0,0,0.06);
    --pk-shadow-lg: 0 8px 40px rgba(0,0,0,0.10);
    --pk-font: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

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

img { max-width: 100%; }
a { color: inherit; text-decoration: none; }

.pk-container { max-width: 1140px; margin: 0 auto; padding: 0 24px; }

/* ── Buttons ───────────────────────────────────────────────────────────── */
.pk-btn {
    display: inline-flex; align-items: center; justify-content: center;
    font-family: var(--pk-font); font-weight: 700; font-size: 15px;
    border: none; cursor: pointer; transition: all 0.2s;
    border-radius: var(--pk-radius-sm); padding: 12px 28px; gap: 8px;
}
.pk-btn--sm { padding: 8px 20px; font-size: 14px; }
.pk-btn--lg { padding: 16px 40px; font-size: 18px; }
.pk-btn--pill { border-radius: var(--pk-radius-pill); }
.pk-btn--primary { background: var(--pk-coral); color: #fff; }
.pk-btn--primary:hover { background: var(--pk-coral-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(255,107,107,0.4); }
.pk-btn--outline { background: transparent; border: 2px solid var(--pk-coral); color: var(--pk-coral); }
.pk-btn--outline:hover { background: var(--pk-coral); color: #fff; }
.pk-btn--ghost { background: transparent; color: var(--pk-text-soft); }
.pk-btn--ghost:hover { color: var(--pk-coral); }
.pk-btn--white { background: #fff; color: var(--pk-coral); }
.pk-btn--white:hover { background: #f0f0f0; }
.pk-btn--full { width: 100%; }

/* ── Header ────────────────────────────────────────────────────────────── */
.pk-header {
    background: rgba(255,255,255,0.60); backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(0,0,0,0.06);
    position: sticky; top: 0; z-index: 100;
}
.pk-header .pk-container { display: flex; align-items: center; min-height: 64px; padding-top: 8px; padding-bottom: 8px; flex-wrap: wrap; }
.pk-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; color: var(--pk-text); flex-shrink: 0; }
.pk-brand-logo { width: 36px; height: 36px; }
.pk-nav { display: flex; gap: 6px; margin-left: 40px; flex-wrap: wrap; }
.pk-nav-link { padding: 7px 14px; border-radius: var(--pk-radius-pill); font-weight: 600; font-size: 14px; color: var(--pk-text-soft); transition: all 0.2s; white-space: nowrap; }
.pk-nav-link:hover { background: var(--pk-bg-warm); color: var(--pk-coral); }
.pk-nav-link.active { background: color-mix(in srgb, var(--pk-coral) 10%, transparent); color: var(--pk-coral); }
.pk-header-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.pk-lang-wrap { position: relative; }
.pk-lang-btn {
    width: 38px; height: 38px; border-radius: 50%; border: none; background: transparent;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    color: var(--pk-text-soft); transition: all 0.2s;
}
.pk-lang-btn:hover { background: var(--pk-bg-warm); }
.pk-lang-menu {
    position: absolute; top: 44px; right: 0; background: #fff; border-radius: var(--pk-radius-sm);
    box-shadow: var(--pk-shadow-lg); padding: 6px 0; min-width: 130px; display: none; z-index: 110;
}
.pk-lang-menu.show { display: block; }
.pk-lang-menu a { display: block; padding: 8px 18px; font-size: 14px; color: var(--pk-text); font-weight: 600; }
.pk-lang-menu a:hover { background: var(--pk-bg-warm); color: var(--pk-coral); }

/* User dropdown */
.pk-user-wrap { position: relative; }
.pk-user-btn {
    display: flex; align-items: center; gap: 6px; padding: 6px 14px;
    border-radius: var(--pk-radius-pill); border: none; background: var(--pk-bg-warm);
    font-family: var(--pk-font); font-size: 14px; font-weight: 700; color: var(--pk-text);
    cursor: pointer; transition: all 0.2s;
}
.pk-user-btn:hover { background: #ffe8d6; }
.pk-user-menu {
    position: absolute; top: 44px; right: 0; background: #fff; border-radius: var(--pk-radius-sm);
    box-shadow: var(--pk-shadow-lg); padding: 6px 0; min-width: 160px; display: none; z-index: 110;
}
.pk-user-menu.show { display: block; }
.pk-user-menu a { display: block; padding: 10px 18px; font-size: 14px; font-weight: 600; color: var(--pk-text); }
.pk-user-menu a:hover { background: var(--pk-bg-warm); color: var(--pk-coral); }
.pk-user-menu hr { border: none; border-top: 1px solid #eee; margin: 4px 0; }

.pk-nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--pk-coral, #FF6B6B);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    vertical-align: middle;
    margin-left: 2px;
}

/* ── Footer ────────────────────────────────────────────────────────────── */
.pk-footer {
    position: relative;
    background: linear-gradient(180deg, #2d3436 0%, #1e2326 100%);
    color: rgba(255,255,255,0.7);
    padding: 80px 0 0;
}

.pk-footer-wave {
    position: absolute;
    top: -1px;
    left: 0;
    right: 0;
    height: 40px;
    background: var(--pk-bg);
    clip-path: ellipse(60% 100% at 50% 0%);
}

.pk-footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 48px;
}

.pk-footer-col--brand {
    padding-right: 20px;
}

.pk-footer-logo-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.pk-footer-logo {
    width: 40px;
    height: 40px;
    filter: brightness(1.2);
}

.pk-footer-logo-text {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.3px;
}

.pk-footer-desc {
    font-size: 13px;
    line-height: 1.8;
    color: rgba(255,255,255,0.55);
    margin-bottom: 20px;
    max-width: 260px;
}

.pk-footer-social {
    display: flex;
    gap: 8px;
}

.pk-footer-social-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    opacity: 0.6;
}

.pk-footer-heading {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.85;
}

.pk-footer-col a {
    display: block;
    font-size: 14px;
    padding: 5px 0;
    color: rgba(255,255,255,0.55);
    transition: all 0.2s;
    font-weight: 500;
}

.pk-footer-col a:hover {
    color: var(--pk-sunny);
    padding-left: 4px;
}

.pk-footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: 20px 0;
    text-align: center;
    font-size: 12px;
    color: rgba(255,255,255,0.35);
}

@media (max-width: 768px) {
    .pk-footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
    }
    .pk-footer-col--brand {
        grid-column: 1 / -1;
        padding-right: 0;
    }
}

@media (max-width: 480px) {
    .pk-footer-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Toast ──────────────────────────────────────────────────────────────── */
.pk-toast {
    position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
    padding: 14px 28px; border-radius: var(--pk-radius-pill); font-weight: 700;
    font-size: 15px; z-index: 9999; opacity: 0; transition: opacity 0.3s;
    pointer-events: none; box-shadow: var(--pk-shadow-lg);
}
.pk-toast.show { opacity: 1; }
.pk-toast--ok { background: var(--pk-mint); color: #fff; }
.pk-toast--err { background: var(--pk-coral); color: #fff; }

/* ── Auth pages shared ─────────────────────────────────────────────────── */
.pk-auth-wrap {
    display: flex; justify-content: center; align-items: center;
    min-height: calc(100vh - 64px - 200px); padding: 40px 24px;
}
.pk-auth-card {
    width: 100%; max-width: 420px; background: #fff; border-radius: 24px;
    padding: 44px 36px; box-shadow: var(--pk-shadow-lg);
}
.pk-auth-header { text-align: center; margin-bottom: 32px; }
.pk-auth-logo { width: 56px; height: 56px; margin-bottom: 16px; }
.pk-auth-title { font-size: 26px; font-weight: 800; margin-bottom: 6px; }
.pk-auth-subtitle { font-size: 15px; color: var(--pk-text-soft); }
.pk-auth-footer { text-align: center; padding-top: 20px; border-top: 1px solid #efefef; margin-top: 24px; font-size: 14px; color: var(--pk-text-soft); }
.pk-auth-footer a { color: var(--pk-coral); font-weight: 700; margin-left: 4px; }
.pk-auth-footer a:hover { text-decoration: underline; }

/* ── Form controls ─────────────────────────────────────────────────────── */
.pk-field { margin-bottom: 18px; }
.pk-label { display: block; font-size: 14px; font-weight: 700; margin-bottom: 6px; color: var(--pk-text); }
.pk-input {
    width: 100%; height: 48px; padding: 0 16px; border: 2px solid #e8e8e8;
    border-radius: var(--pk-radius-sm); font-family: var(--pk-font); font-size: 15px;
    font-weight: 600; color: var(--pk-text); background: #fafafa; transition: all 0.2s;
}
.pk-input:focus { outline: none; border-color: var(--pk-coral); background: #fff; box-shadow: 0 0 0 4px rgba(255,107,107,0.08); }
.pk-input::placeholder { color: #ccc; font-weight: 400; }
.pk-input--icon { padding-left: 44px; }
.pk-input-wrap { position: relative; }
.pk-input-wrap .pk-input-icon {
    position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
    font-size: 18px; color: var(--pk-text-light); pointer-events: none;
}
.pk-select {
    width: 100%; height: 48px; padding: 0 44px 0 16px;
    border: 2px solid #e8e8e8;
    border-radius: var(--pk-radius-sm); font-family: var(--pk-font); font-size: 15px;
    font-weight: 600; color: var(--pk-text); background: #fafafa;
    appearance: none; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%23999' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}
.pk-select:hover { border-color: #ccc; background-color: #fff; }
.pk-select:focus {
    outline: none; border-color: var(--pk-coral); background: #fff;
    box-shadow: 0 0 0 4px rgba(255,107,107,0.08);
}
.pk-field-row { display: flex; gap: 12px; }
.pk-field-row .pk-field { flex: 1; }
.pk-field-error { font-size: 12px; color: var(--pk-coral); font-weight: 700; margin-top: 4px; display: none; }
.pk-field-error.show { display: block; }

/* ── Shared: page hero ─────────────────────────────────────────────────── */
.pk-page-hero { margin-top: -64px; padding: 120px 0 40px; text-align: center; }
.pk-page-hero h1 { font-size: 36px; font-weight: 900; margin-bottom: 8px; }
.pk-page-hero p { font-size: 16px; color: var(--pk-text-soft); }

/* ── Shared: section layout ─────────────────────────────────────────────── */
.pk-section { padding: 80px 0; }
.pk-section--warm { background: var(--pk-bg-warm); }
.pk-section-header { text-align: center; margin-bottom: 56px; }
.pk-tag {
    display: inline-block; padding: 5px 16px; border-radius: var(--pk-radius-pill);
    font-size: 12px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
    margin-bottom: 16px;
}
.pk-tag--coral { background: rgba(255,107,107,0.08); color: var(--pk-coral); }
.pk-tag--mint { background: rgba(107,203,119,0.1); color: var(--pk-mint-dark); }
.pk-tag--sky { background: rgba(77,150,255,0.08); color: var(--pk-sky); }
.pk-section-title { font-size: clamp(26px, 4vw, 36px); font-weight: 800; margin-bottom: 12px; }
.pk-section-subtitle { font-size: 16px; color: var(--pk-text-soft); max-width: 500px; margin: 0 auto; }

/* ── Shared: topic grid ─────────────────────────────────────────────────── */
.pk-topic-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.pk-topic-card {
    background: #fff; border-radius: 16px; padding: 22px 24px;
    display: flex; align-items: center; gap: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04); transition: all 0.2s;
}
.pk-topic-card:hover { transform: translateY(-2px); box-shadow: var(--pk-shadow); }
.pk-topic-num {
    width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
    color: #fff; font-size: 16px; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
}
.pk-topic-card span { font-size: 15px; font-weight: 700; }

/* ── Shared: subject grid ───────────────────────────────────────────────── */
.pk-subjects { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.pk-subject {
    background: #fff; border-radius: 16px; padding: 28px 16px; text-align: center;
    transition: all 0.25s; border: 2px solid transparent; display: block;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.pk-subject:hover { border-color: var(--pk-sunny); transform: translateY(-3px); box-shadow: var(--pk-shadow); }
.pk-subject-icon { width: 56px; height: 56px; border-radius: 16px; margin: 0 auto 12px; display: flex; align-items: center; justify-content: center; font-size: 28px; }
.pk-subject span { font-size: 15px; font-weight: 700; }

/* ── Shared: CTA ────────────────────────────────────────────────────────── */
.pk-cta {
    background: linear-gradient(135deg, var(--pk-coral), var(--pk-orange));
    border-radius: 28px; padding: 72px 24px; text-align: center;
    color: #fff; position: relative; overflow: hidden;
}
.pk-cta::before {
    content: ''; position: absolute; top: -50px; right: -50px;
    width: 200px; height: 200px; border-radius: 50%;
    background: rgba(255,255,255,0.08);
}
.pk-cta h2 { font-size: 32px; font-weight: 800; margin-bottom: 12px; position: relative; }
.pk-cta p { font-size: 16px; opacity: 0.85; margin-bottom: 32px; position: relative; }

/* ── Shared: back link ─────────────────────────────────────────────────── */
.pk-back-link { display: inline-block; font-size: 14px; font-weight: 700; color: var(--pk-text-soft); margin-bottom: 32px; transition: color 0.2s; }
.pk-back-link:hover { color: var(--pk-coral); }

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .pk-nav { display: none; }
    .pk-header .pk-container { height: 56px; }
    .pk-page-hero { margin-top: -56px; padding: 112px 0 40px; }
    .pk-footer-grid { grid-template-columns: 1fr 1fr; }
    .pk-auth-card { padding: 32px 24px; }
}
