/* ly-study 站点补充样式：登录、孩子切换、课程详情、我的、错误页。
   配色与组件 token 来自 study-pad 的 library.css / tablet.css（Apache-2.0）。 */

a {
  color: inherit;
}

a.mini-btn,
a.icon-btn,
a.btn,
a.link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

a.continue-card {
  text-decoration: none;
  color: inherit;
}

a.tt-cell {
  text-decoration: none;
  color: inherit;
}

/* ---------- 资料提示 ---------- */
.profile-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 20px;
  padding: 14px 16px;
  border: 1px solid rgba(176, 141, 87, 0.35);
  border-radius: 14px;
  background: rgba(176, 141, 87, 0.08);
}

.profile-banner div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.profile-banner strong {
  font-size: 13.5px;
}

.profile-banner span {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.55;
}

/* ---------- 登录 ---------- */
body[data-page="login"] {
  overflow-y: auto;
}

.login-page {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  overflow-y: auto;
}

.login-card {
  width: min(420px, 100%);
  padding: 30px 30px 24px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: var(--shadow-md);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 13px;
}

.login-mark {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  color: var(--accent-deep);
}

.login-mark svg {
  width: 100%;
  height: 100%;
}

.login-brand h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.login-brand p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.06em;
}

.login-sub {
  margin: 18px 0 16px;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--muted);
}

.login-error {
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid rgba(168, 68, 58, 0.28);
  border-radius: 10px;
  background: rgba(168, 68, 58, 0.07);
  color: var(--danger);
  font-size: 13px;
  line-height: 1.55;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.5px;
  color: var(--muted);
}

.login-field input {
  height: 44px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: #fff;
  font-size: 15px;
  color: var(--ink);
}

.login-field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(46, 111, 82, 0.12);
}

.login-submit {
  height: 46px;
  margin-top: 4px;
  border-radius: 12px;
  font-size: 15px;
}

.login-hint {
  margin: 16px 0 0;
  font-size: 12px;
  line-height: 1.65;
  color: var(--faint);
}

.login-hint a {
  color: var(--accent-deep);
  text-decoration: none;
}

.login-links {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0 0;
  font-size: 13px;
}

.login-links a {
  color: var(--accent-deep);
  text-decoration: none;
}

.login-info {
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid rgba(46, 111, 82, 0.28);
  border-radius: 10px;
  background: rgba(46, 111, 82, 0.07);
  color: var(--accent-ink);
  font-size: 13px;
  line-height: 1.6;
}

.login-demo {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: rgba(46, 111, 82, 0.05);
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
}

.login-demo strong {
  display: block;
  margin-bottom: 3px;
  color: var(--accent-deep);
}

.login-demo p {
  margin: 0;
}

/* ---------- 课程详情 ---------- */
.back-link {
  font-size: 13px;
  color: var(--accent-deep);
  text-decoration: none;
}

.lesson-detail {
  max-width: 640px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: var(--shadow-sm);
}

.lesson-detail .kicker {
  margin: 0 0 8px;
  font-size: 11.5px;
  letter-spacing: 0.12em;
  color: var(--accent-deep);
  font-weight: 700;
}

.lesson-detail h1 {
  margin: 0 0 6px;
  font-size: 26px;
  font-weight: 700;
}

.detail-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 254, 251, 0.7);
  color: var(--muted);
  font-size: 12px;
}

.status-pill.ok {
  border-color: rgba(46, 111, 82, 0.32);
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

/* ---------- 我的 ---------- */
.me-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.me-card {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
}

.profile-form {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.profile-form label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12.5px;
  color: var(--muted);
}

.profile-form input,
.profile-form select {
  height: 40px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fff;
  font-size: 14px;
  color: var(--ink);
}

.profile-form input:focus,
.profile-form select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(46, 111, 82, 0.1);
}

.profile-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.form-actions {
  display: flex;
  gap: 9px;
  margin-top: 3px;
}

.danger-text {
  color: var(--danger);
}
.me-identity {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 16px;
  margin: 0 0 20px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
}

.identity-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-right: auto;
}

.identity-main strong {
  font-size: 19px;
  font-weight: 700;
}

.identity-main span {
  font-size: 12.5px;
  color: var(--muted);
}

.identity-meta {
  font-size: 12.5px;
  color: var(--faint);
}

.setting-row.static {
  color: var(--ink-soft);
}

.setting-row.static .chev {
  font-size: 12px;
  letter-spacing: 0.04em;
}

.logout-form {
  margin-top: 14px;
}

.license-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.license-links a {
  color: var(--faint);
  text-decoration: none;
}

.license-links a:hover {
  color: var(--accent-deep);
}

/* ---------- 错误页 ---------- */
.error-page {
  display: flex;
  align-items: center;
  justify-content: center;
}

.error-page .home-empty {
  margin-top: 0;
}

@media (max-width: 820px) {
  .me-columns {
    grid-template-columns: minmax(0, 1fr);
  }
  .login-card {
    padding: 24px 20px 20px;
  }
}

/* 管理后台与通用：无边框文字按钮、文件选择按钮 */
.link-btn {
  display: inline-flex;
  align-items: center;
  border: 0;
  background: transparent;
  padding: 4px 2px;
  color: var(--accent-deep);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  text-decoration: none;
}

.link-btn:hover {
  color: var(--accent-ink);
}

input[type="file"]::file-selector-button {
  height: 34px;
  margin-right: 10px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fff;
  color: var(--ink-soft);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

input[type="file"]::file-selector-button:hover {
  border-color: var(--accent);
  color: var(--accent-deep);
}

/* ============================================================
   网站式顶栏：品牌 + 主导航 + 用户区（替代平板底部 tabbar）
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  flex: 0 0 auto;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(16px);
}

.site-header-inner {
  display: flex;
  align-items: center;
  gap: 26px;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px 30px;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  color: inherit;
  text-decoration: none;
}

.site-brand-mark {
  width: 34px;
  height: 34px;
  color: var(--accent-deep);
}

.site-brand-mark svg {
  width: 100%;
  height: 100%;
}

.site-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.site-brand-text strong {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.site-nav a {
  padding: 8px 15px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.site-nav a:hover {
  background: rgba(32, 38, 31, 0.05);
  color: var(--ink);
}

.site-nav a.active {
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 600;
}

.site-user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  color: inherit;
  text-decoration: none;
}

.site-user-chip:hover {
  background: rgba(32, 38, 31, 0.04);
}

.site-user-text {
  display: flex;
  align-items: baseline;
  gap: 8px;
  line-height: 1.2;
}

.site-user-text strong {
  font-size: 13px;
  font-weight: 600;
}

.site-user-grade {
  font-size: 11.5px;
  color: var(--faint);
}

.site-user-grade::before {
  content: "·";
  margin-right: 6px;
  color: var(--faint);
}

.site-logout .btn {
  height: 34px;
  padding: 0 13px;
  font-size: 13px;
}

/* 网站内容区：居中最大宽度，替代平板的贴边 + 底部导航留白 */
.page {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 26px 30px 56px;
}

@media (max-width: 820px) {
  .site-header-inner {
    flex-wrap: wrap;
    gap: 10px 16px;
    padding: 10px 18px;
  }

  .site-nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .site-nav a {
    padding: 7px 14px;
    white-space: nowrap;
  }

  .site-user-text {
    display: none;
  }

  .page {
    padding: 18px 18px 48px;
  }
}
