/*
 Theme Name: 兰姐原版阅读
 Theme URI: https://www.lanjie.xin
 Description: 面向成人的英文原版阅读与口语课程站（WordPress + H5P 友好）。课程即互动课程，无独立互动栏目。成人向、简洁大气的教育风格。
 Version: 1.1.0
 Author: WorkBuddy
 Tags: responsive, courses, h5p, adult-learning, education
 Text Domain: lanjie
*/

:root {
  --bg: #ffffff;
  --bg-soft: #f6f8fb;
  --ink: #1c2433;
  --muted: #5d6675;
  --brand: #176b87;
  --brand-2: #2f9e8f;
  --line: #e8edf3;
  --card: #ffffff;
  --shadow: 0 8px 24px rgba(28, 36, 51, 0.06);
  --radius: 14px;
  --maxw: 1120px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 { line-height: 1.3; font-weight: 800; letter-spacing: -0.01em; }

/* ===== Header / Nav ===== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; position: relative; }
.brand { display: inline-flex; align-items: baseline; gap: 6px; font-weight: 800; font-size: 20px; color: var(--ink); }
.brand span { color: var(--brand); font-size: 14px; font-weight: 700; }

.nav-wrap { display: flex; align-items: center; gap: 22px; }
.site-nav { display: flex; align-items: center; gap: 28px; list-style: none; margin: 0; padding: 0; }
.site-nav a { font-size: 15px; font-weight: 600; color: var(--ink); transition: color .2s; }
.site-nav a:hover, .site-nav a.active { color: var(--brand); }

.nav-actions { display: flex; align-items: center; gap: 12px; }
.nav-user { display: inline-flex; align-items: baseline; font-size: 14px; color: var(--ink); max-width: 180px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.nav-user .user-greet { color: var(--muted); margin-right: 2px; }
.nav-user .user-name { font-weight: 700; color: var(--brand); }
.btn-login {
  display: inline-block; padding: 9px 22px; border-radius: 999px;
  background: var(--brand); color: #fff; font-weight: 700; font-size: 14px;
  transition: background .2s, transform .15s;
}
.btn-login:hover { background: var(--brand-2); transform: translateY(-1px); }
.btn-logout { background: transparent; color: var(--brand); border: 1.5px solid var(--brand); padding: 7px 18px; }
.btn-logout:hover { background: var(--brand); color: #fff; transform: translateY(-1px); }

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 6px; }
.nav-toggle span { width: 24px; height: 2.5px; background: var(--ink); border-radius: 2px; transition: .3s; }
.nav-toggle.open span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* ===== Hero / Slogan ===== */
.hero { padding: 84px 0 76px; text-align: center; background: linear-gradient(180deg, var(--bg-soft) 0%, var(--bg) 100%); }
.hero-inner { max-width: 820px; margin: 0 auto; }
.hero-slogan {
  display: inline-block; font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(18px, 2.4vw, 26px); font-style: italic; letter-spacing: .5px;
  color: var(--brand); margin-bottom: 18px;
}
.hero h1 { font-size: clamp(30px, 4.5vw, 50px); }
.hero .hero-lead { margin: 20px auto 30px; font-size: 17px; color: var(--muted); max-width: 600px; }
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.btn { display: inline-block; padding: 13px 28px; border-radius: 999px; font-weight: 700; font-size: 15px; cursor: pointer; border: 0; transition: transform .15s, box-shadow .2s; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 8px 20px rgba(23, 107, 135, .28); }
.btn-primary:hover { transform: translateY(-2px); }
.btn-ghost { background: #fff; color: var(--ink); border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }

/* ===== Section heads ===== */
.section-title { text-align: center; font-size: clamp(24px, 3vw, 34px); }
.section-sub { text-align: center; color: var(--muted); margin: 12px auto 44px; max-width: 640px; font-size: 16px; }

/* ===== System image ===== */
.system-section { background: var(--bg); padding: 76px 0; border-top: 1px solid var(--line); }
.system-image { max-width: 880px; margin: 0 auto; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }

/* ===== Courses ===== */
.courses { background: var(--bg-soft); padding: 76px 0; }
.course-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.course-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 22px; transition: transform .2s, box-shadow .2s; display: flex; flex-direction: column; }
.course-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.badge { align-self: flex-start; background: rgba(47, 158, 143, .12); color: var(--brand-2); font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: 999px; margin-bottom: 14px; }
.course-thumb { width: 100%; border-radius: 12px; margin-bottom: 14px; aspect-ratio: 16 / 10; object-fit: cover; }
.course-card h3 { font-size: 20px; margin-bottom: 8px; }
.course-card p { color: var(--muted); font-size: 14.5px; flex: 1; }
.card-link { color: var(--brand); font-weight: 700; font-size: 14px; margin-top: 14px; }

/* ===== About ===== */
.about { background: #fff; padding: 76px 0; }
.about-inner { display: grid; grid-template-columns: 0.7fr 1.3fr; gap: 52px; align-items: center; }
.avatar { width: 220px; max-width: 100%; }
.avatar img { width: 220px; height: 220px; object-fit: cover; border-radius: 18px; box-shadow: var(--shadow); }
.about-text h2 { font-size: clamp(22px, 2.6vw, 32px); margin-bottom: 16px; }
.about-text p { color: var(--muted); margin-bottom: 14px; }
.creds { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.creds li { background: var(--bg-soft); border: 1px solid var(--line); padding: 11px 14px; border-radius: 10px; font-size: 14px; font-weight: 600; }

/* ===== Why ===== */
.why { background: var(--bg); padding: 76px 0; }
.why-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.why-item { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 20px; text-align: center; }
.why-item .w-ico { font-size: 30px; }
.why-item h3 { margin: 12px 0 8px; font-size: 17px; }
.why-item p { color: var(--muted); font-size: 14px; }

/* ===== Contact ===== */
.contact { background: var(--bg-soft); padding: 76px 0; }
.contact-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; max-width: 760px; margin: 0 auto; }
.contact-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 22px; text-align: center; }
.contact-card .c-label { display: block; color: var(--muted); font-size: 13px; }
.contact-card .c-value { display: block; font-weight: 700; font-size: 17px; margin-top: 6px; color: var(--ink); }

/* ===== Login gate (course detail) ===== */
.login-gate { max-width: 560px; margin: 80px auto; padding: 40px; text-align: center; background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); }
.login-gate h2 { font-size: 26px; margin-bottom: 12px; }
.login-gate p { color: var(--muted); margin-bottom: 22px; }
.login-gate .btn-primary { display: inline-block; }

/* ===== 手机号注册 / 登录表单 ===== */
.lanjie-auth { max-width: 420px; margin: 64px auto; padding: 34px 30px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 30px rgba(20,30,55,.06); }
.lanjie-auth-tabs { display: flex; gap: 8px; margin-bottom: 22px; }
.lanjie-auth-tabs button { flex: 1; padding: 11px 0; border: 1px solid var(--line); background: var(--bg-soft); color: var(--muted); font-size: 15px; font-weight: 600; border-radius: 10px; cursor: pointer; transition: .2s; }
.lanjie-auth-tabs button.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.lanjie-auth-form label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.lanjie-auth-form input { width: 100%; margin-top: 6px; padding: 12px 14px; font-size: 15px; border: 1px solid var(--line); border-radius: 10px; box-sizing: border-box; }
.lanjie-auth-form input:focus { outline: none; border-color: var(--brand); }
.lanjie-auth-form button[type=submit] { width: 100%; padding: 13px 0; border: none; background: var(--brand); color: #fff; font-size: 16px; font-weight: 700; border-radius: 10px; cursor: pointer; transition: .2s; }
.lanjie-auth-form button[type=submit]:hover { opacity: .92; }
.lanjie-auth-msg { margin: 4px 0 14px; padding: 10px 12px; border-radius: 8px; font-size: 14px; }
.lanjie-auth-msg.err { background: #fdecec; color: #c0392b; }
.lanjie-auth-msg.ok { background: #eafaf1; color: #1e874b; }
.lanjie-auth-note { margin-top: 14px; font-size: 12px; color: var(--muted); text-align: center; }
.lanjie-auth-ok { font-size: 15px; color: var(--ink); }

/* ===== Footer ===== */
.site-footer { background: #1c2433; color: #cfd3dc; padding: 32px 0; text-align: center; }
.site-footer .brand { color: #fff; justify-content: center; }
.site-footer p { font-size: 13px; }

/* ===== Responsive ===== */
@media (max-width: 980px) {
  .about-inner { grid-template-columns: 1fr; gap: 30px; text-align: center; }
  .avatar { margin: 0 auto; }
  .creds { text-align: left; }
  .course-grid { grid-template-columns: repeat(2, 1fr); }
  .why-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-cards { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; gap: 0; background: #fff;
    border-bottom: 1px solid var(--line);
    max-height: 0; overflow: hidden; transition: max-height .3s ease;
  }
  .site-nav.open { max-height: 360px; }
  .site-nav li { width: 100%; }
  .site-nav a { display: block; padding: 14px 22px; width: 100%; border-top: 1px solid var(--line); }
  .course-grid, .why-grid, .creds { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
