/* ============================================================
 * 个人中心页样式 - 左侧 tab 导航 + 右侧内容
 * 卡片/按钮语言与 list.css、friends.css 保持一致
 * ============================================================ */

/* ===== 布局：桌面端左 tab + 右内容 ===== */
.account-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}
.account-tabs {
    flex: 0 0 160px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: white;
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    position: sticky;
    top: 20px;
}
.account-tab {
    padding: 10px 14px;
    border: 2px solid transparent;
    background: white;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #4a5568;
    text-align: left;
    white-space: nowrap;
    transition: all 0.2s;
}
.account-tab:hover { border-color: #5a67d8; color: #5a67d8; }
.account-tab.active { background: #5a67d8; color: white; }
.account-main { flex: 1; min-width: 0; }
.account-main .card { margin-bottom: 0; }

/* 移动端：tab 变横向滚动条 */
@media (max-width: 768px) {
    .account-layout { flex-direction: column; }
    /* 列向布局下 align-items:flex-start 会把 .account-main 收缩成内容宽度：
       内容窄的面板「没占满」、内容宽的面板直接把页面顶出屏——强制与容器同宽 */
    .account-main { width: 100%; }
    .account-tabs {
        flex: none;
        width: 100%;
        flex-direction: row;
        overflow-x: auto;
        position: static;
        padding: 10px;
    }
    .account-tab { flex: 0 0 auto; text-align: center; }
}

.section-title {
    color: #4a5568;
    font-size: 15px;
    margin: 20px 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #edf2f7;
}
.tab-panel > .section-title:first-of-type { margin-top: 4px; }

/* ===== Tab1 我的内容 ===== */
/* 文章卡片复用 list.css 的 .feed-card 系列类 */
.feed-card.card-clickable { cursor: pointer; }

/* ===== Tab2 会员中心 ===== */
.member-card {
    border-radius: 12px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    margin-bottom: 8px;
}
.member-card .member-status { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.member-card .member-expire { font-size: 13px; opacity: .9; margin-bottom: 12px; }
.member-card .member-balance { font-size: 14px; margin-bottom: 14px; }
.member-card .member-balance strong { font-size: 20px; }
.member-card button {
    padding: 8px 18px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    margin-right: 8px;
    background: rgba(255,255,255,.92);
    color: #5a67d8;
}
.member-card button:hover { background: white; }

/* ===== 会员权益对比表（会员中心）：会员列金色高亮，✓绿/✕灰 ===== */
.compare-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    color: #4a5568;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.compare-table th, .compare-table td {
    padding: 9px 12px;
    text-align: center;
    border-bottom: 1px solid #edf2f7;
    word-break: break-word;
}
.compare-table th:first-child, .compare-table td:first-child { text-align: left; }
.compare-table thead th { background: #f7fafc; font-weight: 600; color: #2d3748; }
.compare-table .col-vip { background: rgba(214,158,46,.08); color: #975a16; font-weight: 600; }
.compare-table thead .col-vip {
    background: linear-gradient(135deg, #b7791f, #d69e2e);
    color: #fff;
}
.compare-table tbody tr:last-child td { border-bottom: none; }
.compare-table .ok { color: #48bb78; font-weight: 700; }
.compare-table .no { color: #cbd5e0; }

/* ===== 今日用量（会员中心）：每项一行 已用/上限 + 小进度条，用尽变红 ===== */
.usage-item { margin-bottom: 12px; }
.usage-item .usage-head {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #2d3748;
    margin-bottom: 4px;
}
.usage-item .usage-count { color: #718096; }
.usage-item .usage-count.full { color: #e53e3e; font-weight: 600; }
.usage-item .usage-bar {
    height: 6px;
    border-radius: 3px;
    background: #edf2f7;
    overflow: hidden;
}
.usage-item .usage-fill {
    height: 100%;
    border-radius: 3px;
    background: #5a67d8;
    transition: width .3s;
}
.usage-item .usage-fill.full { background: #e53e3e; }

.theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
}
.theme-item {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
}
.theme-item:hover { border-color: #5a67d8; transform: translateY(-2px); }
.theme-item.current { border-color: #48bb78; box-shadow: 0 0 0 3px rgba(72,187,120,.2); }
.theme-item.locked { opacity: .75; cursor: not-allowed; }
.theme-item.locked:hover { border-color: #cbd5e0; transform: none; }
.theme-item .theme-icon { font-size: 28px; margin-bottom: 6px; }
.theme-item .theme-name { font-size: 13px; font-weight: 600; color: #2d3748; }
.theme-item .theme-tag {
    display: inline-block;
    margin-top: 6px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    background: #edf2f7;
    color: #718096;
}
.theme-item .theme-tag.free { background: #c6f6d5; color: #22543d; }
.theme-item .theme-tag.member { background: #feebc8; color: #7b341e; }
.store-hint { margin-top: 14px; font-size: 12px; color: #a0aec0; }

/* ===== 会员套餐卡片（风格同 .theme-item，年度卡高亮边框表示推荐） ===== */
.plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}
.plan-card {
    position: relative;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 18px 16px;
    text-align: center;
    background: white;
    transition: all 0.2s;
}
.plan-card:hover { border-color: #5a67d8; transform: translateY(-2px); }
.plan-card.recommended { border-color: #5a67d8; box-shadow: 0 0 0 3px rgba(90,103,216,.15); }
.plan-badge {
    position: absolute;
    top: -10px;
    right: 12px;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 11px;
    background: #feebc8;
    color: #7b341e;
}
.plan-name { font-size: 15px; font-weight: 700; color: #2d3748; }
.plan-price { font-size: 28px; font-weight: 700; color: #5a67d8; margin: 8px 0 2px; }
.plan-price .plan-unit { font-size: 13px; font-weight: 600; color: #a0aec0; }
.plan-days { font-size: 12px; color: #a0aec0; margin-bottom: 10px; }
.plan-perks {
    list-style: none;
    margin: 0 0 14px;
    padding: 0;
    text-align: left;
    font-size: 13px;
    color: #4a5568;
    line-height: 1.9;
}
.plan-perks li::before { content: '✓ '; color: #48bb78; font-weight: 700; }
.plan-card .btn { width: 100%; }
.plan-hint { margin-top: 10px; font-size: 12px; color: #a0aec0; }

/* ===== Tab3 浏览记录 ===== */
.history-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}
.pause-switch {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #4a5568;
    cursor: pointer;
    user-select: none;
}
.pause-switch input { width: 16px; height: 16px; cursor: pointer; }
.btn-clear {
    padding: 7px 16px;
    border: 1px solid #fed7d7;
    background: white;
    color: #c53030;
    border-radius: 16px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
}
.btn-clear:hover { background: #fed7d7; }
.paused-banner {
    background: #edf2f7;
    color: #718096;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 13px;
    margin-bottom: 12px;
}
.history-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 4px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.15s;
}
.history-item:hover { background: #f7fafc; }
.history-item:last-child { border-bottom: none; }
.history-item .h-icon { font-size: 18px; }
.history-item .h-title {
    flex: 1;
    font-size: 14px;
    color: #2d3748;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.history-item .h-time { font-size: 12px; color: #a0aec0; white-space: nowrap; }

/* ===== Tab4 账号设置 ===== */
.profile-box { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.profile-meta { flex: 1; min-width: 0; }
.profile-nick { font-size: 17px; font-weight: 700; color: #2d3748; }
.profile-username { font-size: 13px; color: #a0aec0; margin: 2px 0 10px; }
.settings-info {
    background: #f7fafc;
    border-radius: 10px;
    padding: 14px 16px;
    font-size: 14px;
    color: #4a5568;
    line-height: 1.9;
}
.settings-info strong { color: #2d3748; }
.sso-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 4px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    color: #4a5568;
}
.sso-item:last-child { border-bottom: none; }
.sso-item .sso-provider { font-weight: 600; color: #2d3748; }
.sso-item .sso-time { font-size: 12px; color: #a0aec0; }
/* 邀请码列表（复用 sso-item 的行式风格） */
.invite-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 4px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    color: #4a5568;
}
.invite-item:last-child { border-bottom: none; }
.invite-item .invite-code {
    font-weight: 600; color: #2d3748; font-family: monospace; font-size: 15px;
    cursor: pointer; letter-spacing: 1px;
}
.invite-item .invite-code:hover { color: #5a67d8; }
.invite-item .invite-status { font-size: 12px; color: #38a169; }
.invite-item .invite-status.used { color: #a0aec0; }

/* ===== Toast ===== */
.acc-toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: rgba(45,55,72,.95);
    color: white;
    padding: 10px 22px;
    border-radius: 20px;
    font-size: 14px;
    z-index: 99999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s, transform 0.25s;
    max-width: 80vw;
}
.acc-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ===== 内容权限下拉（我的思维导图/文章卡片） ===== */
.vis-select {
    padding: 3px 6px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f7fafc;
    color: #4a5568;
    font-size: 12px;
    cursor: pointer;
}
.vis-select:hover { border-color: #5a67d8; }
.vis-select:disabled { opacity: .6; cursor: wait; }

/* ===== 浏览记录「加载更多」 ===== */
.history-more { text-align: center; padding: 14px 0 4px; }
.history-more .btn-more {
    padding: 7px 22px;
    border: 1px solid #e2e8f0;
    background: white;
    color: #5a67d8;
    border-radius: 16px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
}
.history-more .btn-more:hover { background: #5a67d8; color: white; }
.history-more .h-more-text { font-size: 12px; color: #a0aec0; }

/* ===== 手机号绑定 ===== */
.phone-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.phone-status { font-size: 14px; color: #718096; margin-bottom: 12px; }

/* ===== 昵称冷却提示 ===== */
.nick-cooldown { font-size: 12px; color: #dd6b20; margin: -8px 0 10px; }

/* ===== 修改密码弹窗 ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 9998;
    display: flex;
    justify-content: center;
    align-items: center;
}
.modal-overlay.hidden { display: none; }
.modal-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.3);
}
.modal-card h3 { margin: 0 0 14px; color: #4a5568; font-size: 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }


/* ===== 移动端补充（≤768px，顶部横滚 tab 见上方已有规则，这里补触控目标与弹窗） ===== */
@media (max-width: 768px) {
    .account-tabs { gap: 6px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
    .account-tabs::-webkit-scrollbar { display: none; }
    .account-tab { min-height: 40px; padding: 10px 16px; }
    /* 触控目标 ≥36px */
    .member-card button { min-height: 36px; margin-bottom: 6px; }
    /* 对比表窄屏压缩内边距防溢出 */
    .compare-table th, .compare-table td { padding: 7px 6px; font-size: 12px; }
    .btn-clear, .history-more .btn-more { min-height: 36px; }
    .vis-select { padding: 6px 8px; min-height: 36px; }
    #tab-settings .btn { min-height: 44px; }
    /* 修改密码弹窗贴边且超高可滚 */
    .modal-card { width: calc(100% - 24px); padding: 18px; max-height: 90dvh; overflow-y: auto; }
}


/* ===== 账号设置 tab：专家认证区（account-expert.js） ===== */
.expert-status { background: #f7fafc; border-radius: 10px; padding: 14px 16px; font-size: 14px; color: #4a5568; }
.expert-status-title { font-weight: 600; color: #2d3748; display: inline-flex; align-items: center; }
.expert-status-sub { font-size: 13px; color: #718096; margin-top: 6px; }
.expert-status .btn { margin-top: 10px; }
.expert-statement { margin-top: 8px; font-size: 13px; background: #fff; border: 1px solid #edf2f7; border-radius: 8px; padding: 10px 12px; white-space: pre-wrap; word-break: break-word; }
.expert-hint { font-size: 13px; color: #718096; margin-bottom: 10px; }
/* 三级审核进度条：已过阶段打勾，当前阶段高亮 */
.expert-progress { display: flex; align-items: flex-start; margin: 12px 0 4px; }
.ep-step { display: flex; flex-direction: column; align-items: center; font-size: 12px; color: #a0aec0; min-width: 52px; }
.ep-dot { width: 26px; height: 26px; border-radius: 50%; background: #e2e8f0; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; margin-bottom: 4px; }
.ep-step.done { color: #48bb78; }
.ep-step.done .ep-dot { background: #48bb78; }
.ep-step.current { color: #5a67d8; font-weight: 600; }
.ep-step.current .ep-dot { background: #5a67d8; }
.ep-line { flex: 1; height: 2px; background: #e2e8f0; margin: 12px 6px 0; }
.ep-line.done { background: #48bb78; }
/* 证书/证件照已传文件列表 */
.expert-file-list { margin-top: 8px; }
.expert-file-item { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 6px 10px; background: #fff; border: 1px solid #edf2f7; border-radius: 8px; margin-bottom: 6px; }
.expert-file-item .ef-name { flex: 1; word-break: break-all; color: #4a5568; }
.expert-file-item .ef-del { color: #e53e3e; cursor: pointer; border: none; background: none; font-size: 13px; }
.expert-field-hint { font-size: 12px; color: #dd6b20; margin-top: 4px; }

/* ===== 我的笔记 tab（account-notes.js）：笔记卡片（内容默认折叠 3 行）+ 引用 + 来源 + 编辑态 ===== */
.note-item { padding: 12px 4px; border-bottom: 1px solid #edf2f7; }
.note-item:last-child { border-bottom: none; }
.note-content { font-size: 14px; color: #2d3748; line-height: 1.7; white-space: pre-wrap; word-break: break-word; cursor: pointer; border-radius: 6px; padding: 4px 6px; margin: 0 -6px; }
.note-content:hover { background: #f7fafc; }
/* 折叠态：最多 3 行，超出裁掉（点击卡片切换展开/收起） */
.note-content.collapsed { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.note-expand-hint { font-size: 12px; color: #a0aec0; margin-top: 2px; cursor: pointer; user-select: none; }
.note-expand-hint:hover { color: #5a67d8; }
.note-quote { margin: 6px 0 0; padding: 6px 10px; border-left: 3px solid #e2e8f0; background: #f7fafc; border-radius: 4px; font-size: 12px; color: #a0aec0; line-height: 1.6; white-space: pre-wrap; word-break: break-word; max-height: 84px; overflow-y: auto; }
.note-meta { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.note-source-link { font-size: 12px; color: #5a67d8; text-decoration: none; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-source-link:hover { text-decoration: underline; }
/* 画布笔记来源：纯文本（私密内容，不提供跳转） */
.note-source-text { font-size: 12px; color: #718096; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-source-deleted { font-size: 12px; color: #cbd5e0; }
.note-time { font-size: 12px; color: #a0aec0; margin-left: auto; }
.btn-note-edit { border: none; background: transparent; color: #a0aec0; cursor: pointer; font-size: 12px; padding: 2px 6px; border-radius: 4px; }
.btn-note-edit:hover { color: #5a67d8; background: #ebf4ff; }
.btn-note-del { border: none; background: transparent; color: #cbd5e0; cursor: pointer; font-size: 14px; padding: 2px 6px; border-radius: 4px; }
.btn-note-del:hover { color: #e53e3e; background: #fff5f5; }
.note-edit textarea { width: 100%; box-sizing: border-box; border: 1px solid #e2e8f0; border-radius: 8px; padding: 8px 10px; font-size: 14px; line-height: 1.6; resize: vertical; font-family: inherit; }
.note-edit textarea:focus { outline: none; border-color: #5a67d8; }
.note-edit-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.note-edit-btns button { border: none; border-radius: 6px; padding: 6px 14px; font-size: 13px; font-weight: 600; cursor: pointer; }
.btn-note-save { background: #5a67d8; color: #fff; }
.btn-note-save:hover { background: #4c51bf; }
.btn-note-cancel { background: #e0e7ff; color: #4c51bf; }
.btn-note-cancel:hover { background: #c7d2fe; }

/* ===== 我的内容：批量管理（勾选框平时隐藏，对应列表进入管理模式才显示；底部操作条 fixed） ===== */
.batch-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.btn-batch {
    flex: 0 0 auto;
    padding: 5px 14px;
    border: 1px solid #e2e8f0;
    background: white;
    color: #5a67d8;
    border-radius: 14px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s;
}
.btn-batch:hover { border-color: #5a67d8; }
.btn-batch.active { background: #5a67d8; color: white; border-color: #5a67d8; }

/* 卡片左上角勾选框：白底圆角小块托底，盖在封面图上也清晰可点 */
.batch-check-wrap {
    display: none;
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 3;
    background: rgba(255,255,255,.95);
    border-radius: 6px;
    padding: 3px;
    box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
.batch-check-wrap .batch-check { display: block; width: 18px; height: 18px; margin: 0; cursor: pointer; }
#tab-content.batch-mode-canvas #myCanvases .feed-card,
#tab-content.batch-mode-post #myViewpoints .feed-card { position: relative; }
#tab-content.batch-mode-canvas #myCanvases .batch-check-wrap,
#tab-content.batch-mode-post #myViewpoints .batch-check-wrap { display: block; }

/* 底部批量操作条：fixed 居中一排；body.batch-active 补 padding-bottom 防遮挡内容（手机端同理） */
.batch-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9990;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 10px 14px;
    background: rgba(255,255,255,.97);
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -4px 16px rgba(0,0,0,.08);
}
.batch-bar.hidden { display: none; }
.batch-bar .batch-count { font-size: 13px; font-weight: 600; color: #4a5568; }
.batch-bar .btn, .batch-bar .btn-danger { min-height: 36px; }
body.batch-active { padding-bottom: 64px; }
