/* ===== 全局重置 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===== 深色科技风基础 ===== */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'PingFang SC', 'Hiragino Sans GB', sans-serif;
    background: #0a0a0f;
    min-height: 100vh;
    padding: 0;
    color: #e0e0e8;
    line-height: 1.5;
    font-weight: 400;
    overflow-x: hidden;
}

/* 网格背景 */
.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 0;
}

.container {
    position: relative;
    z-index: 1;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 32px 40px;
}

/* ===== HEADER 品牌区 ===== */
header {
    text-align: center;
    padding: 56px 20px 40px;
    position: relative;
}

header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #00f0ff, #4066ff, transparent);
    border-radius: 1px;
}

.brand-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.brand-name {
    font-size: 46px;
    font-weight: 700;
    letter-spacing: 10px;
    display: flex;
    align-items: center;
    gap: 2px;
    font-family: 'SF Mono', 'Fira Code', 'Menlo', monospace;
}

.brand-char {
    background: linear-gradient(135deg, #00f0ff 0%, #4066ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 12px rgba(0, 240, 255, 0.3));
}

.brand-dot {
    font-size: 24px;
    color: rgba(255, 255, 255, 0.15);
    -webkit-text-fill-color: rgba(255, 255, 255, 0.15);
    margin: 0 4px;
}

.brand-slogan {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.35);
    font-weight: 400;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.brand-wechat {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(0, 240, 255, 0.08);
    border: 1px solid rgba(0, 240, 255, 0.2);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 13px;
    margin-top: 4px;
}

.brand-wechat:hover {
    background: rgba(0, 240, 255, 0.15);
    border-color: rgba(0, 240, 255, 0.4);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.2);
    transform: translateY(-2px);
}

.brand-wechat:active {
    transform: translateY(0) scale(0.98);
}

.wechat-label {
    color: rgba(255, 255, 255, 0.5);
    font-weight: 500;
    font-size: 12px;
}

.wechat-id {
    color: #00f0ff;
    font-weight: 600;
    font-family: 'SF Mono', 'Fira Code', 'Menlo', monospace;
    letter-spacing: 0.5px;
}

.copy-hint {
    font-size: 14px;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.brand-wechat:hover .copy-hint {
    opacity: 1;
}

/* ===== 主内容 - 垂直堆叠 ===== */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* ===== 通用模块卡片（玻璃态） ===== */
.module {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 28px 32px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: border-color 0.3s ease;
}

.module:hover {
    border-color: rgba(0, 240, 255, 0.12);
}

/* ===== 区块标题 ===== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #e0e0e8;
    letter-spacing: 0.5px;
}

/* ===== 按钮通用 ===== */
button {
    padding: 9px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.25s ease;
    letter-spacing: 0.3px;
}

.btn-clear {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-clear:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.85);
    border-color: rgba(255, 255, 255, 0.15);
}

.btn-clear:active {
    transform: scale(0.96);
}

.btn-copy {
    background: linear-gradient(135deg, #00f0ff, #4066ff);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.15);
    position: relative;
    overflow: hidden;
}

.btn-copy::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: left 0.5s ease;
}

.btn-copy:hover::before {
    left: 100%;
}

.btn-copy:hover {
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.3);
}

.btn-copy:active {
    transform: scale(0.96);
}

/* ===== 输入区域 ===== */
.input-area {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 16px 18px;
    font-size: 14px;
    line-height: 1.7;
    resize: vertical;
    font-family: inherit;
    transition: all 0.3s ease;
    background: rgba(0, 0, 0, 0.3);
    color: #d0d0d8;
    min-height: 320px;
}

.input-area:focus {
    outline: none;
    border-color: rgba(0, 240, 255, 0.3);
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.06), 0 0 20px rgba(0, 240, 255, 0.05);
}

.input-area::placeholder {
    color: rgba(255, 255, 255, 0.2);
}

/* ===== 风格选择器区块 ===== */
.style-section .section-header {
    margin-bottom: 16px;
}

.style-update-notice {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.25);
    font-weight: 400;
}

/* 分类 tab 按钮组 */
.category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.category-tab {
    padding: 8px 22px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
    letter-spacing: 0.5px;
}

.category-tab:hover {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.75);
    border-color: rgba(255, 255, 255, 0.12);
}

.category-tab.active {
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.12), rgba(64, 102, 255, 0.12));
    color: #00f0ff;
    border-color: rgba(0, 240, 255, 0.3);
    box-shadow: 0 0 16px rgba(0, 240, 255, 0.08);
}

/* 模板 chip 按钮组 */
.template-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.template-chip {
    padding: 6px 16px;
    font-size: 12px;
    font-weight: 400;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.02);
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.template-chip:hover {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
    border-color: rgba(255, 255, 255, 0.1);
}

.template-chip.active {
    background: rgba(0, 240, 255, 0.08);
    color: #00f0ff;
    border-color: rgba(0, 240, 255, 0.25);
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.1), inset 0 0 8px rgba(0, 240, 255, 0.03);
}

/* ===== 预览区域 ===== */
.preview-area {
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 28px;
    background: #ffffff;
    overflow-y: auto;
    min-height: 400px;
    transition: border-color 0.3s ease;
}

.preview-area:hover {
    border-color: rgba(0, 240, 255, 0.15);
}

.preview-area .placeholder {
    color: #aaa;
    text-align: center;
    padding: 80px 20px;
    font-size: 15px;
}

/* ===== 页脚 ===== */
footer {
    padding: 40px 20px 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.15);
    font-size: 12px;
}

/* ===== AI 格式化助手 ===== */
.ai-helper-title {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 10px;
    line-height: 1.4;
}

.ai-helper-box {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 16px 18px;
    margin-bottom: 20px;
}

.ai-step {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.ai-step-number {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00f0ff, #4066ff);
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
}

.ai-step-text {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.65);
    font-weight: 500;
    line-height: 1.4;
}

.ai-prompt-wrapper {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    align-items: flex-start;
}

.ai-prompt-content {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.35);
    line-height: 1.6;
    max-height: 75px;
    overflow-y: auto;
    font-family: inherit;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.ai-prompt-content::-webkit-scrollbar {
    width: 4px;
}

.ai-prompt-content::-webkit-scrollbar-track {
    background: transparent;
}

.ai-prompt-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.btn-copy-prompt {
    background: linear-gradient(135deg, #00f0ff, #4066ff);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.25s ease;
    flex-shrink: 0;
    box-shadow: 0 0 14px rgba(0, 240, 255, 0.12);
}

.btn-copy-prompt:hover {
    box-shadow: 0 0 24px rgba(0, 240, 255, 0.25);
}

.btn-copy-prompt:active {
    transform: scale(0.96);
}

.btn-copy-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}

.prompt-hint {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.25);
    line-height: 1.3;
    text-align: center;
    font-weight: 400;
}

/* 视觉引导箭头 */
.visual-guide-arrow {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 8px 0;
}

.arrow-line {
    width: 2px;
    height: 20px;
    background: repeating-linear-gradient(
        to bottom,
        #00f0ff 0,
        #00f0ff 4px,
        transparent 4px,
        transparent 8px
    );
    opacity: 0.4;
}

.arrow-tip {
    font-size: 14px;
    color: #00f0ff;
    line-height: 1;
    margin-top: -3px;
    opacity: 0.4;
}

/* ===== Toast 暗色主题 ===== */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    background: rgba(20, 20, 30, 0.95);
    border: 1px solid rgba(0, 240, 255, 0.15);
    border-radius: 16px;
    padding: 32px 44px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(0, 240, 255, 0.06);
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    max-width: 420px;
    text-align: center;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
}

.toast-icon {
    font-size: 48px;
    margin-bottom: 14px;
}

.toast-title {
    font-size: 20px;
    font-weight: 600;
    color: #e0e0e8;
    margin-bottom: 8px;
}

.toast-message {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.6;
    font-weight: 400;
}

.toast-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.toast-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

/* ===== 公众号预览基础 ===== */
.wechat-content {
    background: white;
    padding: 20px;
    line-height: 1.8;
    color: #333;
}

/* 禁止复制状态 */
.preview-area.no-copy {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.preview-area.no-copy::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

/* ===== 自定义滚动条（暗色） ===== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* 预览区内部保持亮色滚动条 */
.preview-area::-webkit-scrollbar-thumb {
    background: #d2d2d7;
}

.preview-area::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* ===== 验证条样式 ===== */
.auth-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, rgba(10, 10, 20, 0.98), rgba(20, 20, 35, 0.98));
    border-bottom: 1px solid rgba(0, 240, 255, 0.15);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 30px rgba(0, 240, 255, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 10000;
    padding: 16px 20px;
    display: none;
    animation: authBarSlideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes authBarSlideIn {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.auth-bar.slide-out {
    animation: authBarSlideOut 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes authBarSlideOut {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(-100%);
        opacity: 0;
    }
}

.auth-content {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.auth-icon {
    font-size: 20px;
    filter: drop-shadow(0 0 8px rgba(0, 240, 255, 0.4));
}

.auth-text {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.75);
    font-weight: 500;
    letter-spacing: 0.5px;
    line-height: 1.4;
}

.auth-input {
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #e0e0e8;
    font-size: 13px;
    font-family: 'SF Mono', 'Fira Code', 'Menlo', monospace;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    outline: none;
    min-width: 180px;
}

.auth-input::placeholder {
    color: rgba(255, 255, 255, 0.25);
}

.auth-input:focus {
    border-color: rgba(0, 240, 255, 0.4);
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.1), 0 0 20px rgba(0, 240, 255, 0.1);
}

.auth-input.error {
    border-color: rgba(255, 68, 68, 0.5);
    box-shadow: 0 0 0 3px rgba(255, 68, 68, 0.1);
}

.auth-btn {
    padding: 8px 20px;
    background: linear-gradient(135deg, #00f0ff, #4066ff);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 0 14px rgba(0, 240, 255, 0.15);
    position: relative;
    overflow: hidden;
}

.auth-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.auth-btn:hover::before {
    left: 100%;
}

.auth-btn:hover {
    box-shadow: 0 0 24px rgba(0, 240, 255, 0.3);
}

.auth-btn:active {
    transform: scale(0.96);
}

.auth-error {
    font-size: 12px;
    color: #ff4444;
    font-weight: 500;
    display: none;
    animation: errorShake 0.3s ease;
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

/* 界面锁定状态 */
.container.locked {
    position: relative;
    pointer-events: none;
    user-select: none;
}

.container.locked::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 999;
    border-radius: 16px;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .container {
        padding: 0 16px 32px;
    }

    header {
        padding: 40px 16px 32px;
    }

    .brand-name {
        font-size: 34px;
        letter-spacing: 6px;
    }

    .brand-slogan {
        font-size: 12px;
    }

    .module {
        padding: 20px 18px;
        border-radius: 12px;
    }

    .section-header h2 {
        font-size: 17px;
    }

    .input-area {
        min-height: 260px;
    }

    .preview-area {
        min-height: 300px;
        padding: 20px;
    }

    .category-tabs {
        gap: 8px;
    }

    .category-tab {
        padding: 7px 16px;
        font-size: 12px;
    }

    .template-chip {
        padding: 5px 12px;
        font-size: 11px;
    }

    .ai-prompt-wrapper {
        flex-direction: column;
    }

    .btn-copy-container {
        align-self: flex-start;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px 24px;
    }

    header {
        padding: 32px 10px 24px;
    }

    .brand-name {
        font-size: 28px;
        letter-spacing: 4px;
    }

    .module {
        padding: 16px 14px;
    }

    .section-header h2 {
        font-size: 16px;
    }

    .category-tab {
        padding: 6px 14px;
    }
}
