/* 砺行社网页版 · 与小程序同一套设计语言 */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
    --bg: #F5F4F0;
    --card: #FFFFFF;
    --ink: #1C1C1E;
    --sub: #3A3A3C;
    --mute: #8E8E93;
    --line: rgba(60, 60, 67, 0.12);
    --fill: #EFEFEB;
    --press: #E7E7E2;
    --gold: #B08D57;
    --gold-soft: #F4EDDE;
    --green: #2F6B54;
    --green-soft: #E7F0EC;
    --danger: #C6464B;
}

html { font-size: 16px; }
body {
    background: var(--bg);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    min-height: 100dvh;
}

.hidden { display: none !important; }

main { max-width: 640px; margin: 0 auto; padding: 12px 16px calc(84px + env(safe-area-inset-bottom)); }

/* ---------- 登录 ---------- */
#login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { width: 100%; max-width: 360px; background: var(--card); border-radius: 24px; padding: 40px 28px; text-align: center; }
.brand-mark {
    width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 50%;
    background: var(--green); color: #fff; font-size: 34px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    border: 4px solid #fff; box-shadow: 0 0 0 2px var(--gold);
}
.brand-name { font-size: 26px; font-weight: 700; letter-spacing: 2px; }
.brand-slogan { font-size: 13px; color: var(--gold); margin-top: 6px; margin-bottom: 28px; }
.login-form input {
    width: 100%; height: 48px; border: 1.5px solid var(--line); border-radius: 14px;
    background: var(--bg); padding: 0 16px; font-size: 16px; margin-bottom: 14px; outline: none;
}
.login-form input:focus { border-color: var(--gold); background: #fff; }
.err { color: var(--danger); font-size: 13px; margin-top: 12px; min-height: 20px; }
.login-hint { font-size: 12px; color: var(--mute); line-height: 1.6; margin-top: 14px; text-align: left; }

/* ---------- 按钮 ---------- */
.btn-primary {
    display: block; width: 100%; height: 48px; border: none; border-radius: 24px;
    background: var(--ink); color: #fff; font-size: 16px; font-weight: 600;
    cursor: pointer; transition: opacity .15s;
}
.btn-primary:active { opacity: .8; }
.btn-primary:disabled { opacity: .5; }
.btn-ghost {
    display: block; width: 100%; height: 44px; border: none; border-radius: 22px;
    background: var(--fill); color: var(--sub); font-size: 15px; cursor: pointer;
}
.btn-plain { background: none; border: none; color: var(--gold); font-size: 14px; cursor: pointer; padding: 6px 10px; }

/* ---------- 顶栏 ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--bg); max-width: 640px; margin: 0 auto; padding: 14px 20px 8px; }
.topbar__title { font-size: 20px; font-weight: 700; }
.topbar__sub { font-size: 12px; color: var(--mute); margin-top: 2px; }

/* ---------- 卡片 ---------- */
.card { background: var(--card); border-radius: 18px; padding: 18px 18px; margin-bottom: 14px; }
.card-title { font-size: 17px; font-weight: 700; }
.card-sub { font-size: 13px; color: var(--mute); margin-top: 4px; }

/* ---------- 今日 hero ---------- */
.hero { padding: 16px 20px 20px; }
.hero-eyebrow { font-size: 12px; color: var(--gold); font-weight: 600; letter-spacing: 1px; }
.hero-title { font-size: 34px; font-weight: 800; letter-spacing: -0.5px; margin-top: 6px; }
.hero-stage { font-size: 13px; color: var(--sub); margin-top: 6px; }
.progress { height: 6px; border-radius: 3px; background: var(--fill); margin-top: 16px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--gold); border-radius: 3px; transition: width .4s; }
.progress-meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--mute); margin-top: 6px; }

/* ---------- 表单 ---------- */
.field { margin-top: 16px; }
.field-label { font-size: 13px; color: var(--sub); margin-bottom: 8px; }
.field-label .req { color: var(--gold); }
textarea.input {
    width: 100%; min-height: 88px; border: 1.5px solid var(--line); border-radius: 14px;
    background: var(--bg); padding: 12px 14px; font-size: 15px; font-family: inherit;
    resize: vertical; outline: none; line-height: 1.6;
}
textarea.input:focus { border-color: var(--gold); background: #fff; }

/* 状态胶囊（三态） */
.seg { display: flex; background: var(--fill); border-radius: 20px; padding: 4px; }
.seg-item { flex: 1; height: 36px; border: none; background: none; border-radius: 17px; font-size: 14px; color: var(--sub); cursor: pointer; }
.seg-item.on { background: var(--ink); color: #fff; font-weight: 600; }

/* 账户 chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    height: 34px; padding: 0 16px; border: none; border-radius: 17px;
    background: var(--fill); color: var(--sub); font-size: 13px; cursor: pointer;
}
.chip.on { background: var(--gold-soft); color: var(--gold); font-weight: 600; }

/* ---------- 打卡结果卡 ---------- */
.done-card { border-left: 4px solid var(--green); }
.badge { display: inline-block; font-size: 12px; padding: 2px 10px; border-radius: 12px; }
.badge.done { background: var(--green-soft); color: var(--green); }
.badge.partial { background: var(--gold-soft); color: var(--gold); }
.badge.rest { background: var(--fill); color: var(--mute); }
.done-content { margin-top: 10px; font-size: 15px; white-space: pre-wrap; word-break: break-word; }
.done-meta { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--mute); }
.acc-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.acc-tag { font-size: 11px; color: var(--gold); background: var(--gold-soft); padding: 2px 10px; border-radius: 10px; }

/* 老师点评 */
.coach { margin-top: 12px; background: var(--green-soft); border-radius: 12px; padding: 12px 14px; }
.coach-label { font-size: 11px; color: var(--green); font-weight: 700; }
.coach-text { font-size: 14px; margin-top: 4px; white-space: pre-wrap; }

/* ---------- 我的 ---------- */
.stats { display: flex; align-items: center; }
.stats-item { flex: 1; text-align: center; }
.stats-num { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stats-label { font-size: 11px; color: var(--mute); margin-top: 2px; }
.stats-line { width: 1px; height: 32px; background: var(--line); }
.threestate { display: flex; justify-content: space-between; font-size: 12px; color: var(--sub); }
.threestate b.done { color: var(--green); }
.threestate b.partial { color: var(--gold); }
.threestate b.rest { color: var(--mute); }

.week { display: flex; justify-content: space-between; margin-top: 14px; }
.week-item { text-align: center; font-size: 11px; color: var(--mute); }
.week-item .n { margin-top: 4px; font-size: 12px; color: var(--sub); font-variant-numeric: tabular-nums; }
.week-dot { width: 26px; height: 26px; border-radius: 50%; background: var(--fill); margin: 4px auto; }
.week-dot.done { background: var(--green); }
.week-dot.review { background: var(--gold-soft); border: 1.5px solid var(--gold); }
.week-item.today .n { color: var(--ink); font-weight: 700; }

.grid66 { display: grid; grid-template-columns: repeat(11, 1fr); gap: 5px; margin-top: 14px; }
.g { aspect-ratio: 1; border-radius: 5px; background: #E9E9E4; }
.g.done { background: var(--green); }
.g.review { background: var(--gold-soft); }
.g.off { background: #EFEBDF; }
.g.today { outline: 2px solid var(--ink); outline-offset: 1px; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 11px; color: var(--mute); margin-top: 12px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.legend .lg-done { background: var(--green); }
.legend .lg-review { background: var(--gold-soft); }
.legend .lg-off { background: #EFEBDF; }
.legend .lg-miss { background: #E9E9E4; }

/* ---------- 目标卡 ---------- */
.section-title { font-size: 14px; font-weight: 700; margin: 18px 0 4px; }
.section-title:first-child { margin-top: 0; }
.goal-readonly .v { font-size: 15px; white-space: pre-wrap; word-break: break-word; margin: 6px 0 14px; }
.goal-readonly .k { font-size: 12px; color: var(--mute); }

/* ---------- 管理台 ---------- */
.admin-bar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; }
.admin-bar input[type="date"] {
    height: 40px; border: 1.5px solid var(--line); border-radius: 12px;
    background: var(--card); padding: 0 12px; font-size: 14px; outline: none; font-family: inherit;
}
.admin-stats { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.admin-stat { font-size: 12px; color: var(--sub); background: var(--card); border-radius: 14px; padding: 4px 14px; }
.admin-stat b { color: var(--ink); }
.admin-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.admin-tab { height: 36px; padding: 0 18px; border: none; border-radius: 18px; background: var(--card); font-size: 14px; color: var(--sub); cursor: pointer; }
.admin-tab.on { background: var(--ink); color: #fff; font-weight: 600; }

.entry { background: var(--card); border-radius: 16px; padding: 16px; margin-bottom: 12px; }
.entry-head { display: flex; justify-content: space-between; align-items: center; }
.entry-name { font-size: 15px; font-weight: 700; }
.entry-time { font-size: 11px; color: var(--mute); font-variant-numeric: tabular-nums; }
.entry-content { font-size: 14px; margin-top: 8px; white-space: pre-wrap; word-break: break-word; }
.comment-box { display: flex; gap: 8px; margin-top: 12px; }
.comment-box input {
    flex: 1; height: 40px; border: 1.5px solid var(--line); border-radius: 12px;
    background: var(--bg); padding: 0 12px; font-size: 14px; outline: none; font-family: inherit;
}
.comment-box input:focus { border-color: var(--gold); background: #fff; }
.comment-box button {
    height: 40px; padding: 0 18px; border: none; border-radius: 12px;
    background: var(--ink); color: #fff; font-size: 14px; cursor: pointer;
}

/* ---------- tabbar ---------- */
.tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    display: flex; justify-content: space-around; align-items: stretch;
    background: rgba(255, 255, 255, 0.94);
    -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
    border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
}
.tabbar button {
    flex: 1; max-width: 140px; border: none; background: none; padding: 10px 0 8px;
    font-size: 12px; color: var(--mute); cursor: pointer;
}
.tabbar button.on { color: var(--ink); font-weight: 700; }
.tabbar button.on::after { content: ""; display: block; width: 20px; height: 3px; border-radius: 2px; background: var(--gold); margin: 3px auto 0; }

/* 空态 / 提示 */
.state { text-align: center; padding: 48px 24px; color: var(--mute); font-size: 14px; }
.quote { font-size: 14px; color: var(--sub); background: var(--gold-soft); border-radius: 12px; padding: 12px 14px; margin-top: 14px; }
.toast {
    position: fixed; top: 20%; left: 50%; transform: translateX(-50%); z-index: 99;
    background: rgba(28, 28, 30, 0.88); color: #fff; font-size: 14px;
    padding: 10px 22px; border-radius: 20px; opacity: 0; transition: opacity .25s;
    pointer-events: none;
}
.toast.show { opacity: 1; }
.signout { text-align: center; font-size: 12px; color: var(--mute); padding: 18px 0; }
.signout a { color: var(--mute); text-decoration: underline; }
