/* =========================================
   鹏客软件 PECK - 登录/注册 样式
   ========================================= */

:root {
    --main: #FFB800;
    --main-dark: #e6a200;
    --dark: #111827;
    --text: #1f2937;
    --gray: #6b7280;
    --line: #e5e7eb;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    background: linear-gradient(135deg, #fff8e5 0%, #ffffff 60%);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 顶部条 */
.auth-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 6%;
}

.auth-top .logo {
    font-size: 20px;
    font-weight: 700;
    color: #111;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-top .logo span {
    background: var(--main);
    color: #111;
    padding: 4px 10px;
    border-radius: 8px;
    font-weight: 900;
}

.auth-top .logo em {
    font-style: normal;
    font-size: 17px;
}

.auth-top .back {
    color: var(--gray);
    text-decoration: none;
    font-size: 14px;
    transition: color .2s;
}

.auth-top .back:hover {
    color: #111;
}

/* 卡片容器 */
.auth-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 20px 50px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 24px;
    padding: 40px 36px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .08);
}

.auth-card h1 {
    font-size: 26px;
    color: var(--dark);
    text-align: center;
    margin-bottom: 6px;
}

.auth-card .sub {
    text-align: center;
    color: var(--gray);
    font-size: 14px;
    margin-bottom: 26px;
}

/* 表单字段 */
.field {
    margin-bottom: 18px;
}

.field label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 7px;
    color: #374151;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="password"] {
    width: 100%;
    padding: 13px 15px;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    font-size: 15px;
    transition: .2s;
    outline: none;
    font-family: inherit;
}

.field input:focus {
    border-color: var(--main);
    box-shadow: 0 0 0 3px rgba(255, 184, 0, .18);
}

.field.error input {
    border-color: #ef4444;
}

.field-error {
    display: block;
    color: #ef4444;
    font-size: 12.5px;
    margin-top: 6px;
    min-height: 0;
}

/* 表单级提示 */
.form-message {
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 14px;
    margin-bottom: 18px;
}

.form-message.error {
    background: #fef2f2;
    color: #b91c1c;
}

.form-message.success {
    background: #ecfdf5;
    color: #047857;
}

/* 附加行 */
.checks {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: var(--gray);
    margin-bottom: 18px;
}

.checks a {
    color: var(--main-dark);
    text-decoration: none;
}

.checks a:hover {
    text-decoration: underline;
}

.remember {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.terms {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: var(--gray);
    margin-bottom: 6px;
    line-height: 1.5;
}

.terms a {
    color: var(--main-dark);
    text-decoration: none;
}

.terms a:hover {
    text-decoration: underline;
}

/* 提交按钮 */
.btn-submit {
    display: block;
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 30px;
    background: var(--main);
    color: #111;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: .25s;
}

.btn-submit:hover {
    box-shadow: 0 12px 28px rgba(255, 184, 0, .4);
    transform: translateY(-2px);
}

.btn-submit:disabled {
    opacity: .6;
    cursor: not-allowed;
    transform: none;
}

/* 底部切换链接 */
.auth-foot {
    text-align: center;
    margin-top: 22px;
    font-size: 14px;
    color: var(--gray);
}

.auth-foot a {
    color: var(--main-dark);
    text-decoration: none;
    font-weight: 600;
}

.auth-foot a:hover {
    text-decoration: underline;
}

.auth-footer-bar {
    text-align: center;
    padding: 18px;
    color: #9ca3af;
    font-size: 13px;
}

/* 会员中心 */
.profile {
    background: #fafafa;
    border-radius: 18px;
    padding: 10px 22px;
    margin-bottom: 30px;
}

.profile-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 17px 0;
    border-bottom: 1px solid #eee;
    font-size: 15px;
    gap: 12px;
}

.profile-row:last-child {
    border-bottom: none;
}

.profile-row span {
    color: var(--gray);
    flex-shrink: 0;
}

.profile-row strong {
    color: #111827;
    text-align: right;
    word-break: break-all;
}

.profile-row strong.ok {
    color: #16a34a;
}

/* 个人中心按钮间距优化 */
.auth-card .btn-submit + .btn-submit { margin-top: 14px; }
.auth-card .btn-link { margin-top: 20px; }
.auth-card .btn-submit { margin-top: 4px; }

/* 移动端 */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
img, svg, canvas { max-width: 100%; height: auto; }

@media (max-width: 640px) {
    .auth-top { padding: 16px 20px; }
    .auth-wrap { padding: 14px 14px 40px; }
    .auth-card { padding: 26px 20px; border-radius: 18px; }
    .auth-card h1 { font-size: 23px; }
    .profile { padding: 8px 18px; }
    .profile-row { padding: 14px 0; font-size: 14px; }
}

/* =========================================================
   全局深色模式（html[data-theme="dark"]）
   ========================================================= */
html[data-theme="dark"] {
    color-scheme: dark;
    background-color: #0f1620;
}
html[data-theme="dark"] body {
    background: linear-gradient(135deg, #10161f 0%, #0f1620 60%);
    color: #e6edf3;
}
html[data-theme="dark"] .auth-top .logo, html[data-theme="dark"] .auth-top .logo em { color: #f2f6fa; }
html[data-theme="dark"] .auth-top .back { color: #8fa0b1; }
html[data-theme="dark"] .auth-top .back:hover { color: #fff; }
html[data-theme="dark"] .auth-card {
    background: #141d28;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .45);
}
html[data-theme="dark"] .auth-card h1 { color: #eef3f8; }
html[data-theme="dark"] .auth-card .sub, html[data-theme="dark"] .field label, html[data-theme="dark"] .checks { color: #9aa8b8; }
html[data-theme="dark"] .field input[type="text"],
html[data-theme="dark"] .field input[type="email"],
html[data-theme="dark"] .field input[type="password"] {
    background: #1a2430;
    border-color: #33404f;
    color: #e6edf3;
}
html[data-theme="dark"] .field input::placeholder { color: #6b7a8a; }
html[data-theme="dark"] .field input:focus { border-color: #FFB800; box-shadow: 0 0 0 3px rgba(255,184,0,.18); }
html[data-theme="dark"] .form-message.error { background: #341c1c; color: #ff9b9b; }
html[data-theme="dark"] .form-message.success, html[data-theme="dark"] .form-message.ok { background: #14271c; color: #7ee2a9; }
html[data-theme="dark"] .checks a, html[data-theme="dark"] .terms a, html[data-theme="dark"] .auth-foot a, html[data-theme="dark"] .auth-foot-right a { color: #ffcf61; }
html[data-theme="dark"] .terms { color: #9aa8b8; }
html[data-theme="dark"] .auth-foot, html[data-theme="dark"] .auth-footer-bar { color: #7c8fa1; }
html[data-theme="dark"] .auth-foot-right { border-top-color: #2a3848; }
html[data-theme="dark"] .btn-submit { color: #111; }

/* 个人中心 */
html[data-theme="dark"] .profile { background: #1b2531; }
html[data-theme="dark"] .profile-row { border-bottom-color: #253141; }
html[data-theme="dark"] .profile-row span { color: #9aa8b8; }
html[data-theme="dark"] .profile-row strong { color: #eef3f8; }
html[data-theme="dark"] .profile-row strong.ok { color: #5dd28b; }

/* 主题切换按钮 */
html[data-theme="dark"] #peckThemeToggle { background: #1d2733; color: #ffcf61; }
#peckThemeToggle:hover { transform: scale(1.08); }

/* 协议/隐私/免责声明正文 */
html[data-theme="dark"] .legal-card h2 { color: #eef3f8; }
html[data-theme="dark"] .legal-card h3, html[data-theme="dark"] .legal-card p, html[data-theme="dark"] .legal-card li { color: #c3cdd8; }
html[data-theme="dark"] .legal-card .meta { color: #8fa0b1; }
html[data-theme="dark"] .legal-card a { color: #ffcf61; }

/* 登录/注册页右下角：找回密码 */
.auth-foot-right { text-align: right; margin-top: 14px; padding-top: 12px; border-top: 1px dashed #f0f0f0; }
.auth-foot-right a { color: #e6a200; text-decoration: none; font-size: 13px; font-weight: 600; }
.auth-foot-right a:hover { color: #c47c00; text-decoration: underline; }

/* ===================== 全局美化升级 ===================== */

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
}

/* 卡片液态玻璃效果 */
.auth-card {
    background: rgba(255, 255, 255, .85);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, .7);
    border-radius: 26px;
    padding: 44px 40px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .08);
}
.auth-card h1 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -.2px;
}
.auth-card .sub {
    font-size: 14px;
    margin-bottom: 30px;
    line-height: 1.6;
}

/* 表单美化 */
.field {
    margin-bottom: 20px;
}
.field label {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #374151;
}
.field input[type="text"],
.field input[type="email"],
.field input[type="password"] {
    padding: 14px 16px;
    border: 1.5px solid #e5e7eb;
    border-radius: 14px;
    font-size: 15px;
    transition: all .25s cubic-bezier(.4, 0, .2, 1);
    background: #fff;
}
.field input:focus {
    border-color: var(--main);
    box-shadow: 0 0 0 4px rgba(255, 184, 0, .15);
    background: #fffdf5;
}

/* 按钮升级 */
.btn-submit {
    padding: 15px;
    border-radius: 999px;
    font-size: 16px;
    font-weight: 700;
    transition: all .25s cubic-bezier(.4, 0, .2, 1);
    box-shadow: 0 8px 24px rgba(255, 184, 0, .3);
}
.btn-submit:hover {
    box-shadow: 0 14px 36px rgba(255, 184, 0, .42);
    transform: translateY(-2px);
    background: #ffc533;
}

/* 附加行间距优化 */
.checks {
    margin-bottom: 22px;
    font-size: 13.5px;
}
.terms {
    margin-bottom: 8px;
    font-size: 13px;
    line-height: 1.6;
}
.auth-foot {
    margin-top: 26px;
    font-size: 14px;
}

/* 个人中心卡片升级 */
.profile {
    background: #f8f9fa;
    border-radius: 20px;
    padding: 6px 24px;
    margin-bottom: 28px;
    border: 1px solid #eef0f2;
}
.profile-row {
    padding: 18px 0;
    border-bottom: 1px solid #e9ecef;
    font-size: 15px;
}
.profile-row:last-child {
    border-bottom: none;
}
.profile-row strong {
    font-weight: 600;
}

/* 个人中心按钮间距优化 */
.auth-card .btn-submit + .btn-submit { margin-top: 16px; }
.auth-card .btn-link { margin-top: 22px; }

/* 表单提示优化 */
.form-message {
    border-radius: 14px;
    padding: 14px 16px;
    font-size: 14px;
    margin-bottom: 20px;
    font-weight: 500;
}

/* 移动端优化 */
@media (max-width: 640px) {
    .auth-card {
        padding: 30px 24px;
        border-radius: 22px;
    }
    .auth-card h1 { font-size: 24px; }
    .profile { padding: 4px 20px; }
    .profile-row { padding: 16px 0; font-size: 14.5px; }
}

/* 暗黑模式：液态玻璃适配 */
html[data-theme="dark"] .auth-card {
    background: rgba(20, 29, 40, .85);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, .08);
    box-shadow: 0 24px 70px rgba(0, 0, 0, .5);
}
html[data-theme="dark"] .field input:focus {
    background: #1a2430;
    box-shadow: 0 0 0 4px rgba(255, 184, 0, .15);
}
html[data-theme="dark"] .profile {
    background: #1b2531;
    border-color: #253141;
}
html[data-theme="dark"] .btn-submit {
    box-shadow: 0 8px 24px rgba(255, 184, 0, .25);
}

/* ===================== 后台管理页美化 ===================== */

.auth-card.wide {
    max-width: 1180px;
    width: min(1180px, calc(100vw - 48px));
    padding: 52px 48px;
}
.auth-card.wide h1 {
    font-size: 26px;
    text-align: left;
    margin-bottom: 6px;
}
.auth-card.wide .sub {
    text-align: left;
    margin-bottom: 28px;
}

/* 分区标题 */
.admin-sec {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    margin: 36px 0 10px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f1f1f1;
    text-align: left;
}
.admin-sec:first-of-type {
    margin-top: 10px;
}

/* 表格容器 */
.admin-table-wrap {
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #eef0f2;
    background: #fff;
    box-shadow: 0 2px 12px rgba(0,0,0,.04);
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.admin-table th {
    background: #f8f9fa;
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    font-size: 13px;
    border-bottom: 1px solid #e9ecef;
}
.admin-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #f3f4f6;
    color: #374151;
    vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: #fafbfc; }
.admin-table .muted {
    text-align: center;
    color: #9ca3af;
    padding: 30px 16px;
}

/* 状态标签 */
.status-active { color: #16a34a; font-weight: 600; }
.status-banned { color: #dc2626; font-weight: 600; }
.status-blackroom { color: #d97706; font-weight: 600; }

/* 迷你按钮 */
.mini {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #374151;
    font-size: 12.5px;
    cursor: pointer;
    font-weight: 500;
    transition: all .2s;
    margin: 2px 4px 2px 0;
    text-decoration: none;
    font-family: inherit;
}
.mini:hover {
    border-color: var(--main);
    color: var(--main-dark);
    background: #fffbeb;
}
.mini.ok {
    background: #ecfdf5;
    border-color: #86efac;
    color: #16a34a;
}
.mini.ok:hover {
    background: #dcfce7;
    border-color: #4ade80;
}
.mini.danger {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #dc2626;
}
.mini.danger:hover {
    background: #fee2e2;
    border-color: #f87171;
}
.mini.warn {
    background: #fffbeb;
    border-color: #fcd34d;
    color: #d97706;
}
.mini.warn:hover {
    background: #fef3c7;
    border-color: #fbbf24;
}
.mini.ghost {
    background: #f9fafb;
    border-color: #e5e7eb;
    color: #6b7280;
}
.mini.ghost:hover {
    background: #f3f4f6;
    color: #374151;
}
.mini-input {
    padding: 6px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 12.5px;
    width: 120px;
    margin: 2px 4px 2px 0;
    font-family: inherit;
    outline: none;
    transition: border-color .2s;
}
.mini-input:focus {
    border-color: var(--main);
}

/* 操作按钮组 */
.admin-table .ops {
    white-space: normal;
    line-height: 1.8;
}
.op-form {
    display: inline;
}

/* 分页 */
.pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    flex-wrap: wrap;
}
.pager .mini {
    padding: 6px 14px;
}
.pager .page-info {
    font-size: 13px;
    color: #6b7280;
    margin: 0 10px;
}

/* 后台表单分区 */
.admin-form {
    background: #f8f9fa;
    border-radius: 16px;
    padding: 24px;
    margin: 16px 0;
    border: 1px solid #eef0f2;
}
.admin-form h3 {
    font-size: 16px;
    margin-bottom: 16px;
    color: #111827;
}

/* 暗黑模式：后台适配 */
html[data-theme="dark"] .auth-card.wide {
    background: rgba(20, 29, 40, .85);
}
html[data-theme="dark"] .admin-sec {
    color: #eef3f8;
    border-bottom-color: #253141;
}
html[data-theme="dark"] .admin-table-wrap {
    background: #141d28;
    border-color: #2c3a4a;
    box-shadow: 0 2px 12px rgba(0,0,0,.2);
}
html[data-theme="dark"] .admin-table th {
    background: #1a2430;
    color: #c3cdd8;
    border-bottom-color: #253141;
}
html[data-theme="dark"] .admin-table td {
    color: #c3cdd8;
    border-bottom-color: #223041;
}
html[data-theme="dark"] .admin-table tr:hover td { background: #18222e; }
html[data-theme="dark"] .admin-table .muted { color: #6b7a8a; }
html[data-theme="dark"] .mini {
    background: #1a2430;
    border-color: #33404f;
    color: #c3cdd8;
}
html[data-theme="dark"] .mini:hover {
    border-color: #FFB800;
    color: #FFB800;
    background: #1d2733;
}
html[data-theme="dark"] .mini.ok {
    background: #14271c;
    border-color: #2a5a3d;
    color: #5dd28b;
}
html[data-theme="dark"] .mini.ok:hover {
    background: #1a3325;
    border-color: #3d7a54;
}
html[data-theme="dark"] .mini.danger {
    background: #341c1c;
    border-color: #5a2a2a;
    color: #ff9b9b;
}
html[data-theme="dark"] .mini.danger:hover {
    background: #442323;
    border-color: #7a3a3a;
}
html[data-theme="dark"] .mini.warn {
    background: #2e2514;
    border-color: #5a4a1c;
    color: #ffcf61;
}
html[data-theme="dark"] .mini.warn:hover {
    background: #3d3019;
    border-color: #7a6128;
}
html[data-theme="dark"] .mini-input {
    background: #1a2430;
    border-color: #33404f;
    color: #e6edf3;
}
html[data-theme="dark"] .mini-input:focus {
    border-color: #FFB800;
}
html[data-theme="dark"] .admin-form {
    background: #1b2531;
    border-color: #253141;
}
html[data-theme="dark"] .admin-form h3 { color: #eef3f8; }
html[data-theme="dark"] .pager .page-info { color: #8fa0b1; }

/* 后台移动端 */
@media (max-width: 640px) {
    .auth-card.wide {
        padding: 28px 20px;
    }
    .auth-card.wide h1 { font-size: 22px; }
    .admin-table-wrap { overflow-x: auto; }
    .admin-table { min-width: 600px; }
    .admin-table th, .admin-table td { padding: 12px 14px; font-size: 13px; }
    .admin-sec { font-size: 16px; margin-top: 28px; }
    .admin-form { padding: 18px; }
}
