/* ============================================================
   气质少年成长银行 - 全局样式
   三套配色：玩学币(绿 #2E9E5B) / 向阳币(黄 #F5B301) / 玩美币(粉 #F27BA4)
   ============================================================ */

:root {
    --wx: #2E9E5B;
    --xy: #F5B301;
    --wm: #F27BA4;
    --text: #333;
    --text-light: #888;
    --bg: #f5f7fa;
    --card-bg: #fff;
    --border: #e6e9ef;
    --radius: 12px;
    --shadow: 0 2px 8px rgba(30, 41, 59, .06);
}

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

body {
    font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
}

a { color: inherit; text-decoration: none; }

/* ---------- 顶部导航 ---------- */
.topbar {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar .brand {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
}

.topbar .brand em { font-style: normal; color: var(--wx); }

.topbar .user-box { display: flex; align-items: center; gap: 12px; color: var(--text-light); font-size: 13px; }

.topbar .user-box a { color: #1f6feb; }

/* ---------- 布局 ---------- */
.container { max-width: 1080px; margin: 24px auto; padding: 0 16px; }

.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 16px;
}

.card h3 { font-size: 16px; margin-bottom: 14px; color: #1f2937; }

.card-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.card-title h3 { margin-bottom: 0; }

/* ---------- 学生信息 ---------- */
.stu-head { display: flex; align-items: center; gap: 14px; }
.avatar {
    width: 52px; height: 52px; border-radius: 50%;
    background: linear-gradient(135deg, var(--wx), #7fd4a5);
    color: #fff; font-size: 22px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}
.stu-head .name { font-size: 18px; font-weight: 700; }
.stu-head .meta { color: var(--text-light); font-size: 13px; }

/* ---------- 三币余额卡片 ---------- */
.coin-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.coin-card { border-radius: var(--radius); padding: 18px; color: #fff; position: relative; overflow: hidden; }
.coin-card .c-name { font-size: 14px; opacity: .92; }
.coin-card .c-balance { font-size: 34px; font-weight: 800; margin: 6px 0 2px; }
.coin-card .c-balance small { font-size: 14px; font-weight: 400; opacity: .9; }
.coin-card .c-sub { font-size: 12px; opacity: .85; }
.coin-card::after {
    content: ""; position: absolute; right: -24px; top: -24px;
    width: 96px; height: 96px; border-radius: 50%; background: rgba(255,255,255,.15);
}

.coin-wx { background: linear-gradient(135deg, #2E9E5B, #3fbf73); }
.coin-xy { background: linear-gradient(135deg, #E8A800, #F5B301); }
.coin-wm { background: linear-gradient(135deg, #E05A8A, #F27BA4); }

/* ---------- 小树 ---------- */
.tree-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.tree-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    text-align: center;
    background: #fff;
}
.tree-card .tree-name { font-weight: 700; font-size: 15px; }
.tree-card .tree-stage { margin: 8px 0 4px; }
.tree-card .tree-stage b { font-size: 20px; }
.tree-card .tree-guide { color: var(--text-light); font-size: 12px; min-height: 36px; }
.tree-card .tree-progress { color: var(--text-light); font-size: 12px; margin-top: 6px; }
.tree-icon { font-size: 52px; line-height: 1.2; display: block; margin: 6px 0; }
.tree-progress-bar { height: 6px; background: #eef1f5; border-radius: 3px; margin-top: 8px; overflow: hidden; }
.tree-progress-bar i { display: block; height: 100%; border-radius: 3px; transition: width .6s; }

/* ---------- 流水表 ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { background: #f8fafc; color: #64748b; font-weight: 600; }
tr:hover td { background: #fafbfc; }

.tag { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; }
.tag-deposit { background: #e7f6ec; color: #1d7a44; }
.tag-redeem  { background: #fdeef3; color: #c2417c; }
.tag-refund  { background: #fff7e6; color: #b45309; }
.tag-adjust  { background: #eef2ff; color: #4f46e5; }

.plus { color: #1d7a44; font-weight: 700; }
.minus { color: #c2417c; font-weight: 700; }

/* ---------- 按钮与表单 ---------- */
.btn {
    display: inline-block; padding: 8px 18px; border: none; border-radius: 8px;
    font-size: 14px; cursor: pointer; background: #eef1f5; color: #333; transition: .2s;
}
.btn:hover { opacity: .88; }
.btn-primary { background: var(--wx); color: #fff; }
.btn-warn { background: var(--xy); color: #fff; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-sm { padding: 4px 12px; font-size: 12px; }

.form-row { margin-bottom: 14px; }
.form-row label { display: block; margin-bottom: 6px; color: #475569; font-size: 13px; }
.form-row input, .form-row select, .form-row textarea {
    width: 100%; padding: 9px 12px; border: 1px solid var(--border);
    border-radius: 8px; font-size: 14px; outline: none;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus { border-color: var(--wx); }

/* ---------- 提示 ---------- */
.alert { padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; font-size: 13px; display: none; }
.alert-error { background: #fef2f2; color: #b91c1c; }
.alert-success { background: #f0fdf4; color: #15803d; }

.empty { text-align: center; color: var(--text-light); padding: 30px 0; }

/* ---------- 登录页 ---------- */
.login-wrap { max-width: 420px; margin: 80px auto; }
.login-card { background: #fff; border-radius: 16px; box-shadow: var(--shadow); padding: 32px; }
.login-card h2 { text-align: center; margin-bottom: 6px; }
.login-card .sub { text-align: center; color: var(--text-light); font-size: 13px; margin-bottom: 24px; }

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
    .coin-grid, .tree-grid { grid-template-columns: 1fr; }
    .container { margin: 12px auto; }
}

.hidden { display: none !important; }
