/* ============================================
   清颐通行证系统 - 默认主题样式
   主题目录：templates/default/ + static/css/passport.css
   换肤时整体替换本主题即可
   ============================================ */

:root {
    --p-primary: #0ea5e9;
    --p-secondary: #10b981;
    --p-gradient: linear-gradient(135deg, #0ea5e9 0%, #10b981 100%);
    --p-text: #1f2937;
    --p-text-sub: #6b7280;
    --p-bg: #f3f6f9;
    --p-card-bg: #ffffff;
    --p-border: #e5e7eb;
    --p-radius: 12px;
    --p-shadow: 0 6px 24px rgba(17, 24, 39, .08);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
                 "Microsoft YaHei", "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 14px;
    color: var(--p-text);
    background: var(--p-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--p-primary); text-decoration: none; }
a:hover { opacity: .85; }

/* ===== 顶部导航：统一由商城 qy-nav.css 提供（.sitebar/.mainnav） ===== */
/* 主体顶部留白由 qy-nav.css 的 body{padding-top:110px} 控制 */

/* 手机版入口：文字禁止竖排/换行，图标与文字同行横排 */
.qy-mobile-wrap .fav,
.qy-mobile-wrap .fav span {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}
.qy-mobile-wrap .fav svg {
    flex-shrink: 0 !important;
    width: 15px !important;
    height: 15px !important;
}

/* ===== 主体 ===== */
.p-main {
    flex: 1;
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding: 36px 20px 56px;
}

/* ===== 认证页（登录/注册） ===== */
.p-auth-wrap {
    max-width: 420px;
    margin: 0 auto;
}
.p-auth-card {
    background: var(--p-card-bg);
    border-radius: 16px;
    box-shadow: var(--p-shadow);
    padding: 36px 36px 30px;
    border-top: 4px solid transparent;
    background-image: linear-gradient(#fff, #fff), var(--p-gradient);
    background-origin: border-box;
    background-clip: padding-box, border-box;
}
.p-auth-head { text-align: center; margin-bottom: 24px; }
.p-auth-title { font-size: 22px; font-weight: 700; }
.p-auth-sub { color: var(--p-text-sub); font-size: 13px; margin-top: 6px; }

.p-alert {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
}
.p-alert-error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.p-form { display: block; }
.p-field { margin-bottom: 16px; }
.p-label {
    display: block;
    font-size: 13px;
    color: var(--p-text-sub);
    margin-bottom: 6px;
    font-weight: 500;
}
.p-input {
    width: 100%;
    height: 42px;
    border: 1px solid var(--p-border);
    border-radius: 9px;
    padding: 0 14px;
    font-size: 14px;
    color: var(--p-text);
    background: #fbfcfd;
    transition: border .2s, box-shadow .2s;
    outline: none;
    font-family: inherit;
}
.p-input:focus {
    border-color: var(--p-primary);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, .14);
    background: #fff;
}
.p-field-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}
.p-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--p-text-sub);
    cursor: pointer;
}
.p-check input { accent-color: var(--p-primary); }
.p-forgot { font-size: 13px; }

.p-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 42px;
    padding: 0 24px;
    border: none;
    border-radius: 9px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform .12s, box-shadow .2s, opacity .2s;
    font-family: inherit;
    letter-spacing: 2px;
}
.p-btn:active { transform: translateY(1px); }
.p-btn-block { width: 100%; }
.p-btn-primary {
    background: var(--p-gradient);
    color: #fff;
    box-shadow: 0 4px 14px rgba(16, 185, 129, .35);
}
.p-btn-primary:hover { box-shadow: 0 6px 18px rgba(16, 185, 129, .45); opacity: 1; }
.p-btn-primary:disabled { opacity: .6; cursor: not-allowed; }
.p-btn-ghost {
    background: #fff;
    color: var(--p-primary);
    border: 1px solid var(--p-primary);
    margin-left: 10px;
}
.p-auth-switch {
    text-align: center;
    margin-top: 18px;
    font-size: 13px;
    color: var(--p-text-sub);
}
.p-agree-link { color: var(--p-primary); }

/* ===== 首页 ===== */
.p-hero {
    text-align: center;
    padding: 40px 20px 34px;
}
.p-hero-title { font-size: 28px; font-weight: 700; }
.p-hero-sub { color: var(--p-text-sub); margin-top: 10px; font-size: 15px; }
.p-hero-actions { margin-top: 24px; display: flex; justify-content: center; }

.p-feat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin: 30px 0 40px;
}
.p-feat-card {
    background: var(--p-card-bg);
    border-radius: var(--p-radius);
    padding: 22px 18px;
    text-align: center;
    box-shadow: var(--p-shadow);
}
.p-feat-card h3 { font-size: 16px; margin: 10px 0 6px; }
.p-feat-card p { color: var(--p-text-sub); font-size: 13px; }
.p-feat-ico {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--p-gradient);
    display: inline-block;
}

.p-section-title {
    font-size: 17px;
    font-weight: 700;
    margin: 26px 0 14px;
    padding-left: 10px;
    border-left: 4px solid var(--p-primary);
}
.p-site-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
.p-site-card {
    background: var(--p-card-bg);
    border-radius: var(--p-radius);
    padding: 22px 16px;
    text-align: center;
    box-shadow: var(--p-shadow);
    transition: transform .18s, box-shadow .18s;
    display: block;
    color: var(--p-text);
}
.p-site-card:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(17, 24, 39, .13); opacity: 1; }
.p-site-ico {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    background-size: cover;
}
.p-site-name { display: block; font-size: 16px; font-weight: 600; }
.p-site-desc { display: block; color: var(--p-text-sub); font-size: 12px; margin-top: 5px; }

/* ===== 验证码行：输入框缩短 + 按钮右侧 ===== */
.p-code-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.p-input-code {
    flex: 0 0 55%;
    width: auto;
    min-width: 0;
}
.p-code-btn {
    flex: 1;
    min-width: 0;
    height: 42px;
    padding: 0 12px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0;
    background: var(--p-primary);
    color: #fff;
    border: none;
    border-radius: 9px;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
    transition: opacity .2s, transform .12s;
}
.p-code-btn:active { transform: translateY(1px); }
.p-code-btn:disabled { opacity: .65; cursor: not-allowed; }

/* ===== 个人中心（左侧树形菜单 + 右侧内容区） ===== */
.p-uc { display: flex; gap: 20px; align-items: flex-start; margin: 24px 0; }
.p-uc-side { width: 220px; flex-shrink: 0; background: #fff; border: 1px solid var(--p-border); border-radius: 14px; padding: 18px 12px; position: sticky; top: 84px; }
.p-uc-user { display: flex; align-items: center; gap: 12px; padding: 4px 10px 16px; border-bottom: 1px solid #f1f5f9; margin-bottom: 12px; }
.p-uc-ava { width: 46px; height: 46px; border-radius: 50%; background: var(--p-gradient); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 19px; font-weight: 700; flex-shrink: 0; }
.p-uc-ava-wrap { position: relative; width: 46px; height: 46px; flex-shrink: 0; cursor: pointer; border-radius: 50%; }
.p-uc-ava-wrap .p-uc-ava { width: 46px; height: 46px; }
.p-uc-ava-img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; display: block; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.p-uc-ava-mask { position: absolute; left: 0; top: 0; width: 100%; height: 100%; border-radius: 50%; background: rgba(15,23,42,.55); color: #fff; font-size: 10.5px; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .18s; }
.p-uc-ava-wrap:hover .p-uc-ava-mask { opacity: 1; }
.p-uc-ava-wrap:active { transform: scale(.96); }
.p-uc-name { font-size: 15px; font-weight: 600; color: var(--p-text); }
.p-uc-phone { font-size: 12px; color: var(--p-text-sub); margin-top: 3px; }
.p-uc-menu { display: flex; flex-direction: column; gap: 2px; }
.p-uc-menu a { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 9px; color: #475569; font-size: 13.5px; text-decoration: none; transition: all .15s; }
.p-uc-menu a svg { width: 17px; height: 17px; flex-shrink: 0; }
.p-uc-menu a:hover { background: #f1f5f9; color: var(--p-primary); }
.p-uc-menu a.on { background: linear-gradient(135deg, rgba(14,165,233,.1), rgba(16,185,129,.1)); color: var(--p-primary); font-weight: 600; }
.p-uc-badge { font-style: normal; background: #ef4444; color: #fff; border-radius: 10px; font-size: 11px; padding: 1px 6px; margin-left: auto; }
.p-uc-side-foot { border-top: 1px solid #f1f5f9; margin-top: 14px; padding-top: 12px; text-align: center; }
.p-uc-logout { background: none; border: none; color: #ff5000; font-size: 13px; cursor: pointer; font-family: inherit; padding: 6px 18px; border-radius: 7px; }
.p-uc-logout:hover { background: #fff4ed; }

.p-uc-main { flex: 1; min-width: 0; }
.p-uc-panel { background: #fff; border: 1px solid var(--p-border); border-radius: 14px; padding: 24px 26px; }
.p-uc-panel-title { font-size: 17px; margin: 0 0 18px; color: var(--p-text); }
.p-uc-panel-head { display: flex; align-items: center; justify-content: space-between; }
.p-uc-panel-head .p-uc-panel-title { margin-bottom: 18px; }
.p-uc-stats { display: flex; gap: 16px; margin-bottom: 22px; }
.p-uc-stat { flex: 1; background: #f8fafc; border: 1px solid var(--p-border); border-radius: 12px; padding: 18px 16px; text-align: center; }
.p-uc-stat-num { font-size: 24px; font-weight: 700; color: var(--p-primary); }
.p-uc-stat-label { font-size: 12.5px; color: var(--p-text-sub); margin-top: 5px; }
.p-uc-detail { border-top: 1px solid #f1f5f9; }
.p-uc-row { display: flex; justify-content: space-between; padding: 13px 2px; border-bottom: 1px solid #f8fafc; font-size: 13.5px; color: var(--p-text); }
.p-uc-row .lb { color: var(--p-text-sub); }
.p-uc-tip { font-size: 13px; color: var(--p-text-sub); margin-top: 14px; }
.p-uc-points-box { font-size: 14px; color: var(--p-text-sub); margin-bottom: 20px; }
.p-uc-points-box b { font-size: 30px; color: #ff5000; margin: 0 4px; }
.p-uc-sub-title { font-size: 14px; margin: 0 0 12px; color: var(--p-text); }
.p-uc-list { }
.p-uc-list-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 4px; border-bottom: 1px solid #f8fafc; }
.p-uc-list-row:last-child { border-bottom: none; }
.p-uc-list-info { flex: 1; min-width: 0; }
.p-uc-list-title { font-size: 14px; color: var(--p-text); display: flex; align-items: center; gap: 6px; }
.p-uc-list-content { font-size: 13px; color: var(--p-text-sub); margin-top: 4px; line-height: 1.6; }
.p-uc-list-time { font-size: 12px; color: #9aa6a2; margin-top: 4px; }
.p-uc-list-num { font-size: 16px; font-weight: 700; flex-shrink: 0; }
.p-uc-list-num.up { color: #16c79a; }
.p-uc-list-num.down { color: #c0392b; }
.p-uc-list-row.unread .p-uc-list-title { font-weight: 600; }
.p-uc-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #ef4444; flex-shrink: 0; }
.p-uc-empty { text-align: center; color: #9aa6a2; font-size: 13.5px; padding: 34px 0; }
.p-alert-ok { background: #e8faf3; color: #12835f; border: 1px solid #b8e8d8; }

@media (max-width: 860px) {
    .p-uc { flex-direction: column; }
    .p-uc-side { width: 100%; position: static; }
    .p-uc-stats { flex-wrap: wrap; }
    .p-uc-stat { flex: 1 1 120px; }
}

.p-ico-mall { background: linear-gradient(135deg, #f97316, #ef4444); }
.p-ico-bbs { background: linear-gradient(135deg, #0ea5e9, #10b981); }
.p-ico-circle { background: linear-gradient(135deg, #8b5cf6, #6366f1); }
.p-ico-video { background: linear-gradient(135deg, #ec4899, #f43f5e); }
.p-ico-one { background: linear-gradient(135deg, #0ea5e9, #10b981); }
.p-ico-secure { background: linear-gradient(135deg, #10b981, #84cc16); }
.p-ico-sync { background: linear-gradient(135deg, #6366f1, #0ea5e9); }

/* ===== 个人资料（标签页表单） ===== */
.p-pro-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--p-border); margin: 4px 0 18px; overflow-x: auto; }
.p-pro-tab { background: none; border: none; padding: 9px 14px; font-size: 13.5px; color: #64748b; cursor: pointer; border-bottom: 2px solid transparent; font-family: inherit; white-space: nowrap; }
.p-pro-tab:hover { color: var(--p-primary); }
.p-pro-tab.on { color: var(--p-primary); font-weight: 600; border-bottom-color: var(--p-primary); }
.p-pro-panel { display: none; }
.p-pro-panel.on { display: block; }
.p-pro-form { max-width: 560px; }
.p-pro-row { display: flex; align-items: center; min-height: 48px; border-bottom: 1px solid #f1f5f9; gap: 10px; }
.p-pro-row > label { width: 92px; flex-shrink: 0; color: var(--p-text-sub); font-size: 13.5px; }
.p-pro-val { color: var(--p-text); font-size: 14px; }
.p-pro-input { flex: 1; min-width: 0; border: 1px solid var(--p-border); border-radius: 7px; height: 36px; padding: 0 10px; font-size: 13.5px; color: var(--p-text); background: #fff; font-family: inherit; outline: none; }
.p-pro-input:focus { border-color: var(--p-primary); }
.p-pro-select { max-width: 220px; }
.p-pro-sel { flex: 0 1 130px; }
.p-pro-birth { display: flex; gap: 8px; flex: 1; min-width: 0; }
.p-pro-tip { font-size: 12px; color: #94a3b8; line-height: 1.5; }
.p-pro-tip-row { align-items: flex-start; padding: 4px 0; min-height: 30px; }
.p-pro-modify { color: var(--p-primary); font-size: 13px; margin-left: 8px; text-decoration: none; }

/* ===== 邮箱修改弹窗 ===== */
.p-modal-mask { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.45); display: flex; align-items: center; justify-content: center; z-index: 999; padding: 16px; }
.p-modal { background: #fff; border-radius: 12px; width: 100%; max-width: 380px; padding: 22px 20px 18px; box-shadow: 0 12px 40px rgba(15, 23, 42, 0.18); }
.p-modal-title { font-size: 16px; font-weight: 600; color: var(--p-text); margin-bottom: 16px; }
.p-modal-row { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.p-modal-row > label { width: 56px; flex-shrink: 0; color: var(--p-text-sub); font-size: 13.5px; }
.p-modal-row .p-pro-input { flex: 1; min-width: 0; }
.p-modal-code { display: flex; gap: 8px; flex: 1; min-width: 0; }
.p-modal-code .p-pro-input { flex: 1; }
.p-btn-ghost { border: 1px solid var(--p-primary); color: var(--p-primary); background: #fff; border-radius: 7px; height: 36px; padding: 0 12px; font-size: 13px; cursor: pointer; white-space: nowrap; font-family: inherit; }
.p-btn-ghost:disabled { border-color: #cbd5e1; color: #94a3b8; cursor: not-allowed; }
.p-modal-tip { font-size: 12px; color: #94a3b8; margin: 2px 0 16px 64px; }
.p-modal-btns { display: flex; justify-content: flex-end; gap: 10px; }
.p-btn-plain { border: 1px solid var(--p-border); background: #fff; color: #64748b; border-radius: 7px; height: 36px; padding: 0 18px; font-size: 13.5px; cursor: pointer; font-family: inherit; }
.p-btn-plain:hover { background: #f8fafc; }
.p-modal-tiny { max-width: 280px; text-align: center; padding: 28px 24px 22px; }
.p-modal-icon { width: 46px; height: 46px; margin: 0 auto 12px; border-radius: 50%; background: #ecfdf5; color: #10b981; font-size: 24px; line-height: 46px; text-align: center; }
.p-modal-text { font-size: 14.5px; color: var(--p-text); margin-bottom: 18px; }
.p-modal-btns { justify-content: center; }
.p-pro-sign { flex: 1; min-width: 0; border: 1px solid var(--p-border); border-radius: 7px; background: #fff; overflow: hidden; }
.p-pro-sign-toolbar { display: flex; align-items: center; padding: 6px 8px; background: #f8fafc; border-bottom: 1px solid var(--p-border); gap: 2px; }
.p-pro-sign-btn { width: 28px; height: 28px; border: none; background: transparent; border-radius: 4px; font-size: 14px; color: #475569; cursor: pointer; line-height: 1; padding: 0; }
.p-pro-sign-btn:hover { background: #e2e8f0; }
.p-pro-sign-preview { margin-left: auto; border: none; background: transparent; color: #3b82f6; font-size: 13px; cursor: pointer; padding: 0 8px; line-height: 28px; }
.p-pro-sign-preview:hover { color: #2563eb; }
.p-pro-textarea { width: 100%; min-height: 72px; border: none; outline: none; padding: 10px 12px; font-size: 13.5px; color: var(--p-text); font-family: inherit; resize: vertical; box-sizing: border-box; background: #fff; display: block; }
.p-pro-sign-preview-area { display: none; border-top: 1px dashed var(--p-border); padding: 10px 12px; font-size: 13.5px; color: var(--p-text); word-break: break-all; background: #fafafa; min-height: 24px; }
.p-pro-textarea:focus { border-color: var(--p-primary); }
.p-pro-textarea.sign-bold { font-weight: 700; }
.p-pro-textarea.sign-italic { font-style: italic; }
.p-sign-preview-body { font-size: 14px; color: var(--p-text); padding: 6px 0 14px; word-break: break-all; }
.p-sign-preview-body.sign-bold { font-weight: 700; }
.p-sign-preview-body.sign-italic { font-style: italic; }
.p-pro-submit { padding: 18px 0 6px; }
.p-pro-submit .p-btn { min-width: 110px; }

/* ===== 底部 ===== */
.p-footer {
    background: #111827;
    color: #9ca3af;
    padding: 24px 0;
    margin-top: auto;
}
.p-footer-inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}
.p-footer-links { margin-bottom: 8px; }
.p-footer-links a { color: #d1d5db; font-size: 13px; }
.p-footer-links i { margin: 0 10px; font-style: normal; }
.p-footer-copy { font-size: 12px; }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .p-main { padding: 24px 14px 40px; }
    .p-feat-grid { grid-template-columns: 1fr; }
    .p-site-grid { grid-template-columns: repeat(2, 1fr); }
    .p-auth-card { padding: 28px 22px 24px; }
    .p-header-inner { padding: 0 14px; }
    .p-nav a { padding: 7px 10px; font-size: 13px; }
}
