/**
 * 用户账号页面样式（登录 / 注册 / 找回密码 / 用户中心）
 * 对应 CorePress 路线：独立页面模板
 */

/* ============ 登录/注册/找回密码 通用 ============ */
.otm-auth-wrap {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
    background: linear-gradient(135deg, #eef2ff 0%, #f8fafc 100%);
    background-size: cover;
    background-position: center;
}
.otm-auth-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(15, 23, 42, 0.08);
    padding: 40px 36px;
}
.otm-auth-title {
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    margin: 0 0 24px;
    color: var(--text-primary, #334155);
}
.otm-auth-form .otm-form-row {
    margin-bottom: 16px;
}
.otm-auth-form label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary, #64748b);
    margin-bottom: 6px;
}
.otm-auth-form input[type="text"],
.otm-auth-form input[type="email"],
.otm-auth-form input[type="password"],
.otm-auth-form input[type="url"] {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color .2s, box-shadow .2s;
    box-sizing: border-box;
}
.otm-auth-form input:focus {
    border-color: var(--primary-color, #4a90d9);
    box-shadow: 0 0 0 3px rgba(74,144,217,.12);
    outline: none;
}
.otm-remember, .otm-agree {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary, #64748b);
    margin: 12px 0 20px;
    cursor: pointer;
}
.otm-remember input, .otm-agree input { width: 16px; height: 16px; }
.otm-agree a { color: var(--primary-color, #4a90d9); }
.otm-auth-submit {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: var(--primary-color, #4a90d9);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
}
.otm-auth-submit:hover { background: var(--primary-hover, #3b7dc4); }
.otm-auth-links {
    margin-top: 18px;
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}
.otm-auth-links a { color: var(--primary-color, #4a90d9); text-decoration: none; }
.otm-auth-links a:hover { text-decoration: underline; }

/* 消息提示 */
.otm-auth-msg {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
    line-height: 1.5;
}
.otm-auth-msg--success { background: #dcfce7; color: #166534; }
.otm-auth-msg--error { background: #fee2e2; color: #991b1b; }

/* 协议弹窗 */
.otm-agreement-modal {
    position: fixed; inset: 0;
    background: rgba(15,23,42,.5);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999; padding: 20px;
}
.otm-agreement-modal__box {
    background: #fff; border-radius: 12px;
    max-width: 640px; width: 100%; max-height: 80vh;
    overflow: hidden; display: flex; flex-direction: column;
}
.otm-agreement-modal__content {
    padding: 24px; overflow-y: auto; line-height: 1.8; font-size: 14px;
}
.otm-agreement-modal__close {
    border: none; border-top: 1px solid var(--border-color,#e2e8f0);
    padding: 12px; background: #f8fafc; cursor: pointer; font-size: 14px;
    color: var(--text-secondary,#64748b);
}

/* ============ 用户中心 ============ */
.otm-uc-wrap {
    max-width: 900px;
    margin: 40px auto;
    display: flex;
    gap: 28px;
    padding: 0 16px;
}
.otm-uc-sidebar {
    width: 220px;
    flex-shrink: 0;
    text-align: center;
    background: #fff;
    border-radius: 16px;
    padding: 28px 20px;
    box-shadow: 0 4px 20px rgba(15,23,42,.05);
    height: fit-content;
}
.otm-uc-avatar img, .otm-uc-avatar .avatar {
    width: 96px; height: 96px; border-radius: 50%; object-fit: cover;
    border: 3px solid var(--primary-light, #f0f6ff);
}
.otm-uc-name { font-size: 18px; font-weight: 600; margin-top: 12px; color: var(--text-primary,#334155); }
.otm-uc-role { font-size: 13px; color: var(--text-muted,#94a3b8); margin-top: 4px; }
.otm-uc-status { margin-top: 12px; }

.otm-uc-main {
    flex: 1;
    background: #fff;
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 4px 20px rgba(15,23,42,.05);
}
.otm-uc-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border-color,#e2e8f0);
    margin-bottom: 24px;
}
.otm-uc-tab {
    padding: 10px 18px;
    font-size: 14px;
    color: var(--text-secondary,#64748b);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}
.otm-uc-tab.active {
    color: var(--primary-color,#4a90d9);
    border-bottom-color: var(--primary-color,#4a90d9);
    font-weight: 600;
}
.otm-uc-panel { display: none; }
.otm-uc-panel.active { display: block; }

.otm-bind-row {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px; background: var(--bg-color,#f8fafc);
    border-radius: 8px; margin-bottom: 12px;
}
.otm-bind-label { font-weight: 500; }
.otm-bind-value { flex: 1; color: var(--text-secondary,#64748b); }
.otm-bind-status--ok { color: #166534; font-size: 13px; }
.otm-bind-tip { font-size: 13px; color: var(--text-muted,#94a3b8); }

/* ============ 头部用户区 ============ */
.header-user { position: relative; }
.header-user__toggle {
    display: flex; align-items: center; gap: 8px;
    background: var(--surface-color,#fff); border: 1px solid var(--border-color,#e2e8f0);
    border-radius: 9999px; padding: 4px 12px 4px 4px; cursor: pointer;
    font-size: 13px; color: var(--text-primary,#334155);
}
.header-user__avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.header-user__avatar.avatar { border-radius: 50%; }
.header-user__name { max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.header-user__menu {
    position: absolute; top: calc(100% + 8px); right: 0;
    background: #fff; border: 1px solid var(--border-color,#e2e8f0);
    border-radius: 12px; box-shadow: 0 8px 30px rgba(15,23,42,.12);
    min-width: 160px; padding: 6px; list-style: none; margin: 0;
    opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: all .18s;
    z-index: 100;
}
.header-user__menu.open { opacity: 1; visibility: visible; transform: translateY(0); }
.header-user__menu li a {
    display: flex; align-items: center; gap: 8px;
    padding: 9px 12px; border-radius: 8px; color: var(--text-primary,#334155);
    text-decoration: none; font-size: 13px;
}
.header-user__menu li a:hover { background: var(--surface-hover,#f1f5f9); }

.header-auth { display: flex; align-items: center; gap: 12px; }
.header-auth__login, .header-auth__reg {
    font-size: 13px; text-decoration: none; padding: 7px 16px; border-radius: 9999px;
}
.header-auth__login { color: var(--primary-color,#4a90d9); border: 1px solid var(--primary-color,#4a90d9); }
.header-auth__reg { background: var(--primary-color,#4a90d9); color: #fff; }
.header-auth__login:hover { background: var(--primary-light,#f0f6ff); }

/* ============ 后台用户管理 ============ */
.otm-stats-bar {
    display: inline-flex; gap: 14px; align-items: center;
    background: var(--bg-color,#f8fafc); border: 1px solid var(--border-color,#e2e8f0);
    border-radius: 10px; padding: 12px 22px; font-size: 13px; color: var(--text-secondary,#64748b);
    margin-bottom: 16px;
}
.otm-stats-bar strong { color: var(--text-primary,#334155); font-size: 16px; }
.otm-stats-bar .stat-sep { color: var(--border-color,#e2e8f0); }
.otm-stat--active strong { color: #166534; }
.otm-stat--pending strong { color: #92400e; }
.otm-stat--banned strong { color: #991b1b; }

.otm-role-badge {
    display: inline-block; padding: 2px 9px; border-radius: 4px;
    font-size: 11px; font-weight: 500; background: #f1f5f9; color: #475569;
}
.otm-role-badge--subscriber { background:#dbeafe; color:#1e40af; }
.otm-role-badge--contributor { background:#dcfce7; color:#166534; }
.otm-role-badge--author { background:#fef3c7; color:#92400e; }
.otm-role-badge--editor { background:#ede9fe; color:#5b21b6; }

.otm-status-badge {
    display: inline-block; padding: 3px 12px; border-radius: 9999px;
    font-size: 12px; font-weight: 600;
}
.otm-status-badge--success { background:#dcfce7; color:#166534; }
.otm-status-badge--warning { background:#fef3c7; color:#92400e; }
.otm-status-badge--danger { background:#fee2e2; color:#991b1b; }

.otm-time-ago { color: var(--text-muted,#94a3b8); font-size: 11px; }
.otm-settings-tip {
    margin-top: 24px; padding: 16px 20px; background: var(--bg-color,#f8fafc);
    border-radius: 10px; font-size: 13px; color: var(--text-secondary,#64748b); line-height: 1.7;
}
.otm-settings-tip code { background:#e2e8f0; padding: 1px 6px; border-radius: 4px; font-size: 12px; }

/* ============ 响应式 ============ */
@media screen and (max-width: 768px) {
    .otm-uc-wrap { flex-direction: column; }
    .otm-uc-sidebar { width: 100%; }
    .header-user__name { display: none; }
}
