/* 家教平台 全局样式 —— 移动端优先 */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: #f5f6fa; color: #333; line-height: 1.6;
}
a { color: #4a6cf7; text-decoration: none; }
a:hover { opacity: .85; }

/* 顶栏 */
.topbar {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap;
  background: #fff; padding: 12px 20px; box-shadow: 0 1px 4px rgba(0,0,0,.06);
  position: sticky; top: 0; z-index: 10;
}
.brand { font-size: 18px; font-weight: 700; color: #333; display: inline-flex; align-items: center; gap: 6px; }
.brand .icon { color: #4a6cf7; }
.topnav { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; font-size: 14px; }
.topnav .logout { color: #e74c3c; }

/* 通用矢量图标 */
.icon { display: inline-block; vertical-align: -3px; flex-shrink: 0; }
.card h3 { display: flex; align-items: center; gap: 8px; }
.card h3 .icon { color: #4a6cf7; }

/* 回退键 */
.back-bar { margin-bottom: 14px; }
.back-link {
  display: inline-block; font-size: 13px; color: #666; background: #fff;
  padding: 6px 12px; border-radius: 8px; box-shadow: 0 1px 2px rgba(0,0,0,.05);
}
.back-link:hover { color: #4a6cf7; }

.container { max-width: 820px; margin: 0 auto; padding: 20px 16px 40px; }
.page-title { font-size: 22px; margin-bottom: 18px; }

/* 卡片 */
.card {
  background: #fff; border-radius: 12px; padding: 18px; margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.card h3 { font-size: 16px; margin-bottom: 12px; }
.card.warn { background: #fff7e6; border: 1px solid #ffd591; }

/* 首页模块 */
.hero { text-align: center; padding: 28px 0 8px; }
.hero h1 { font-size: 26px; margin-bottom: 6px; }
.hero p { color: #777; }
.modules { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 22px 0; }
.module-card {
  background: #fff; border-radius: 14px; padding: 26px 18px; text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.06); color: #333; transition: transform .15s;
}
.module-card:hover { transform: translateY(-3px); }
.module-icon { display: flex; justify-content: center; color: #4a6cf7; }
.card-parent .module-icon { color: #f5a623; }
.module-card h2 { margin: 10px 0 6px; font-size: 18px; }
.module-card p { color: #888; font-size: 13px; }
.card-student { border-top: 4px solid #4a6cf7; }
.card-parent { border-top: 4px solid #f5a623; }
.notice { text-align: center; color: #666; margin-top: 10px; }
.notice .small { font-size: 12px; color: #aaa; margin-top: 4px; }

/* 表单 */
form label { display: block; margin: 12px 0 4px; font-size: 13px; color: #666; }
input, textarea, select {
  width: 100%; padding: 10px 12px; border: 1px solid #ddd; border-radius: 8px;
  font-size: 14px; font-family: inherit; background: #fafafa;
}
input:focus, textarea:focus { border-color: #4a6cf7; outline: none; background: #fff; }
textarea { resize: vertical; }
.btn {
  display: inline-block; padding: 10px 18px; border: none; border-radius: 8px;
  background: #eee; color: #333; cursor: pointer; font-size: 14px; text-align: center;
}
.btn:hover { opacity: .9; }
.btn-primary { background: #4a6cf7; color: #fff; }
.btn-code { background: #4a6cf7; color: #fff; white-space: nowrap; }
.btn-block { width: 100%; margin-top: 16px; }
.btn-row { margin-top: 12px; display: flex; gap: 10px; flex-wrap: wrap; }
.btn-mini { padding: 4px 10px; font-size: 12px; border: none; border-radius: 6px; background: #eee; cursor: pointer; }
.btn-mini.danger { background: #fde8e8; color: #d64545; }
.inline { display: inline; }

/* 闪屏消息 */
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; font-size: 14px; }
.flash-ok { background: #e6f7ec; color: #27ae60; }
.flash-error { background: #fdecec; color: #d64545; }

/* 登录 */
.login-wrap { max-width: 420px; margin: 30px auto; background: #fff; border-radius: 14px; padding: 26px; box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.login-wrap h2 { text-align: center; margin-bottom: 4px; }
.login-wrap .small { text-align: center; color: #999; font-size: 12px; margin-bottom: 10px; }
.code-row { display: flex; gap: 8px; }
.code-row input { flex: 1; }
.role-pick label { display: flex; align-items: center; gap: 6px; font-size: 14px; color: #444; }
.role-pick input { width: auto; }
.tip { font-size: 12px; color: #999; margin-top: 12px; }

/* 信息列表 */
.kv { display: grid; grid-template-columns: 90px 1fr; font-size: 14px; }
.kv dt { color: #999; }
.kv dd { color: #333; }
.list-item { padding: 12px 0; border-bottom: 1px solid #f0f0f0; }
.list-item:last-child { border-bottom: none; }
.list-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.muted { color: #888; font-size: 13px; margin: 3px 0; }

/* 标签 */
.tag { display: inline-block; font-size: 12px; padding: 2px 10px; border-radius: 20px; background: #f0f0f0; color: #666; }
.tag-ok { background: #e6f7ec; color: #27ae60; }
.tag-hot { background: #fff1e6; color: #f5a623; }
.tag-off { background: #f0f0f0; color: #aaa; }

/* 证书 */
.cert-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-top: 12px; }
.cert-item { border: 1px solid #eee; border-radius: 10px; overflow: hidden; }
.cert-item img { width: 100%; height: 110px; object-fit: cover; display: block; background: #f7f7f7; }
.cert-meta { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px; font-size: 12px; }

/* 统计 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat-box { background: #fff; border-radius: 12px; padding: 18px; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.stat-box b { font-size: 26px; color: #4a6cf7; display: block; }
.stat-box span { font-size: 12px; color: #888; }

/* 表格 */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 10px 8px; border-bottom: 1px solid #f0f0f0; text-align: left; }
.table th { color: #999; font-weight: 500; }
.table .ops { display: flex; gap: 6px; align-items: center; }

/* 标签页 */
.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tab { padding: 8px 18px; border-radius: 20px; background: #fff; color: #666; font-size: 14px; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.tab.on { background: #4a6cf7; color: #fff; }

/* 页脚 */
.footer {
  border-top: 1px solid #eee; padding: 16px; background: #fff;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap;
  font-size: 12px; color: #aaa;
}
.corner-links a { margin-left: 14px; color: #999; }

@media (max-width: 520px) {
  .modules { grid-template-columns: 1fr; }
  .topnav { font-size: 13px; gap: 10px; }
}
