/* ==========================================================================
   1. 全局重置样式 (完全保留原始)
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft YaHei", sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: #f9f9f9;
    color: #333;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: #666;
    transition: all 0.2s ease;
}

ul, li {
    list-style: none;
}

/* ==========================================================================
   2. 统一交互组件 (完全保留原始)
   ========================================================================== */
button, input, select, textarea {
    outline: none;
    border: none;
    font-family: inherit;
    transition: all 0.2s ease;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    background-color: #000;
    color: #fff !important;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
}

.btn:hover {
    background-color: #333;
}

/* ==========================================================================
   3. 导航栏 (完全保留原始)
   ========================================================================== */
.header {
    background-color: #fff;
    border-bottom: 1px solid #f0f0f0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header .inner {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: #000;
}

.main-nav a {
    margin: 0 15px;
    font-size: 15px;
}

.main-nav a.active {
    color: #000;
    font-weight: 700;
}

/* ==========================================================================
   4. 核心布局容器 (【唯一修改处】：从 1200px 调整为宽屏)
   ========================================================================== */
.global-container {
    width: 95%;            /* 适配宽屏，占据 95% 屏幕宽度 */
    max-width: 1550px;     /* 将最大宽度从 1200px 提升至 1550px */
    margin: 0 auto;
    padding: 0 20px;
}

/* ==========================================================================
   5. 首页作品流 (完全保留原始逻辑，因容器变宽会自动撑开)
   ========================================================================== */
.works {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 30px;
}

.card {
    background-color: #fff;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
}

.card > img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

/* ==========================================================================
   6. 页脚与回到顶部 (完全保留原始)
   ========================================================================== */
.footer {
    margin-top: 60px;
    padding: 24px 0;
    background-color: #fff;
    text-align: center;
    border-top: 1px solid #f0f0f0;
}

.footer-content {
    font-size: 12px;
    color: #999;
}

.back-to-top {
    position: fixed;
    right: 30px;
    bottom: 30px;
    width: 50px;
    height: 50px;
    background-color: #000;
    color: #fff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

/* ==========================================================================
   7. 全局登录/注册一体化弹窗样式 (新增)
   ========================================================================== */
.auth-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px); /* 背景虚化效果，更显高级 */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.auth-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.auth-modal-content {
    background: #fff;
    width: 100%;
    max-width: 400px;
    border-radius: 20px;
    padding: 32px 32px 40px;
    position: relative;
    /* 初始状态缩小并下沉，配合 active 实现弹跳动画 */
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.auth-modal-overlay.active .auth-modal-content {
    transform: translateY(0) scale(1);
}

.auth-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.auth-modal-close:hover {
    color: #000;
}

.auth-modal-header {
    text-align: center;
    margin-bottom: 24px;
}

.auth-modal-title {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.auth-modal-subtitle {
    font-size: 13px;
    color: #888;
}

.auth-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    justify-content: center;
}

.auth-tab-btn {
    padding: 8px 20px;
    background: #f5f5f5;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    font-weight: 500;
    transition: all 0.2s;
}

.auth-tab-btn.active {
    background: #000;
    color: #fff;
}

.auth-panel {
    display: none;
}

.auth-panel.active {
    display: block;
}

.auth-form-item {
    margin-bottom: 16px;
}

.auth-form-item input {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    border: 1px solid #eee;
    border-radius: 12px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.auth-form-item input:focus {
    border-color: #000;
    outline: none;
}

.auth-code-group {
    display: flex;
    gap: 10px;
}

.auth-code-btn {
    width: 120px;
    height: 48px;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    flex-shrink: 0;
    transition: opacity 0.2s;
}

.auth-code-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.auth-submit-btn {
    width: 100%;
    height: 48px;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 12px;
    transition: transform 0.1s;
}
.auth-submit-btn:active {
    transform: scale(0.98);
}

.auth-wechat-wrapper {
    width: 200px;
    height: 200px;
    background: #fafafa;
    border: 1px solid #eee;
    margin: 0 auto 16px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 13px;
    flex-direction: column;
}

/* ==========================================================================
   8. 右上角用户信息与 VIP 黑金皇冠徽章
   ========================================================================== */
.user-info-wrapper {
    display: flex;
    align-items: center;
    white-space: nowrap; 
    gap: 12px; /* 核心修复：强制徽章、名字、退出按钮之间保持 12px 的安全间距 */
}

.vip-badge-glass {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #d4af37; /* 高级暗金色 */
    font-family: system-ui, -apple-system, sans-serif;
    
    /* 黑金液态玻璃质感 */
    background: rgba(20, 20, 20, 0.85); 
    backdrop-filter: blur(8px); 
    -webkit-backdrop-filter: blur(8px);
    
    border: 1px solid rgba(212, 175, 55, 0.3); /* 微弱的金色边缘反光 */
    border-radius: 12px; 
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15); 
}

.vip-badge-glass svg {
    margin-right: 4px; /* 皇冠图标与 PRO 文字的间距 */
}

.username-full {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    transition: color 0.2s ease;
    cursor: default;
}

.nav-divider {
    color: #ddd;
    font-size: 14px;
    margin: 0 2px;
}

.nav-logout-btn {
    font-size: 14px;
    color: #888;
    text-decoration: none;
    transition: color 0.2s;
}

.nav-logout-btn:hover {
    color: #ff4d4f; /* 悬停时变成警告红，增加交互感 */
}

/* ==========================================================================
   9. 全局高级定制确认弹窗
   ========================================================================== */
.custom-confirm-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    animation: fadeInOverlay 0.2s forwards;
}

.custom-confirm-box {
    background: #fff;
    width: 320px;
    padding: 30px 24px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    text-align: center;
    transform: translateY(20px);
    animation: slideUpBox 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.confirm-icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.custom-confirm-box h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: #1a1a1a;
}

.custom-confirm-box p {
    margin: 0 0 24px 0;
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    white-space: pre-line; /* 允许文本中的换行符生效 */
}

.confirm-actions {
    display: flex;
    gap: 12px;
}

.confirm-actions button {
    flex: 1;
    padding: 10px 0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    border: none;
}

.confirm-btn-cancel {
    background: #f5f5f5;
    color: #666;
}

.confirm-btn-cancel:hover {
    background: #e8e8e8;
}

.confirm-btn-submit {
    background: #1a1a1a;
    color: #fff;
}

.confirm-btn-submit:hover {
    background: #000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

@keyframes fadeInOverlay { to { opacity: 1; } }
@keyframes slideUpBox { to { transform: translateY(0); } }
/* ==========================================================================
   10. 修复全局消息提示 (Toast) 层级，防止被弹窗和毛玻璃遮挡
   ========================================================================== */
#toast-container {
    position: fixed !important;
    top: 20px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    z-index: 99999 !important; /* 设置超高层级，绝对碾压所有弹窗的 9999 和 10000 */
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.toast {
    box-shadow: 0 10px 30px rgba(0,0,0,0.15) !important;
}
/* ==========================================================================
   11. 登录弹窗内协议查看与首次确认
   ========================================================================== */
.auth-modal-shell {
    max-width: 440px;
}

.auth-modal-view {
    display: none;
}

.auth-modal-view.active {
    display: block;
}

.auth-policy-notice {
    margin-top: 18px;
    font-size: 12px;
    line-height: 1.8;
    color: #8c8c8c;
    text-align: center;
}

.auth-policy-notice-text {
    display: block;
}

.auth-policy-inline-list {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    gap: 14px;
    margin-top: 2px;
}

.auth-policy-inline-link {
    display: block;
    padding: 0;
    margin: 0;
    background: transparent;
    border: none;
    color: #1a1a1a;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.6;
    cursor: pointer;
}

.auth-policy-inline-link:hover {
    color: #000;
    text-decoration: underline;
}

.auth-policy-tip {
    margin-top: 6px;
    font-size: 12px;
    color: #b0b0b0;
    text-align: center;
}

.auth-policy-view-header {
    margin-bottom: 18px;
}

.auth-policy-back-btn {
    padding: 0;
    background: transparent;
    border: none;
    color: #666;
    font-size: 13px;
    cursor: pointer;
}

.auth-policy-back-btn:hover {
    color: #000;
}

.auth-policy-view-title {
    margin-top: 10px;
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
}

.auth-policy-view-meta {
    margin-top: 6px;
    font-size: 12px;
    color: #999;
}

.auth-policy-scroll {
    max-height: 420px;
    overflow-y: auto;
    padding-right: 4px;
}

.auth-policy-intro,
.auth-policy-section-text,
.auth-policy-footer-meta {
    font-size: 13px;
    line-height: 1.85;
    color: #666;
}

.auth-policy-intro {
    margin-bottom: 14px;
}

.auth-policy-section {
    margin-bottom: 14px;
}

.auth-policy-section-title {
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 700;
    color: #1a1a1a;
}

.auth-policy-footer-meta {
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

.auth-policy-view-actions,
.auth-policy-confirm-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.auth-secondary-btn {
    width: 100%;
    height: 48px;
    background: #f5f5f5;
    color: #666;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.auth-secondary-btn:hover {
    background: #ededed;
    color: #333;
}

.auth-policy-confirm-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 14px;
    border-radius: 18px;
    background: #f7f7f7;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.auth-policy-confirm-title {
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
}

.auth-policy-confirm-desc {
    margin-top: 12px;
    font-size: 13px;
    line-height: 1.85;
    color: #666;
    text-align: center;
}

.auth-policy-confirm-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 18px;
}

.auth-policy-card-link {
    width: 100%;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid #ececec;
    border-radius: 12px;
    background: #fff;
    color: #1a1a1a;
    font-size: 13px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
}

.auth-policy-card-link:hover {
    border-color: #d9d9d9;
    background: #fafafa;
}

.auth-policy-confirm-tip {
    margin-top: 14px;
    font-size: 12px;
    color: #999;
    text-align: center;
}


.auth-policy-confirm-actions {
    align-items: stretch;
}

.auth-policy-confirm-actions .auth-secondary-btn,
.auth-policy-confirm-actions .auth-submit-btn {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    margin-top: 0;
}

.auth-policy-confirm-actions .auth-submit-btn {
    align-self: stretch;
}

.auth-policy-confirm-actions .auth-secondary-btn {
    align-self: stretch;
}
