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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* 头部 */
.header {
    text-align: center;
    margin-bottom: 30px;
    padding: 30px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    color: white;
}

.logo-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
}

.logo-icon {
    width: 60px;
    height: 60px;
    background: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 35px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.header h1 {
    font-size: 2.5em;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    margin-bottom: 10px;
}

.subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1em;
}

/* 章节标题 */
.section-title {
    font-size: 1.3em;
    margin-bottom: 15px;
    color: #444;
}

/* 风格选择区 */
.style-selector {
    margin-bottom: 30px;
}

.style-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.style-btn {
    background: #f5f5f5;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 12px 8px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.style-btn:hover {
    background: #e8e8e8;
    transform: translateY(-2px);
    border-color: #667eea;
}

.style-btn.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-color: #667eea;
}

.style-icon {
    font-size: 1.5em;
}

.style-name {
    font-size: 0.85em;
    text-align: center;
}

/* 对话区域 */
.chat-section {
    margin-bottom: 30px;
}

.input-area {
    margin-bottom: 20px;
}

.input-area label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #444;
}

textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1em;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s;
}

textarea:focus {
    outline: none;
    border-color: #667eea;
}

.generate-btn {
    width: 100%;
    margin-top: 15px;
    padding: 15px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

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

/* 加载动画 */
.loading {
    text-align: center;
    padding: 30px;
}

.loading.hidden {
    display: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f0f0f0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

.loading p {
    color: #666;
}

/* 输出区域 */
.output-area {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid #667eea;
}

.output-area.hidden {
    display: none;
}

.output-area label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #444;
}

.ai-reply {
    background: white;
    padding: 20px;
    border-radius: 8px;
    font-size: 1.05em;
    line-height: 1.6;
    color: #333;
    margin-bottom: 15px;
    white-space: pre-wrap;
}

.action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.action-btn {
    padding: 10px 20px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95em;
    transition: all 0.3s;
}

.action-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.action-btn.primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-color: #667eea;
}

.action-btn.primary:hover {
    opacity: 0.9;
}

/* 历史记录区 */
.history-section {
    margin-bottom: 30px;
}

.history-list {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 12px;
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 15px;
}

.empty-tip {
    text-align: center;
    color: #999;
    padding: 20px;
}

.history-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 3px solid #667eea;
}

.history-item .boss {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 5px;
}

.history-item .boss::before {
    content: '👔 老板：';
    font-weight: 600;
}

.history-item .reply {
    color: #333;
    font-size: 0.95em;
}

.history-item .reply::before {
    content: '💬 我：';
    font-weight: 600;
    color: #667eea;
}

.history-item .style-tag {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75em;
    margin-bottom: 8px;
}

.clear-btn {
    width: 100%;
    padding: 10px;
    background: #f5f5f5;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95em;
    transition: all 0.3s;
}

.clear-btn:hover {
    background: #e8e8e8;
}

/* 页脚 */
.footer {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.footer p {
    color: #999;
    font-size: 0.85em;
}

/* 隐藏类 */
.hidden {
    display: none !important;
}

/* 响应式 */
@media (max-width: 600px) {
    .style-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .header h1 {
        font-size: 2em;
    }
    
    .container {
        padding: 20px;
    }
}

/* 复制成功提示 */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.95em;
    z-index: 1000;
    animation: fadeInOut 2s;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateX(-50%) translateY(20px); }
    20% { opacity: 1; transform: translateX(-50%) translateY(0); }
    80% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-20px); }
}
