/* 小红书文案生成器 - 样式文件 */

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

:root {
    --primary-color: #ff2442;
    --primary-light: #ff6b81;
    --primary-dark: #e01f3d;
    --secondary-color: #fff0f3;
    --text-color: #333;
    --text-light: #666;
    --bg-color: #fafafa;
    --white: #ffffff;
    --shadow: 0 4px 20px rgba(255, 36, 66, 0.1);
    --shadow-hover: 0 8px 30px rgba(255, 36, 66, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* 导航栏 */
.navbar {
    background: var(--white);
    padding: 16px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo {
    font-size: 28px;
}

.brand-name {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-size: 15px;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--primary-color);
}

/* 主要容器 */
.main-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* 标题区域 */
.hero {
    text-align: center;
    margin-bottom: 40px;
}

.hero h1 {
    font-size: 36px;
    color: var(--text-color);
    margin-bottom: 12px;
}

.subtitle {
    font-size: 18px;
    color: var(--text-light);
}

/* 生成器卡片 */
.generator-section {
    margin-bottom: 60px;
}

.generator-card {
    background: var(--white);
    border-radius: 20px;
    padding: 40px;
    box-shadow: var(--shadow);
}

.generator-card h2 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--text-color);
    font-size: 22px;
}

/* 表单样式 */
.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-color);
}

.required {
    color: var(--primary-color);
}

.form-input, .form-select {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #eee;
    border-radius: 12px;
    font-size: 16px;
    transition: border-color 0.3s, box-shadow 0.3s;
    background: var(--white);
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(255, 36, 66, 0.1);
}

.form-input::placeholder {
    color: #aaa;
}

/* 生成按钮 */
.generate-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: var(--white);
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 36, 66, 0.3);
}

.generate-btn:active {
    transform: translateY(0);
}

/* 功能特点 */
.features-section {
    margin-bottom: 60px;
}

.features-section h2, .examples-section h2 {
    text-align: center;
    margin-bottom: 40px;
    font-size: 28px;
    color: var(--text-color);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
}

.feature-card {
    background: var(--white);
    border-radius: 16px;
    padding: 25px 20px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform 0.3s;
}

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

.feature-icon {
    font-size: 36px;
    display: block;
    margin-bottom: 12px;
}

.feature-card h3 {
    font-size: 16px;
    margin-bottom: 8px;
    color: var(--text-color);
}

.feature-card p {
    font-size: 13px;
    color: var(--text-light);
}

/* 案例展示 */
.examples-section {
    margin-bottom: 60px;
}

.examples-grid {
    display: grid;
    gap: 20px;
}

.example-card {
    background: var(--white);
    border-radius: 16px;
    padding: 25px;
    box-shadow: var(--shadow);
}

.example-tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    margin-bottom: 10px;
    margin-right: 10px;
}

.example-tag-title {
    background: var(--primary-color);
    color: var(--white);
}

.example-tag-content {
    background: #4CAF50;
    color: var(--white);
}

.example-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 15px;
}

.example-content {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.7;
}

/* 广告弹窗遮罩 */
.ad-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.ad-overlay.active {
    display: flex;
}

.ad-modal {
    background: var(--white);
    border-radius: 20px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    text-align: center;
}

.ad-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.ad-header h3 {
    font-size: 18px;
    color: var(--text-color);
}

.ad-timer {
    background: var(--primary-color);
    color: var(--white);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 14px;
}

.ad-content {
    margin-bottom: 20px;
}

.ad-placeholder-large {
    background: linear-gradient(135deg, #f5f5f5, #e0e0e0);
    border-radius: 12px;
    padding: 60px 20px;
    margin-bottom: 15px;
}

.ad-placeholder-large p {
    color: #888;
    font-size: 16px;
}

.ad-tip {
    font-size: 12px !important;
    color: #aaa !important;
    margin-top: 10px;
}

.ad-progress {
    height: 6px;
    background: #eee;
    border-radius: 3px;
    overflow: hidden;
}

.ad-progress-bar {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    transition: width 1s linear;
}

.ad-close-btn {
    width: 100%;
    padding: 14px;
    background: #ccc;
    color: var(--white);
    border: none;
    border-radius: 10px;
    font-size: 16px;
    cursor: not-allowed;
    transition: background 0.3s;
}

.ad-close-btn.active {
    background: var(--primary-color);
    cursor: pointer;
}

.ad-close-btn.active:hover {
    background: var(--primary-dark);
}

/* 结果弹窗 */
.result-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.result-overlay.active {
    display: flex;
}

.result-modal {
    background: var(--white);
    border-radius: 20px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.result-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #eee;
}

.result-modal-header h3 {
    font-size: 20px;
    color: var(--text-color);
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    line-height: 1;
}

.close-btn:hover {
    color: var(--primary-color);
}

.result-modal-body {
    padding: 25px;
}

.result-section {
    margin-bottom: 25px;
}

.result-section:last-of-type {
    margin-bottom: 20px;
}

.result-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.result-section-header h4 {
    font-size: 16px;
    color: var(--text-color);
}

.copy-btn {
    background: none;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
}

.copy-btn:hover {
    background: var(--primary-color);
    color: var(--white);
}

.result-title {
    background: var(--secondary-color);
    border-radius: 12px;
    padding: 18px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    line-height: 1.5;
}

.result-content-box {
    background: var(--secondary-color);
    border-radius: 12px;
    padding: 20px;
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-color);
    white-space: pre-wrap;
}

.result-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.tag {
    background: var(--white);
    color: var(--primary-color);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    border: 1px solid var(--primary-color);
}

.result-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.action-btn {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.action-btn.regenerate {
    background: #f5f5f5;
    color: var(--text-color);
}

.action-btn.regenerate:hover {
    background: #e0e0e0;
}

.action-btn.copy-all {
    background: var(--primary-color);
    color: var(--white);
}

.action-btn.copy-all:hover {
    background: var(--primary-dark);
}

/* 底部 */
.footer {
    background: var(--white);
    padding: 30px;
    text-align: center;
    border-top: 1px solid #eee;
}

.footer-content p {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 8px;
}

.footer-disclaimer {
    font-size: 12px;
    color: #aaa;
}

/* 提示消息 */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: var(--white);
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 2000;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translate(-50%, 10px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: var(--white);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 响应式 */
@media (max-width: 768px) {
    .navbar {
        padding: 12px 20px;
        flex-direction: column;
        gap: 15px;
    }
    
    .nav-links {
        gap: 20px;
    }
    
    .hero h1 {
        font-size: 28px;
    }
    
    .generator-card {
        padding: 25px;
    }
    
    .result-modal-body {
        padding: 20px;
    }
    
    .result-actions {
        flex-direction: column;
    }
    
    .result-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}