/* =========================================================
   auth.css — 登录/注册弹窗 + 导航栏 auth 按钮样式
   ========================================================= */

/* ===== 权限控制：游客隐藏 data-auth-gated 元素 ===== */
body.is-guest [data-auth-gated] { display: none !important; }

/* ===== 导航栏 auth 按钮 ===== */
.site-nav__auth {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid rgba(10, 61, 145, 0.3);
    color: var(--color-primary, #0A3D91);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
}
.site-nav__auth:hover {
    background: rgba(10, 61, 145, 0.08);
    border-color: rgba(10, 61, 145, 0.5);
}
.site-nav__auth svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}
.site-nav__auth--user {
    background: rgba(77, 163, 255, 0.15);
    border-color: rgba(77, 163, 255, 0.4);
}

/* ===== 登录/注册弹窗 ===== */
.auth-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.auth-modal[hidden] {
    display: none;
}
.auth-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 20, 40, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.auth-modal__dialog {
    position: relative;
    background: #fff;
    border-radius: 16px;
    padding: 36px 32px 28px;
    width: 90%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    animation: authFadeIn 0.3s ease;
}
@keyframes authFadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}
.auth-modal__close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 28px;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    transition: color 0.2s;
}
.auth-modal__close:hover {
    color: #0A3D91;
}

/* ===== Tab 切换 ===== */
.auth-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 28px;
    border-bottom: 2px solid #eef1f6;
}
.auth-tab {
    flex: 1;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    padding: 10px 0;
    font-size: 16px;
    font-weight: 600;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.auth-tab.is-active {
    color: #0A3D91;
    border-bottom-color: #1E6FD9;
}

/* ===== 表单 ===== */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.auth-form[hidden] {
    display: none;
}
.auth-form__group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.auth-form__label {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}
.auth-form__input {
    border: 1.5px solid #dfe3ec;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}
.auth-form__input:focus {
    border-color: #1E6FD9;
    box-shadow: 0 0 0 3px rgba(30, 111, 217, 0.12);
}
.auth-form__checkbox {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: #64748b;
    cursor: pointer;
}
.auth-form__checkbox input {
    margin-top: 2px;
    flex-shrink: 0;
}
.auth-form__checkbox span {
    line-height: 1.5;
}
.auth-form__submit {
    background: linear-gradient(135deg, #0A3D91, #1E6FD9);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
}
.auth-form__submit:hover {
    opacity: 0.92;
}
.auth-form__submit:active {
    transform: scale(0.98);
}
.auth-form__switch {
    text-align: center;
    font-size: 14px;
    color: #1E6FD9;
    cursor: pointer;
    margin: 0;
    transition: color 0.2s;
}
.auth-form__switch:hover {
    color: #0A3D91;
    text-decoration: underline;
}
.auth-form__notice {
    font-size: 12px;
    color: #94a3b8;
    text-align: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #eef1f6;
    line-height: 1.5;
}

/* ===== 忘记密码链接 + 表单 ===== */
.auth-form__forgot-link {
    text-align: right;
    font-size: 13px;
    color: #1E6FD9;
    cursor: pointer;
    margin: -4px 0 0;
    transition: color 0.2s;
    align-self: flex-end;
}
.auth-form__forgot-link:hover {
    color: #0A3D91;
    text-decoration: underline;
}
.auth-form__intro {
    font-size: 13px;
    color: #64748b;
    line-height: 1.6;
    margin: 0 0 4px;
    padding: 12px 14px;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 3px solid #1E6FD9;
}

/* 验证码输入行 */
.auth-form__code-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}
.auth-form__input--code {
    flex: 1 1 0;
    min-width: 0;
    letter-spacing: 0.15em;
    font-weight: 600;
}
.auth-form__code-btn {
    flex-shrink: 0;
    background: #f1f5fb;
    color: #0A3D91;
    border: 1.5px solid #d4ddee;
    border-radius: 8px;
    padding: 0 14px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}
.auth-form__code-btn:hover:not(:disabled) {
    background: #e3ecfb;
    border-color: #1E6FD9;
}
.auth-form__code-btn:disabled,
.auth-form__code-btn.is-counting {
    background: #eef1f6;
    color: #94a3b8;
    cursor: not-allowed;
    border-color: #e2e8f0;
}

/* ===== 响应式 ===== */
@media (max-width: 480px) {
    .auth-modal__dialog {
        padding: 28px 20px 20px;
    }
    .auth-form__input {
        font-size: 14px;
    }
}

/* =========================================================
   个人中心抽屉面板
   ========================================================= */
.user-panel {
    position: fixed;
    inset: 0;
    z-index: 9999;
}
.user-panel[hidden] {
    display: none;
}
.user-panel__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
}
.user-panel__drawer {
    position: absolute;
    top: 0;
    right: 0;
    width: 630px;
    max-width: 100%;
    height: 100%;
    background: #fff;
    display: flex;
    flex-direction: column;
    box-shadow: -8px 0 32px rgba(0,0,0,0.12);
    animation: userPanelIn 0.25s ease-out;
}
@keyframes userPanelIn {
    from { transform: translateX(100%); }
    to   { transform: translateX(0); }
}
.user-panel__header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(135deg, #0A3D91 0%, #1E6FD9 100%);
    color: #fff;
}
.user-panel__avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.user-panel__avatar svg {
    width: 24px;
    height: 24px;
    stroke: #fff;
}
.user-panel__user-info {
    flex: 1;
    min-width: 0;
}
.user-panel__name {
    font-size: 21px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.user-panel__email {
    font-size: 17px;
    opacity: 0.85;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.user-panel__admin-link {
    display: inline-block;
    margin-top: 8px;
    font-size: 13px;
    color: #fff;
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.35);
    padding: 5px 12px;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.2s;
    white-space: nowrap;
}
.user-panel__admin-link[hidden] {
    display: none;
}
.user-panel__admin-link:hover {
    background: rgba(255,255,255,0.28);
}
.user-panel__close {
    background: none;
    border: none;
    color: #fff;
    font-size: 26px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}
.user-panel__close:hover {
    background: rgba(255,255,255,0.2);
}
.user-panel__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.user-panel__tabs {
    display: flex;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}
.user-panel__tab {
    flex: 1;
    padding: 12px 8px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: #64748b;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    position: relative;
    transition: color 0.2s;
}
.user-panel__tab svg {
    width: 18px;
    height: 18px;
}
.user-panel__tab.is-active {
    color: #0A3D91;
    font-weight: 600;
}
.user-panel__tab.is-active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 3px;
    background: #0A3D91;
    border-radius: 2px;
}
.user-panel__count {
    font-style: normal;
    font-size: 16px;
    background: #e2e8f0;
    color: #475569;
    padding: 1px 7px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}
.user-panel__tab.is-active .user-panel__count {
    background: #0A3D91;
    color: #fff;
}
.user-panel__content {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}
.user-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #f1f5f9;
    margin-bottom: 8px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}
.user-item:hover {
    border-color: #0A3D91;
    box-shadow: 0 2px 8px rgba(10,61,145,0.1);
}
.user-item__thumb {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.user-item__brand {
    font-weight: 700;
    color: rgba(255,255,255,0.8);
    font-size: 19px;
}
.user-item__body {
    flex: 1;
    min-width: 0;
}
.user-item__code {
    font-size: 18px;
    font-weight: 600;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 6px;
}
.user-item__status {
    font-size: 16px;
    font-weight: 500;
    padding: 1px 8px;
    border-radius: 10px;
    background: #f1f5f9;
    color: #64748b;
}
.user-item__status.is-new { background: #fef3c7; color: #b45309; }
.user-item__status.is-contacted { background: #dbeafe; color: #1d4ed8; }
.user-item__status.is-quoted { background: #d1fae5; color: #047857; }
.user-item__status.is-closed { background: #f1f5f9; color: #64748b; }
.user-item__name {
    font-size: 17px;
    color: #64748b;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.user-item__products {
    margin-top: 4px;
}
.user-item__prod {
    font-size: 17px;
    color: #475569;
    line-height: 1.6;
    padding: 4px 0;
    word-break: break-word;
}
.user-item__prod + .user-item__prod {
    border-top: 1px dashed #e2e8f0;
}
.user-item__prod-id {
    font-weight: 700;
    color: #0A3D91;
}
.user-item__prod-qty {
    color: #dc2626;
    font-weight: 600;
}
.user-item__prod-name {
    color: #334155;
}
.user-item__prod-mat {
    color: #94a3b8;
    font-size: 16px;
}
.user-item__price {
    color: #ea580c;
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
}
/* 开发需求详情 */
.user-item__dev {
    margin-top: 6px;
    border: 1px dashed #10b981;
    border-radius: 8px;
    background: #ecfdf5;
    padding: 8px 10px;
}
.user-item__dev-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 6px;
    border-bottom: 1px dashed #a7f3d0;
    margin-bottom: 6px;
}
.user-item__swatch {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(0,0,0,.1);
    flex-shrink: 0;
}
.user-item__dev-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 12px;
}
.user-item__dev-cell {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}
.user-item__dev-label {
    font-size: 15px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.user-item__dev-val {
    font-size: 17px;
    color: #0f172a;
    font-weight: 600;
    word-break: break-word;
}
.user-item__date {
    font-size: 16px;
    color: #94a3b8;
    margin-top: 2px;
}
.user-item__arrow {
    color: #cbd5e1;
    font-size: 18px;
}
/* 收藏项：勾选框 + 链接 + 数量 */
.user-item--fav {
    padding: 12px 10px;
    gap: 8px;
}
.user-item__check {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    cursor: pointer;
}
.user-item__checkbox {
    width: 22px;
    height: 22px;
    accent-color: #0A3D91;
    cursor: pointer;
}
.user-item__link {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
    text-decoration: none;
    color: inherit;
}
.user-item__qty {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
.user-item__qty-btn {
    width: 30px;
    height: 30px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 6px;
    color: #475569;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.user-item__qty-btn:hover {
    border-color: #0A3D91;
    color: #0A3D91;
}
.user-item__qty-input {
    width: 46px;
    height: 30px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    text-align: center;
    font-size: 17px;
    color: #0f172a;
    font-family: inherit;
    -moz-appearance: textfield;
}
.user-item__qty-input::-webkit-outer-spin-button,
.user-item__qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
/* 生成样品订单按钮：未勾选灰色不可点，勾选后红色 */
.user-panel__gen-order {
    width: 100%;
    padding: 12px;
    margin-bottom: 10px;
    background: #f1f5f9;
    color: #94a3b8;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 19px;
    font-weight: 600;
    cursor: not-allowed;
    transition: all 0.2s;
}
.user-panel__gen-order.is-ready {
    background: #dc2626;
    border-color: #dc2626;
    color: #fff;
    cursor: pointer;
}
.user-panel__gen-order.is-ready:hover {
    background: #b91c1c;
    border-color: #b91c1c;
}
.user-empty {
    text-align: center;
    padding: 48px 20px;
    color: #64748b;
}
.user-empty__icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
}
.user-empty__icon svg {
    width: 26px;
    height: 26px;
    stroke: #94a3b8;
}
.user-empty__title {
    font-size: 19px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 4px;
}
.user-empty__desc {
    font-size: 17px;
    line-height: 1.6;
}
.user-panel__footer {
    padding: 16px 24px;
    border-top: 1px solid #e2e8f0;
}
.user-panel__logout {
    width: 100%;
    padding: 12px;
    background: #fff;
    color: #dc2626;
    border: 1px solid #fecaca;
    border-radius: 8px;
    font-size: 19px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.user-panel__logout:hover {
    background: #fef2f2;
    border-color: #dc2626;
}

/* ===== 响应式 ===== */
@media (max-width: 480px) {
    .user-panel__drawer {
        width: 100%;
    }
}
