* {
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
}

body {
    margin: 0;
    background: #f2f4f7;
    color: #222222;
    font-family: "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

.page {
    width: 100%;
    max-width: 800px;
    min-height: 100vh;
    margin: 0 auto;
    background: #f2f4f7;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: 56px 1fr 56px;
    align-items: center;
    height: 44px;
    background: #08c25e;
    color: #ffffff;
    text-align: center;
}

.topbar h1 {
    margin: 0;
    font-size: 18px;
}

.topbar-back {
    border: 0;
    background: none;
    color: #ffffff;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
}

.topbar-home {
    font-size: 14px;
}

/* 期数选择 */
.st-control {
    position: sticky;
    top: 44px;
    z-index: 20;
    padding: 10px 10px 8px;
    background: #ffffff;
    border-bottom: 1px solid #e8e8e8;
}

.st-control-title {
    margin-bottom: 8px;
    font-size: 16px;
    font-weight: 700;
}

.st-periods {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
}

.st-periods::-webkit-scrollbar {
    display: none;
}

.st-periods button {
    flex: 0 0 auto;
    padding: 5px 14px;
    border: 1px solid #dcdfe4;
    border-radius: 15px;
    background: #f7f8fa;
    color: #444444;
    font-size: 14px;
    cursor: pointer;
}

.st-periods button.is-active {
    border-color: #08c25e;
    background: #08c25e;
    color: #ffffff;
}

.st-summary {
    margin-top: 8px;
    color: #7a828c;
    font-size: 13px;
}

.st-main {
    padding: 10px 10px 30px;
}

/* 图表卡片 */
.st-card {
    margin-bottom: 12px;
    overflow: hidden;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    --accent: #e5262c;
    --accent2: #ff6b5e;
    --tint: #fff1f0;
}

.st-t-blue {
    --accent: #1e6fe8;
    --accent2: #4aa3ff;
    --tint: #eef5ff;
}

.st-t-green {
    --accent: #12a150;
    --accent2: #4cd081;
    --tint: #effaf3;
}

.st-card h2 {
    margin: 0;
    padding: 8px 14px;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    color: #ffffff;
    font-size: 18px;
    letter-spacing: 1px;
}

.st-card > p {
    margin: 0;
    padding: 5px 14px;
    background: var(--tint);
    color: #7a828c;
    font-size: 13px;
}

.st-scroll {
    overflow-x: auto;
    padding: 6px 4px 8px;
}

.st-svg {
    display: block;
    width: 100%;
    height: auto;
}

.st-scroll .st-svg {
    min-width: 760px;
}

.st-axis {
    fill: #9aa1ab;
    font-size: 11px;
}

.st-num {
    font-size: 11px;
    font-weight: 700;
}

.st-val {
    fill: #333333;
    font-size: 11px;
    font-weight: 700;
    text-anchor: middle;
}

.st-zero {
    fill: #c0c5cc;
    font-weight: 400;
}

.st-avg {
    fill: #f08c00;
    font-size: 12px;
    font-weight: 700;
}

/* 饼图 + 图例 */
.st-pie {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 14px 24px;
    padding: 14px 12px 16px;
}

.st-pie .st-svg {
    width: 260px;
    max-width: 100%;
}

.st-pie-text {
    fill: #ffffff;
    font-size: 15px;
    font-weight: 800;
}

.st-legend {
    flex: 1 1 220px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    min-width: 200px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.st-legend li {
    display: grid;
    grid-template-columns: 14px 1fr auto;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.st-legend i {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.st-legend span {
    color: #7a828c;
    font-size: 13px;
}

.st-empty {
    padding: 40px 0;
    color: #9aa1ab;
    text-align: center;
}
