/* ============================================================
   个人中心样式（抽自 user.html 内联 <style>）
   配色 / 圆角 / 字体统一走 ../../ui/css/base.css 设计令牌
   ============================================================ */

:root {
    --uc-radius: 12px;
}

body {
    padding: 0;
    background: var(--bg-soft);
    min-height: 100vh;
}

.uc-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---------- 顶栏 ---------- */
.uc-top {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 54px;
    padding: 0 18px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 30;
}

.uc-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
}

.uc-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.uc-mode {
    font-size: 11px;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 2px 10px;
}

.uc-top-actions {
    margin-left: auto;
    display: flex;
    gap: 6px;
}

/* ---------- 主体 ---------- */
.uc-body {
    flex: 1;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 16px;
}

.uc-side {
    width: 178px;
    flex: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--uc-radius);
    position: sticky;
    top: 70px;
}

.uc-nav-item {
    display: flex;
    align-items: center;
    gap: 9px;
    height: 36px;
    padding: 0 10px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    font-family: var(--font);
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    text-align: left;
    transition: background .15s, color .15s;
}

.uc-nav-item:hover {
    background: var(--bg-soft);
    color: var(--text);
}

.uc-nav-item.active {
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 600;
}

.uc-nav-item .uc-nav-badge {
    margin-left: auto;
    font-size: 11px;
    color: var(--text-faint);
    font-weight: 400;
}

.uc-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.uc-view {
    display: none;
    flex-direction: column;
    gap: 16px;
}

.uc-view.active {
    display: flex;
}

/* ---------- 卡片 ---------- */
.card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--uc-radius);
    padding: 18px;
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

.card-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
}

.card-action {
    border: 0;
    background: transparent;
    font-family: var(--font);
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 3px 8px;
    border-radius: 6px;
    transition: color .15s, background .15s;
}

.card-action:hover {
    color: var(--accent);
    background: var(--accent-soft);
}

/* ---------- 概览（纯文字标题行） ---------- */
.uc-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 2px 2px 0;
}

.uc-hero-main {
    flex: 1;
    min-width: 180px;
}

.uc-hero-name {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -.02em;
    line-height: 1.2;
}

.uc-hero-sub {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 3px;
}

.uc-hero-edit {
    border: 1px solid var(--border);
    background: var(--bg);
    font-family: var(--font);
    font-size: 12px;
    color: var(--text-secondary);
    height: 30px;
    padding: 0 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color .15s, color .15s;
}

.uc-hero-edit:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ---------- 统计 ---------- */
.uc-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--uc-radius);
    overflow: hidden;
}

.uc-stat {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    border-left: 1px solid var(--border);
    border-top: 1px solid var(--border);
}

.uc-stat:nth-child(1),
.uc-stat:nth-child(2),
.uc-stat:nth-child(3) {
    border-top: 0;
}

.uc-stat:nth-child(3n+1) {
    border-left: 0;
}

.uc-stat b {
    font-size: 24px;
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -.02em;
    font-variant-numeric: tabular-nums;
}

.uc-stat span {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ---------- 列表 ---------- */
.rows {
    display: flex;
    flex-direction: column;
}

.row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-top: 1px solid var(--border);
    font-size: 13px;
}

.row:first-child {
    border-top: 0;
    padding-top: 0;
}

.row-main {
    flex: 1;
    min-width: 0;
}

.row-title {
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.row-title a {
    color: var(--text);
    text-decoration: none;
}

.row-title a:hover {
    color: var(--accent);
}

.row-desc {
    font-size: 11px;
    color: var(--text-faint);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.row-side {
    flex: none;
    font-size: 11px;
    color: var(--text-faint);
}

.row-act {
    border: 0;
    background: transparent;
    cursor: pointer;
    font-size: 12px;
    color: var(--text-faint);
    padding: 2px 6px;
    border-radius: 6px;
    transition: color .15s, background .15s;
}

.row-act:hover {
    color: var(--accent);
    background: var(--accent-soft);
}

.row-act.danger:hover {
    color: var(--danger);
    background: var(--danger-soft);
}

.empty {
    font-size: 13px;
    color: var(--text-faint);
    text-align: center;
    padding: 34px 12px;
    border: 1px dashed var(--border-strong);
    border-radius: 10px;
}

/* ---------- 积分 ---------- */
.pts-total {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-variant-numeric: tabular-nums;
}

.pts-total b {
    font-size: 34px;
    font-weight: 700;
    letter-spacing: -1px;
}

.pts-total span {
    font-size: 13px;
    color: var(--text-secondary);
}

.pts-earn {
    color: var(--success);
    font-weight: 600;
}

.pts-spend {
    color: var(--danger);
    font-weight: 600;
}

/* ---------- 设置链接 ---------- */
/* ---------- 链接行（纯文字） ---------- */
.link-rows {
    display: flex;
    flex-direction: column;
}

.link-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 0;
    border-top: 1px solid var(--border);
    text-decoration: none;
    color: var(--text);
    transition: color .15s;
}

.link-row:first-child {
    border-top: 0;
    padding-top: 0;
}

.link-row:last-child {
    padding-bottom: 0;
}

.link-row:hover {
    color: var(--accent);
}

.link-main {
    flex: 1;
    min-width: 0;
}

.link-main b {
    display: block;
    font-size: 13px;
    font-weight: 600;
}

.link-main span {
    display: block;
    font-size: 11px;
    color: var(--text-faint);
    margin-top: 1px;
}

.link-row:hover .link-main span {
    color: var(--text-secondary);
}

.link-arrow {
    flex: none;
    font-size: 13px;
    color: var(--text-faint);
}

.link-row:hover .link-arrow {
    color: var(--accent);
}

/* ---------- 提示 ---------- */
.toast {
    position: fixed;
    left: 50%;
    bottom: 32px;
    transform: translate(-50%, 12px);
    background: var(--text);
    color: #fff;
    font-size: 13px;
    padding: 9px 16px;
    border-radius: 10px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s, transform .2s;
    z-index: 200;
    box-shadow: 0 12px 28px -14px rgba(0, 0, 0, .5);
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

.toast.toast-success {
    background: var(--success);
}

.toast.toast-error {
    background: var(--danger);
}

/* ---------- 通用控件（自包含，避免依赖 main.css） ---------- */
.mini-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 32px;
    padding: 0 14px;
    border: 0;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font-family: var(--font);
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    text-decoration: none;
    transition: filter .15s, border-color .15s, color .15s;
}

.mini-btn:hover { filter: brightness(1.06); }

.mini-btn.ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.mini-btn.ghost:hover {
    border-color: var(--accent);
    color: var(--accent);
    filter: none;
}

.mini-btn:disabled { opacity: .6; cursor: default; }

.form-control {
    width: 100%;
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 13px;
}

.form-control::placeholder { color: var(--text-faint); }

.form-control:focus {
    outline: none;
    border-color: var(--accent);
}

/* 开关 */
.uc-switch {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 20px;
    flex: none;
}

.uc-switch input { opacity: 0; width: 0; height: 0; }

.uc-switch .uc-slider {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: var(--border-strong, #cbd5e1);
    cursor: pointer;
    transition: background .18s;
}

.uc-switch .uc-slider:before {
    content: "";
    position: absolute;
    left: 2px;
    top: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
    transition: transform .18s;
}

.uc-switch input:checked + .uc-slider { background: var(--accent); }
.uc-switch input:checked + .uc-slider:before { transform: translateX(18px); }

/* ---------- 账户 · 云端同步 ---------- */
.uc-acct { padding: 16px 18px; }

.uc-acct-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

.uc-acct-chip {
    font-size: 11px;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 2px 10px;
    white-space: nowrap;
}

.uc-acct-user {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.uc-acct-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #7c5cff, #5b8cff);
    color: #fff;
    font-size: 17px;
    font-weight: 600;
}

.uc-acct-meta { min-width: 0; }

.uc-acct-name {
    font-size: 15px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.uc-acct-mail {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.uc-acct-sync {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.uc-acct-auto-label { font-size: 13px; }

.uc-acct-pill {
    font-size: 11px;
    color: var(--accent);
    background: var(--accent-soft);
    border-radius: 999px;
    padding: 3px 10px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.uc-acct-status {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 8px;
    word-break: break-all;
}

.uc-acct-status.err { color: var(--danger); }

.uc-acct-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.uc-acct-tip {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0 0 4px;
}

.uc-acct-api {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed var(--border);
}

.uc-acct-api>label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.uc-acct-api-row { display: flex; gap: 8px; }

.uc-acct-api-row .form-control { flex: 1; min-width: 0; }

@media (max-width: 860px) {
    .uc-body {
        flex-direction: column;
        align-items: stretch; /* 基础规则是 flex-start（左右布局顶对齐用），切为上下布局后必须恢复拉伸，否则主区会缩成内容宽度 */
        padding: 12px;
    }

    .uc-side {
        width: 100%;
        position: static;
        flex-direction: row;
        overflow-x: auto;
        gap: 4px;
    }

    .uc-nav-item {
        white-space: nowrap;
    }

    .uc-nav-item .uc-nav-badge {
        display: none;
    }

    .uc-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .uc-stat:nth-child(3) {
        border-top: 1px solid var(--border);
    }

    .uc-stat:nth-child(2n+1) {
        border-left: 0;
    }

    .uc-acct { padding: 14px; }


    .uc-main, 
    .uc-view {
        padding-right: 0; /* 或者 padding: 0; */
    }
    .uc-main .uc-view .card {
        width: 100%;
        flex: 1;
        margin-left: 0;
        margin-right: 0;
        margin-top: 12px; 
        box-sizing: border-box; /* 确保 padding 不会撑破 100% */
    }
}

@media (max-width: 560px) {
    .uc-top {
        height: auto;
        min-height: 54px;
        padding: 8px 12px;
        flex-wrap: wrap;
        row-gap: 6px;
    }

    .uc-top-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .uc-body { padding: 12px; }

    .uc-hero { gap: 10px; }

    .uc-hero-name { font-size: 19px; }

    .card { padding: 14px; }

    .uc-stat { padding: 12px; }

    .uc-stat b { font-size: 20px; }

    .uc-acct-actions .mini-btn { flex: 1 1 auto; }

    .uc-acct-api-row { flex-direction: column; }

    .uc-acct-api-row .mini-btn { width: 100%; }

    .row { flex-wrap: wrap; }

    .row-side { margin-left: auto; }

    .row-act { margin-left: auto; }

    .uc-main, 
    .uc-view {
        padding-right: 0; /* 或者 padding: 0; */
    }
    .uc-main .uc-view .card {
        width: 100%;
        flex: 1;
        margin-left: 0;
        margin-right: 0;
        margin-top: 12px; 
        box-sizing: border-box; /* 确保 padding 不会撑破 100% */
    }
}
/* 卡片脚注 */
.card-note { font-size: 12px; color: var(--text-faint); margin-top: 8px; }
