/* ========== 个人中心 / 设置 / 账号相关页面共用样式 ========== */
/* 色彩沿用全站：主色 #111、文本 #222/#666/#999、边框 #eee、浅底 #f5f5f5/#fafafa */

.acc-container { max-width: 720px; margin: calc(var(--nav-h) + var(--nav-gap)) auto 60px; padding: 0 20px; }

/* ---------- 个人中心：桌面优先两栏布局 ---------- */
/* ≥1200：300px + 1fr，左栏 sticky，内容区两栏卡片；768–1199：240px + 1fr，内容区单栏；<768：单列 */
.pc-layout {
    max-width: 1120px; margin: calc(var(--nav-h) + var(--nav-gap)) auto 48px; padding: 0 20px; box-sizing: border-box;
    display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; align-items: start;
    font-size: 14px; line-height: 1.6;
}
.pc-side { min-width: 0; }
.pc-content { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; min-width: 0; }

/* 焦点环：主色 2px */
.pc-layout a:focus-visible, .pc-layout button:focus-visible, .pc-layout [tabindex]:focus-visible {
    outline: 2px solid #111; outline-offset: 2px;
}

/* 左栏信息卡片：纵向排列 头像 / 昵称 / ID / 签名 / 编辑 / 统计 */
.acc-card {
    position: relative; display: flex; flex-direction: column; box-sizing: border-box;
    padding: 20px; background: #fff; border: 1px solid #eee; border-radius: 10px;
}
.acc-card-main { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.acc-avatar {
    width: 96px; height: 96px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
    border: 1px solid #eee; background: #f5f5f5;
}
.acc-info { min-width: 0; width: 100%; }
.acc-line { line-height: 1.6; overflow-wrap: anywhere; }
.acc-line + .acc-line { margin-top: 2px; }
.acc-name { font-size: 18px; font-weight: 700; color: #111; line-height: 1.4; margin: 0; }
.acc-meta { font-size: 13px; color: #999; }
.acc-meta .dot { margin: 0 6px; color: #ddd; }
.acc-meta span { white-space: nowrap; }  /* 日期与「加入」整体换行 */
.acc-line.acc-sign { font-size: 14px; color: #555; margin-top: 8px; }
.acc-sign.empty { color: #bbb; }
.acc-card-edit {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    height: 32px; margin-top: 16px; padding: 0 12px; box-sizing: border-box;
    font-size: 13px; color: #333; background: #fff; border: 1px solid #e5e5e5; border-radius: 6px;
    cursor: pointer; transition: background-color 0.15s, border-color 0.15s;
}
.acc-card-edit:hover { background: #f7f8fa; border-color: #d5d5d5; color: #111; }

/* 统计：横向排列，数值在上标签在下，1px 分隔线 */
.acc-stats {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 16px; padding-top: 16px; border-top: 1px solid #f0f0f0;
}
.acc-stat {
    position: relative;
    display: flex; flex-direction: column; align-items: center; min-width: 0; padding: 4px 0;
    cursor: pointer; transition: background-color 0.15s;
}
/* 分隔线只占中段，不贯穿 69px 的整条高度 */
.acc-stat + .acc-stat { border-left: none; }
.acc-stat + .acc-stat::before {
    content: ''; position: absolute; left: 0; top: 28%; bottom: 28%; width: 1px; background: #f0f0f0;
}
a.acc-stat:hover { background: #f7f8fa; }
.acc-stat-value { font-size: 20px; font-weight: 700; color: #111; line-height: 1.3; white-space: nowrap; }
.acc-stat-label { font-size: 12px; color: #999; line-height: 1.5; }

/* 内容区卡片：标题在卡片内，紧凑列表 */
.acc-group {
    min-width: 0; background: #fff; border: 1px solid #eee; border-radius: 10px; overflow: hidden;
}
.acc-group-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 12px 16px; border-bottom: 1px solid #f0f0f0;
}
.acc-group-title { font-size: 16px; font-weight: 600; color: #111; line-height: 1.5; }
.acc-group-action {
    padding: 2px 10px; font-size: 13px; color: #555; background: none; border: none; border-radius: 6px;
    cursor: pointer; font-family: inherit; line-height: 1.6; transition: background-color 0.15s, color 0.15s;
}
.acc-group-action:hover { background: #f7f8fa; color: #111; }
.acc-group-action:focus-visible { outline-offset: 0; }

.acc-menu { display: block; }
.acc-menu-item {
    display: flex; align-items: center; gap: 10px; width: 100%; min-height: 42px; box-sizing: border-box;
    padding: 8px 16px; font-size: 14px; line-height: 1.5; color: #222; text-align: left;
    background: #fff; border: none; cursor: pointer; font-family: inherit; transition: background-color 0.15s;
}
.acc-menu-item + .acc-menu-item { border-top: 1px solid #f3f3f3; }
.acc-menu-item:hover { background: #f7f8fa; }
.pc-layout .acc-menu-item:focus-visible { outline-offset: -2px; }
.acc-menu-icon { width: 18px; height: 18px; color: #888; flex-shrink: 0; transition: color 0.15s; }
.acc-menu-item:hover .acc-menu-icon { color: #111; }
.acc-menu-label { flex: 1; min-width: 0; }
.acc-menu-sub { display: block; font-size: 12px; color: #aaa; line-height: 1.4; }
.acc-menu-value { font-size: 13px; color: #999; white-space: nowrap; }
.acc-menu-value.warn { color: #e08600; }
.acc-menu-chevron { color: #ccc; flex-shrink: 0; }
.acc-menu-item.danger, .acc-menu-item.danger .acc-menu-icon { color: #ff3b30; }

/* 最喜爱的漫画：三列 1fr 填满容器（原来固定 120px 时 67% 的卡片是空的） */
.acc-loved { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 16px; }
.acc-loved-item { display: block; min-width: 0; text-align: center; border-radius: 8px; }
.acc-loved-item .cover-wrapper { transition: transform 0.15s, box-shadow 0.15s; }
.acc-loved-item:hover .cover-wrapper { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.acc-loved-item .comic-cover { opacity: 1; }
/* 标题固定两行，长标题不再把三格底部拉得参差 */
.acc-loved-item .comic-title {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    font-size: 13px; line-height: 1.4; overflow: hidden; overflow-wrap: anywhere;
}
.acc-loved-item:hover .comic-title { color: #111; }
/* 空槽位降权：去掉虚线和大加号，不跟真实封面抢视觉重量 */
.acc-loved-empty {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    border-radius: 8px; background: #fafafa; color: #ccc; transition: background-color 0.15s, color 0.15s;
}
.acc-loved-item.is-empty .cover-wrapper { border: none; box-shadow: none; background: transparent; }
button.acc-loved-item { background: none; border: none; padding: 0; cursor: pointer; font-family: inherit; }
button.acc-loved-item:hover .acc-loved-empty { background: #f2f3f5; color: #666; }
.acc-loved-item.is-empty .comic-title { visibility: hidden; }
.acc-loved .acc-state { grid-column: 1 / -1; padding: 24px 0; }

/* 1024–1199（13" 笔记本 / 分屏）：内容区也走两列，避免单列 552px 宽菜单行的空走廊 */
@media (min-width: 1024px) and (max-width: 1199px) {
    .pc-content { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pc-span { grid-column: 1 / -1; }
    .pc-menu-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pc-menu-cols .acc-menu-item:nth-child(odd) { border-right: 1px solid #f3f3f3; }
}

@media (min-width: 1200px) {
    .pc-layout { grid-template-columns: 300px minmax(0, 1fr); }
    .pc-side { position: sticky; top: calc(var(--nav-h) + var(--nav-gap)); }
    .pc-content { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pc-span { grid-column: 1 / -1; }
    /* 「其他」跨两栏时内部菜单分两列 */
    .pc-menu-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pc-menu-cols .acc-menu-item { border-top: 1px solid #f3f3f3; }
    .pc-menu-cols .acc-menu-item:nth-child(-n+2) { border-top: none; }
    .pc-menu-cols .acc-menu-item:nth-child(odd) { border-right: 1px solid #f3f3f3; }
}

@media (max-width: 767px) {
    .pc-layout { display: block; margin-bottom: 0; padding: 0 12px 28px; }
    .pc-content { margin-top: 16px; }
    /* 移动端沿用 App 布局：左头像、右三行，编辑按钮在右上角 */
    .acc-card { padding: 16px; }
    .acc-card-main { flex-direction: row; align-items: center; gap: 14px; }
    .acc-avatar { width: 64px; height: 64px; }
    /* 只让需要避让右上角「编辑资料」的两行留白，签名可以用满整行宽度 */
    .acc-info { padding-right: 0; }
    .acc-name, .acc-meta { padding-right: 76px; }
    .acc-name { font-size: 17px; }
    .acc-meta { font-size: 12px; }
    .acc-line.acc-sign { font-size: 13px; margin-top: 2px; }
    .acc-card-edit { position: absolute; top: 14px; right: 14px; height: 28px; margin: 0; padding: 0 10px; font-size: 12px; }
    .acc-stat-value { font-size: 17px; }
    .acc-menu-item { min-height: 48px; }
    .acc-loved { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 12px; }
}

/* ---------- 二级页标题栏 ---------- */
.acc-page-head { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; }
.acc-back {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 50%; color: #555; flex-shrink: 0; transition: background 0.15s;
}
.acc-back:hover { background: #f5f5f5; color: #111; }
.acc-page-title { font-size: 22px; font-weight: 700; color: #111; margin: 0; }
.acc-page-count { font-size: 14px; color: #999; margin-left: 4px; }

/* ---------- 列表条目（评论 / 长评 / 明细） ---------- */
.acc-list { list-style: none; margin: 0; padding: 0; }
.acc-entry { display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px solid #f0f0f0; }
.acc-entry-cover {
    width: 54px; aspect-ratio: 3 / 4; border-radius: 6px; object-fit: cover; flex-shrink: 0;
    background: #f5f5f5; border: 1px solid #eee;
}
.acc-entry-body { flex: 1; min-width: 0; }
.acc-entry-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.acc-entry-comic { font-size: 14px; font-weight: 600; color: #111; }
.acc-entry-comic:hover { text-decoration: underline; }
.acc-entry-time { font-size: 12px; color: #bbb; margin-left: auto; white-space: nowrap; }
.acc-entry-title { font-size: 15px; font-weight: 600; color: #222; margin-bottom: 4px; }
.acc-entry-content { font-size: 14px; color: #444; line-height: 1.6; word-break: break-word; white-space: pre-wrap; }
.acc-entry-quote {
    margin-top: 8px; padding: 8px 12px; background: #f7f7f7; border-radius: 6px; font-size: 13px; color: #888;
    line-height: 1.5; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.acc-entry-meta { display: flex; gap: 16px; margin-top: 8px; font-size: 12px; color: #999; }
.acc-entry-meta span { display: inline-flex; align-items: center; gap: 4px; }
.acc-tag { font-size: 11px; color: #888; background: #f5f5f5; padding: 1px 7px; border-radius: 6px; }
.acc-tag.red { color: #fff; background: #ff3b30; }
.acc-rating { color: #ff9500; font-size: 12px; letter-spacing: 1px; }
.acc-rating .off { color: #ddd; }

.acc-ledger { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid #f0f0f0; }
.acc-ledger-main { flex: 1; min-width: 0; }
.acc-ledger-title { font-size: 14px; color: #333; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-ledger-time { font-size: 12px; color: #bbb; margin-top: 3px; }
.acc-ledger-delta { font-size: 16px; font-weight: 600; text-align: right; white-space: nowrap; }
.acc-ledger-delta.plus { color: #34c759; }
.acc-ledger-delta.minus { color: #111; }
.acc-ledger-after { font-size: 12px; color: #bbb; text-align: right; }
.acc-summary { display: flex; gap: 12px; margin-bottom: 8px; }
.acc-summary-card { flex: 1; padding: 14px 16px; border: 1px solid #eee; border-radius: 10px; background: #fafafa; }
.acc-summary-card .num { font-size: 22px; font-weight: 700; color: #111; }
.acc-summary-card .lbl { font-size: 12px; color: #999; margin-top: 2px; }

.acc-state { text-align: center; padding: 56px 20px; color: #bbb; font-size: 14px; }
.acc-state.error { color: #ff3b30; }
.acc-state a, .acc-link-btn {
    color: #111; font-weight: 500; background: none; border: none; cursor: pointer; font-size: inherit; font-family: inherit; padding: 0;
}
.acc-more {
    display: block; margin: 18px auto 0; padding: 8px 28px; background: #fff; color: #555;
    border: 1px solid #ddd; border-radius: 8px; font-size: 13px; cursor: pointer; font-family: inherit;
}
.acc-more:hover { border-color: #999; color: #333; }

/* ---------- 按钮 ---------- */
.acc-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 18px; border-radius: 8px; font-size: 14px; font-weight: 500; cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s, opacity 0.15s;
    white-space: nowrap; font-family: inherit; border: 1px solid transparent; box-sizing: border-box;
}
.acc-btn-primary { background: #111; color: #fff; border-color: #111; }
.acc-btn-primary:hover:not(:disabled) { background: #333; border-color: #333; }
.acc-btn-secondary { background: #fff; color: #555; border-color: #ddd; }
.acc-btn-secondary:hover:not(:disabled) { border-color: #999; color: #111; }
.acc-btn-danger { background: #fff; color: #ff3b30; border-color: #ffd5d2; }
.acc-btn-danger:hover:not(:disabled) { background: #fff2f1; }
.acc-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.acc-btn-block { width: 100%; }

/* ---------- 表单 ---------- */
.acc-field { margin-bottom: 18px; }
.acc-field > label, .acc-label { display: block; font-size: 13px; font-weight: 500; color: #555; margin-bottom: 7px; }
.acc-input {
    width: 100%; padding: 11px 14px; font-size: 15px; color: #222; background: #fafafa;
    border: 1px solid #e5e5e5; border-radius: 8px; box-sizing: border-box; font-family: inherit;
    transition: border-color 0.15s, background 0.15s;
}
.acc-input:focus { outline: none; border-color: #111; background: #fff; }
.acc-input[aria-invalid="true"] { border-color: #ff3b30; }
textarea.acc-input { min-height: 88px; resize: vertical; line-height: 1.6; }
.acc-hint { font-size: 12px; color: #aaa; margin-top: 6px; display: flex; justify-content: space-between; gap: 10px; }
.acc-hint.error { color: #ff3b30; }
.acc-inline { display: flex; gap: 10px; }
.acc-inline .acc-input { flex: 1; min-width: 0; }
.acc-inline .acc-btn { flex-shrink: 0; }
.acc-pass { position: relative; }
.acc-pass .acc-input { padding-right: 44px; }
.acc-pass-toggle {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    width: 32px; height: 32px; border: none; background: none; color: #aaa; cursor: pointer;
    display: flex; align-items: center; justify-content: center; border-radius: 6px;
}
.acc-pass-toggle:hover { color: #333; }
.acc-strength { display: flex; gap: 4px; margin-top: 8px; }
.acc-strength i { flex: 1; height: 3px; border-radius: 2px; background: #eee; transition: background 0.2s; }
.acc-strength[data-level="1"] i:nth-child(-n+1) { background: #ff3b30; }
.acc-strength[data-level="2"] i:nth-child(-n+2) { background: #ff9500; }
.acc-strength[data-level="3"] i:nth-child(-n+3) { background: #34c759; }

/* ---------- 开关 ---------- */
.acc-switch { position: relative; width: 44px; height: 26px; flex-shrink: 0; display: inline-block; }
.acc-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.acc-switch .track { position: absolute; inset: 0; background: #ddd; border-radius: 13px; transition: background 0.2s; }
.acc-switch .track::after {
    content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; background: #fff;
    border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,0.18); transition: transform 0.2s cubic-bezier(0.2,0.8,0.2,1);
}
.acc-switch input:checked + .track { background: #111; }
.acc-switch input:checked + .track::after { transform: translateX(18px); }
.acc-switch input:focus-visible + .track { outline: 2px solid #888; outline-offset: 2px; }
.acc-switch input:disabled { cursor: default; }
.acc-switch input:disabled + .track { opacity: 0.5; }

/* ---------- 弹窗（桌面居中卡片 / 手机底部面板） ---------- */
.acc-modal {
    position: fixed; inset: 0; z-index: 9000; display: flex; align-items: center; justify-content: center; padding: 20px;
    background: rgba(0,0,0,0.45); opacity: 0; visibility: hidden;
    transition: opacity 0.16s ease, visibility 0s linear 0.16s;
}
.acc-modal.show { opacity: 1; visibility: visible; transition: opacity 0.18s ease, visibility 0s; }
.acc-modal-box {
    width: 100%; max-width: 420px; max-height: 86vh; display: flex; flex-direction: column;
    background: #fff; border-radius: 16px; box-shadow: 0 24px 48px rgba(0,0,0,0.14); overflow: hidden;
    transform: translateY(8px) scale(0.98); transition: transform 0.16s ease-in;
}
.acc-modal.show .acc-modal-box { transform: none; transition: transform 0.2s cubic-bezier(0.2,0.8,0.2,1); }
.acc-modal-box.wide { max-width: 860px; }
.acc-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px 12px; flex-shrink: 0; }
.acc-modal-head h3 { margin: 0; font-size: 17px; font-weight: 600; color: #111; }
.acc-modal-close {
    width: 32px; height: 32px; border: none; background: none; color: #999; cursor: pointer;
    border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.acc-modal-close:hover { background: #f5f5f5; color: #333; }
.acc-modal-body { padding: 6px 22px 18px; overflow-y: auto; font-size: 14px; color: #555; line-height: 1.7; }
.acc-modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 22px 20px; border-top: 1px solid #f3f3f3; flex-shrink: 0; }
.acc-modal-foot .acc-btn { min-width: 92px; }
.acc-modal-note { font-size: 13px; color: #999; margin: 0 0 16px; }

/* 步骤指示 */
.acc-steps { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; font-size: 12px; color: #bbb; }
.acc-steps .step { display: inline-flex; align-items: center; gap: 6px; }
.acc-steps .num {
    width: 20px; height: 20px; border-radius: 50%; border: 1px solid #ddd; display: inline-flex;
    align-items: center; justify-content: center; font-size: 11px; color: #bbb;
}
.acc-steps .step.active { color: #111; font-weight: 500; }
.acc-steps .step.active .num { background: #111; border-color: #111; color: #fff; }
.acc-steps .step.done .num { border-color: #111; color: #111; }
.acc-steps .bar { flex: 1; height: 1px; background: #eee; }

@media (max-width: 768px) {
    .acc-container { margin-bottom: 0; padding: 0 12px 28px; }
    .acc-page-title { font-size: 18px; }
    .acc-entry { gap: 10px; padding: 14px 0; }
    .acc-entry-cover { width: 44px; }
    .acc-entry-content { font-size: 13px; }

    .acc-modal { align-items: flex-end; padding: 0; }
    .acc-modal-box, .acc-modal-box.wide {
        max-width: none; max-height: 88vh; border-radius: 16px 16px 0 0;
        transform: translateY(100%); transition: transform 0.2s ease-in;
        padding-bottom: env(safe-area-inset-bottom);
    }
    .acc-modal.show .acc-modal-box { transform: none; transition: transform 0.24s cubic-bezier(0.2,0.8,0.2,1); }
    .acc-modal-foot .acc-btn { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .acc-modal-box, .acc-modal.show .acc-modal-box { transform: none !important; }
    .acc-switch .track::after { transition: none; }
}
