/* assets/css/style.css */
/* 公共样式 - 使用 CSS 变量，由主题配置动态覆盖 */

:root {
    --primary-color: #667eea;
    --primary-dark: #5568d3;
    --bg-gradient-start: #667eea;
    --bg-gradient-end: #764ba2;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    background: rgba(255, 255, 255, 0.95);
    padding: 16px 20px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.header h1 {
    color: var(--primary-color);
    font-size: 22px;
    margin-bottom: 4px;
}
.header p {
    color: #666;
    font-size: 13px;
}

.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    padding-bottom: 100px;
}

.message {
    margin-bottom: 20px;
    display: flex;
    animation: fadeIn 0.3s ease-in;
}
.message.user {
    justify-content: flex-end;
}
.message-bubble {
    max-width: 80%;
    padding: 14px 18px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.6;
    word-wrap: break-word;
}
.message.user .message-bubble {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
}
.message.assistant .message-bubble {
    background: white;
    color: #333;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.input-area {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 12px 15px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    display: flex;
    gap: 10px;
    align-items: flex-end;
}
.input-area textarea {
    flex: 1;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 15px;
    resize: none;
    max-height: 100px;
    font-family: inherit;
}
.send-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.force-btn {
    background: #ffc107;
    color: #856404;
    border: none;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 13px;
    cursor: pointer;
    flex-shrink: 0;
    align-self: center;
}

.welcome-card, .privacy-notice, .expired-notice, .framework-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}
.welcome-card h2, .framework-card h2 {
    color: var(--primary-color);
    margin-bottom: 12px;
    font-size: 20px;
}
.welcome-card ul {
    list-style: none;
    margin-bottom: 12px;
}
.welcome-card li {
    padding: 6px 0;
    color: #555;
    font-size: 14px;
}
.welcome-card li:before {
    content: "✓ ";
    color: var(--primary-color);
    font-weight: bold;
    margin-right: 8px;
}

.privacy-notice {
    background: #fff3cd;
    border: 1px solid #ffc107;
}
.privacy-notice h3 {
    color: #856404;
    margin-bottom: 12px;
    font-size: 16px;
}
.privacy-notice ul {
    list-style: none;
    margin-bottom: 16px;
}
.privacy-notice li {
    padding: 4px 0;
    color: #856404;
    font-size: 14px;
}
.privacy-notice li:before {
    content: "• ";
    color: #ffc107;
    font-weight: bold;
    margin-right: 8px;
}

.accept-btn, .next-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 10px 24px;
    font-size: 15px;
    cursor: pointer;
    width: 100%;
}
.accept-btn:hover, .next-btn:hover {
    background: var(--primary-dark);
}

.session-info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    border-radius: 8px;
    padding: 8px 16px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #0c5460;
}

.framework-card {
    border-left: 4px solid var(--primary-color);
}
.framework-card .chapter-item {
    padding: 14px 0;
    border-bottom: 1px solid #eee;
}
.framework-card .chapter-item:last-child {
    border-bottom: none;
}
.framework-card .chapter-title {
    font-weight: 600;
    color: #333;
    font-size: 16px;
}
.framework-card .chapter-theme {
    font-size: 13px;
    color: #555;
    margin-top: 4px;
}
.framework-card .chapter-meta {
    font-size: 13px;
    color: #666;
    margin-top: 4px;
    line-height: 1.5;
}
.framework-card .free-badge {
    background: #28a745;
    color: white;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    margin-left: 8px;
    display: inline-block;
}
.framework-card .paid-badge {
    background: #ffc107;
    color: #856404;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    margin-left: 8px;
    display: inline-block;
}

.copy-btn {
    position: fixed;
    bottom: 90px;
    right: 20px;
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 13px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: none;
}
.copy-btn:hover {
    background: var(--primary-color);
    color: white;
}

.progress-indicator {
    background: #e8f4f8;
    border-left: 4px solid var(--primary-color);
    padding: 10px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    color: #2c3e50;
    display: none;
}
.progress-indicator .badge {
    background: var(--primary-color);
    color: white;
    padding: 2px 12px;
    border-radius: 12px;
    font-size: 12px;
    margin-left: 8px;
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 14px 18px;
}
.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out;
}
.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 10px 16px;
    border-radius: 12px;
    margin-bottom: 16px;
    font-size: 14px;
}

.expired-notice {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    text-align: center;
    color: #721c24;
}
.expired-notice button {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 10px 24px;
    cursor: pointer;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}
.empty-state h3 {
    color: #333;
    margin-bottom: 12px;
}
.empty-state .btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 10px 24px;
    font-size: 15px;
    cursor: pointer;
    margin-top: 16px;
}
.empty-state .btn-primary:hover {
    background: var(--primary-dark);
}

.theme-entry {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}
.theme-entry h2 {
    color: var(--primary-color);
    font-size: 22px;
    margin-bottom: 16px;
    text-align: center;
}
.theme-entry .entry-checkbox {
    margin-right: 10px;
    width: 18px;
    height: 18px;
}
.theme-entry .entry-label {
    display: block;
    padding: 10px 0;
    font-size: 15px;
    border-bottom: 1px solid #f0f0f0;
}
.theme-entry .entry-label:last-child {
    border-bottom: none;
}
.theme-entry .entry-text {
    font-size: 16px;
    line-height: 1.8;
    color: #555;
    text-align: center;
    padding: 10px 0;
}

.next-area {
    margin-top: 20px;
    text-align: center;
}
.duplicate-warning {
    background: #fff3cd;
    color: #856404;
    padding: 10px 14px;
    border-radius: 12px;
    margin-bottom: 12px;
    font-size: 13px;
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 18px;
    }
    .framework-card .chapter-item {
        padding: 10px 0;
    }
}