/* 我的 — minimal, native-app settings screen: white page, black type,
   greys for everything secondary, hairlines instead of cards. The only
   colour is the macaron tile behind each menu icon. */
.me {
    --me-ink: #111111;
    --me-muted: #8e8e8e;
    --me-faint: #c4c4c4;
    --me-line: #efefef;
    --me-fill: #f5f5f5;

    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    padding-bottom: calc((var(--dock-h, 0px) + 2.5rem) / 2);
    color: var(--me-ink);
}
.me .icon { --icon-size: 1.125rem; width: var(--icon-size); height: var(--icon-size); font-size: var(--icon-size); display: inline-flex; align-items: center; justify-content: center; flex: none; line-height: 1; }

/* Header greeting: one line, cut off with an ellipsis if the name is long. */
.me-header-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Profile header */
.me-hero { display: flex; align-items: center; gap: 14px; padding: 8px 0 22px; color: var(--me-ink); text-decoration: none; transition: opacity 0.15s; }
.me-hero:active { opacity: 0.5; }
.me-avatar { width: 60px; height: 60px; flex: none; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: var(--me-fill); color: var(--me-ink); font-size: 22px; font-weight: 600; }
.me-avatar img { width: 100%; height: 100%; object-fit: cover; }
.me-who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; line-height: 1.3; }
.me-who strong { overflow: hidden; font-size: 19px; font-weight: 600; letter-spacing: -0.01em; text-overflow: ellipsis; white-space: nowrap; }
.me-who small { overflow: hidden; color: var(--me-muted); font-size: 13.5px; text-overflow: ellipsis; white-space: nowrap; }
.me-chev { --icon-size: 20px; flex: none; margin-left: auto; color: var(--me-faint); font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24; }

/* Stats: three numbers in a row, split by hairlines */
.me-stats { display: grid; grid-template-columns: repeat(3, 1fr); padding: 16px 0; border-top: 1px solid var(--me-line); border-bottom: 1px solid var(--me-line); }
.me-stats a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 2px 4px; color: var(--me-ink); text-align: center; text-decoration: none; transition: opacity 0.15s; }
.me-stats a + a { border-left: 1px solid var(--me-line); }
.me-stats a:active { opacity: 0.5; }
.me-stats strong { font-size: 22px; font-weight: 600; line-height: 1.2; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.me-stats small { color: var(--me-muted); font-size: 12px; line-height: 1.3; }
.me-stats .me-stat-note { color: var(--me-faint); font-size: 11px; }

/* Section labels and grouped rows */
.me-label { margin: 30px 0 4px; color: var(--me-muted); font-size: 11px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; }
.me-group { display: flex; flex-direction: column; margin: 0; }
.me-group > a, .me-group > button {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    min-height: 54px;
    padding: 10px 0;
    border: 0;
    background: transparent;
    color: var(--me-ink);
    font: inherit;
    font-size: 15.5px;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.15s;
}
.me-group > [hidden] { display: none; }
.me-group > :not(input) + :not(input)::before { content: ""; position: absolute; top: 0; left: 44px; right: 0; border-top: 1px solid var(--me-line); }
.me-group > a:active, .me-group > button:active { opacity: 0.5; }

.me-ic { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 8px; background: var(--me-fill); color: var(--me-ink); }
.me-ic .icon { --icon-size: 18px; font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24; }
.me-ic svg { width: 17px; height: 17px; }
.me-ic-neutral { background: var(--me-fill); color: var(--me-ink); }
/* Macaron tints, one per row (same palette as the SPM timetable). */
.me-ic[data-tint="peach"]    { background: #ffe9de; color: #a4532d; }
.me-ic[data-tint="lavender"] { background: #eee8fb; color: #6b55b0; }
.me-ic[data-tint="mint"]     { background: #e1f4ea; color: #3a7d5c; }
.me-ic[data-tint="sky"]      { background: #e2f0fa; color: #3a6f96; }
.me-ic[data-tint="lemon"]    { background: #fff5cf; color: #8a6b00; }
.me-ic[data-tint="pink"]     { background: #fde7ec; color: #b0485f; }

.me-text { flex: 1; min-width: 0; }
.me-value { color: var(--me-muted); font-size: 14px; }
.me-value + .me-chev { margin-left: 0; }

/* Log out: a lone red row */
form.me-group { margin-top: 30px; border-top: 1px solid var(--me-line); border-bottom: 1px solid var(--me-line); }
.me-group > .me-danger { justify-content: center; color: #e5484d; font-weight: 500; }
.me-group > .me-danger .me-text { flex: none; }

/* Buttons */
.me-btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 26px; border: 0; border-radius: 999px; background: var(--me-ink); color: #fff; font: inherit; font-size: 14.5px; font-weight: 500; text-decoration: none; cursor: pointer; transition: opacity 0.15s; }
.me-btn:active { opacity: 0.8; }
.me-btn .icon { --icon-size: 18px; }

/* Signed-out */
.me-guest { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 0 8px; text-align: center; }
.me-guest img { width: 112px; height: 112px; object-fit: contain; margin-bottom: 6px; }
.me-guest strong { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.me-guest p { max-width: 20rem; margin: 0 0 14px; color: var(--me-muted); font-size: 14px; line-height: 1.6; }

/* Profile progress card (currently hidden in the view) */
.me-progress { display: flex; align-items: center; gap: 1rem; padding: 1rem 0; }
.me-progress img { width: 5.5rem; height: 5.5rem; flex: none; object-fit: contain; }
.me-progress-body { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 0.55rem; }
.me-progress-body strong { font-size: 0.98rem; font-weight: 600; line-height: 1.4; }
.me-progress-body small { color: var(--me-muted); font-size: 0.82rem; line-height: 1.45; }
.me-bar { display: block; width: 100%; height: 4px; overflow: hidden; border-radius: 4px; background: var(--me-line); }
.me-bar i { display: block; height: 100%; border-radius: inherit; background: var(--me-ink); }

.me-foot { margin: 28px 0 8px; color: var(--me-faint); font-size: 11.5px; line-height: 1.7; text-align: center; }

/* ---------- Desktop: two columns. Profile and numbers on the left (kept
   in view while the menus scroll), menus on the right. ---------- */
.me-side, .me-main { min-width: 0; }

@media (min-width: 900px) {
    .me {
        display: grid;
        grid-template-columns: 300px minmax(0, 1fr);
        column-gap: 56px;
        align-items: start;
        max-width: 920px;
        padding-top: 24px;
        padding-bottom: 48px;
    }
    .me-side { position: sticky; top: 0; }
    .me-foot { grid-column: 1 / -1; margin-top: 40px; }

    .me-hero { flex-direction: column; align-items: center; gap: 12px; padding: 8px 0 24px; text-align: center; }
    .me-hero .me-chev { display: none; }
    .me-avatar { width: 96px; height: 96px; font-size: 34px; }
    .me-who { align-items: center; width: 100%; }
    .me-who strong { max-width: 100%; font-size: 21px; }
    .me-who small { max-width: 100%; }

    .me-main > .me-label:first-child { margin-top: 0; }
    .me-group > a, .me-group > button { border-radius: 10px; }

    .me-guest { padding-top: 24px; }
}

@media (min-width: 900px) and (hover: hover) {
    .me-hero:hover, .me-stats a:hover { opacity: 0.6; }
    .me-group > a:hover, .me-group > button:hover { opacity: 0.6; }
}
