/* 锐写 - 文字转手写体工具 */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #8b5cf6;
    --primary-dark: #7c3aed;
    --primary-light: #a78bfa;
    --success: #10b981;
    --gray-50: #fafafa;
    --gray-100: #f4f4f5;
    --gray-200: #e4e4e7;
    --gray-300: #d4d4d8;
    --gray-400: #a1a1aa;
    --gray-500: #71717a;
    --gray-600: #52525b;
    --gray-700: #3f3f46;
    --gray-800: #27272a;
    --gray-900: #18181b;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    color: var(--gray-800);
    background: var(--gray-50);
    line-height: 1.6;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* 导航 */
.navbar {
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-size: 22px;
    font-weight: 700;
    color: var(--gray-900);
}

.logo-icon { font-size: 26px; }
.logo-text { background: linear-gradient(135deg, var(--primary), var(--primary-light)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

.nav-links { display: flex; align-items: center; gap: 24px; }

.nav-links a {
    text-decoration: none;
    color: var(--gray-500);
    font-size: 15px;
    transition: color 0.2s;
}

.nav-links a:hover, .nav-links a.active { color: var(--primary); }

.nav-user { display: flex; align-items: center; gap: 12px; }
.user-badge { font-size: 14px; color: var(--gray-700); }
.vip-tag { background: linear-gradient(135deg, #f59e0b, #d97706); color: white; font-size: 11px; padding: 2px 6px; border-radius: 4px; }
.menu-toggle { display: none; background: none; border: none; font-size: 24px; cursor: pointer; }

/* 按钮 */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 8px 20px; border-radius: 8px; font-size: 14px; font-weight: 500;
    cursor: pointer; border: 1px solid var(--gray-300); background: white;
    color: var(--gray-700); transition: all 0.2s; text-decoration: none;
}
.btn:hover { background: var(--gray-100); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 12px 28px; font-size: 16px; }
.btn-full { width: 100%; }
.btn-primary { background: var(--primary); color: white; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: white; border-color: var(--success); }
.btn-success:hover { background: #059669; }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: white; }

/* Hero区 */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 60px 0 50px;
    text-align: center;
}

.hero h1 { font-size: 38px; margin-bottom: 14px; line-height: 1.3; }
.hero .highlight { color: #fbbf24; }
.hero-desc { font-size: 17px; opacity: 0.9; max-width: 560px; margin: 0 auto 30px; }

.hero-stats { display: flex; justify-content: center; gap: 40px; }
.stat-item { text-align: center; }
.stat-num { display: block; font-size: 26px; font-weight: 700; }
.stat-label { font-size: 14px; opacity: 0.8; }

/* 工具区 */
.tool-section { padding: 40px 0; }

.tool-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    overflow: hidden;
}

.tool-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tool-header h2 { font-size: 18px; }

.usage-info { font-size: 14px; color: var(--gray-500); }
.usage-info strong { color: var(--primary); }
.login-hint { color: var(--primary); margin-left: 8px; }

.tool-body {
    display: flex;
    min-height: 500px;
}

/* 左侧编辑区 */
.editor-area {
    flex: 1;
    padding: 24px;
    border-right: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
}

.text-input-area { flex: 1; display: flex; flex-direction: column; }

.text-input-area textarea {
    flex: 1;
    width: 100%;
    min-height: 250px;
    padding: 16px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    font-size: 15px;
    line-height: 1.8;
    resize: vertical;
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s;
}

.text-input-area textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(139,92,246,0.1); }

.text-input-area .char-count {
    text-align: right;
    font-size: 13px;
    color: var(--gray-400);
    margin-top: 6px;
}

/* 选项区 */
.options-area {
    padding: 20px 0;
    border-top: 1px solid var(--gray-100);
    margin-top: 20px;
}

.options-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.option-group { flex: 1; min-width: 150px; }

.option-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-600);
    margin-bottom: 6px;
}

.option-group select, .option-group input[type="range"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    background: white;
}

.option-group select:focus { border-color: var(--primary); }

.range-value { font-size: 13px; color: var(--primary); float: right; }

.color-options {
    display: flex;
    gap: 8px;
}

.color-options label {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s;
    display: inline-block;
}

.color-options input[type="radio"] { display: none; }
.color-options input[type="radio"]:checked + label { border-color: var(--primary); }

/* 右侧预览区 */
.preview-area {
    flex: 1;
    padding: 24px;
    background: #fafafa;
    display: flex;
    flex-direction: column;
    position: relative;
}

.preview-placeholder {
    text-align: center;
    padding: 100px 20px;
}

.preview-placeholder .icon { font-size: 48px; margin-bottom: 12px; }
.preview-placeholder p { color: var(--gray-400); }

.preview-content {
    display: none;
    flex-direction: column;
    height: 100%;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.preview-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.preview-image-wrap {
    flex: 1;
    overflow: auto;
    background: #e4e4e7;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-image-wrap img {
    max-width: 100%;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

/* 加载 */
.loading-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.95);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 10;
}

.spinner {
    width: 48px; height: 48px;
    border: 4px solid var(--gray-200);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* 功能介绍 */
.features { padding: 80px 0; background: white; }
.section-title { text-align: center; font-size: 28px; margin-bottom: 48px; }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }

.feature-card {
    padding: 32px 24px; border-radius: 12px;
    background: var(--gray-50); text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.feature-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,0.08); }
.feature-icon { font-size: 36px; margin-bottom: 16px; }
.feature-card h3 { font-size: 18px; margin-bottom: 8px; }
.feature-card p { font-size: 14px; color: var(--gray-500); }

/* 价格 */
.pricing { padding: 80px 0; background: var(--gray-50); }
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; max-width: 800px; margin: 0 auto; }

.pricing-card {
    background: white; border-radius: 16px; box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    padding: 32px 24px; text-align: center; transition: transform 0.2s;
}
.pricing-card:hover { transform: translateY(-4px); }
.pricing-card.featured { border: 2px solid var(--primary); transform: scale(1.05); }
.pricing-card.featured:hover { transform: scale(1.05) translateY(-4px); }

.badge {
    background: var(--primary); color: white; padding: 4px 16px;
    border-radius: 20px; font-size: 12px; font-weight: 600;
    display: inline-block; margin-bottom: 12px;
}

.price { font-size: 36px; font-weight: 700; color: var(--primary); margin-bottom: 4px; }
.pricing-features { list-style: none; text-align: left; margin-bottom: 24px; }
.pricing-features li { padding: 8px 0; font-size: 14px; border-bottom: 1px solid var(--gray-100); }

/* FAQ */
.help { padding: 80px 0; background: white; }
.faq-list { max-width: 700px; margin: 0 auto; }
.faq-item { border: 1px solid var(--gray-200); border-radius: 8px; margin-bottom: 12px; overflow: hidden; }
.faq-question {
    padding: 16px 20px; font-weight: 500; cursor: pointer;
    background: var(--gray-50); display: flex; justify-content: space-between; align-items: center;
}
.faq-question::after { content: '+'; font-size: 20px; color: var(--gray-400); }
.faq-item.active .faq-question::after { content: '-'; }
.faq-answer { padding: 0 20px; max-height: 0; overflow: hidden; transition: all 0.3s; color: var(--gray-600); font-size: 14px; }
.faq-item.active .faq-answer { padding: 16px 20px; max-height: 300px; }

/* 页脚 */
.footer { background: var(--gray-900); color: var(--gray-400); text-align: center; padding: 32px 0; font-size: 14px; }
.footer a { color: var(--gray-400); text-decoration: none; }
.footer a:hover { color: white; }

/* 弹窗 */
.modal {
    display: none; position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5); z-index: 1000;
    align-items: center; justify-content: center;
}
.modal.show { display: flex; }
.modal-content { background: white; border-radius: 16px; padding: 32px; width: 100%; max-width: 400px; position: relative; }
.modal-close { position: absolute; top: 16px; right: 20px; font-size: 24px; cursor: pointer; color: var(--gray-400); }
.modal h2 { margin-bottom: 24px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; color: var(--gray-700); }
.form-group input { width: 100%; padding: 10px 14px; border: 1px solid var(--gray-300); border-radius: 8px; font-size: 14px; outline: none; }
.form-group input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(139,92,246,0.1); }
.form-footer { text-align: center; margin-top: 16px; font-size: 14px; color: var(--gray-500); }
.form-footer a { color: var(--primary); cursor: pointer; }

/* Toast */
.toast {
    position: fixed; top: 80px; right: 20px;
    padding: 12px 24px; border-radius: 8px; color: white;
    font-size: 14px; z-index: 2000; animation: slideIn 0.3s ease;
}
.toast.success { background: var(--success); }
.toast.error { background: #ef4444; }
.toast.warning { background: #f59e0b; }

@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* 响应式 */
@media (max-width: 768px) {
    .nav-links { display: none; flex-direction: column; position: absolute; top: 64px; left: 0; right: 0; background: white; padding: 16px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
    .nav-links.show { display: flex; }
    .menu-toggle { display: block; }
    .hero h1 { font-size: 26px; }
    .tool-body { flex-direction: column; }
    .editor-area { border-right: none; border-bottom: 1px solid var(--gray-200); }
    .options-row { flex-direction: column; }
    .feature-grid { grid-template-columns: 1fr; }
    .pricing-grid { grid-template-columns: 1fr; }
    .pricing-card.featured { transform: none; }
}