/* 扫码快评 - 全局样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 50%, #f8f9fa 50.1%);
    min-height: 100vh;
    color: #333;
    -webkit-font-smoothing: antialiased;
}

/* 顶部标题区 */
.app-header {
    text-align: center;
    padding: 30px 20px 40px;
    color: #fff;
}
.app-header h1 { font-size: 26px; font-weight: 700; margin-bottom: 6px; text-shadow: 0 2px 10px rgba(0,0,0,0.1); }
.app-header p { font-size: 14px; opacity: 0.85; }

/* 主容器 */
.main-container {
    max-width: 480px;
    margin: -20px auto 0;
    padding: 0 12px 30px;
}

/* 卡片 */
.card {
    background: #fff;
    border-radius: 18px;
    padding: 20px;
    margin-bottom: 14px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}
.card-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.card-title .icon { font-size: 18px; }

/* 平台选择 */
.platform-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}
.platform-item {
    text-align: center;
    padding: 12px 4px;
    border-radius: 14px;
    border: 2px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.25s;
    background: #fafafa;
}
.platform-item:active { transform: scale(0.95); }
.platform-item.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102,126,234,0.08), rgba(118,75,162,0.08));
    box-shadow: 0 4px 12px rgba(102,126,234,0.15);
}
.platform-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 6px;
    font-size: 18px;
    color: #fff;
}
.platform-name { font-size: 12px; color: #555; font-weight: 500; }
.platform-item.selected .platform-name { color: #667eea; font-weight: 600; }

/* 场景选择 */
.scene-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.scene-tag {
    padding: 8px 14px;
    border-radius: 20px;
    background: #f5f5f5;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
    border: 1.5px solid transparent;
}
.scene-tag:active { transform: scale(0.95); }
.scene-tag.selected {
    background: linear-gradient(135deg, rgba(102,126,234,0.1), rgba(118,75,162,0.1));
    color: #667eea;
    border-color: #667eea;
    font-weight: 500;
}

/* 输入框 */
.form-group { margin-bottom: 14px; }
.form-label {
    display: block;
    font-size: 13px;
    color: #888;
    margin-bottom: 6px;
    font-weight: 500;
}
.form-input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #f0f0f0;
    border-radius: 12px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.3s;
    background: #fafafa;
}
.form-input:focus { border-color: #667eea; background: #fff; }
.form-input::placeholder { color: #ccc; }
textarea.form-input { min-height: 60px; resize: vertical; font-family: inherit; }

/* 评分星星 */
.rating-stars {
    display: flex;
    gap: 6px;
}
.star {
    font-size: 28px;
    cursor: pointer;
    transition: transform 0.15s;
    filter: grayscale(1);
    opacity: 0.4;
}
.star.active { filter: none; opacity: 1; }
.star:active { transform: scale(1.2); }

/* 关键词标签 */
.keyword-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.keyword-tag {
    padding: 7px 13px;
    border-radius: 18px;
    background: #f5f5f5;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
    border: 1.5px solid transparent;
    user-select: none;
}
.keyword-tag:active { transform: scale(0.95); }
.keyword-tag.selected {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border-color: transparent;
}

/* 生成按钮 */
.generate-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 6px;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 6px 20px rgba(102,126,234,0.3);
}
.generate-btn:active { transform: scale(0.97); }
.generate-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.generate-btn.loading { pointer-events: none; }

/* 结果弹窗 */
.result-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: none;
    align-items: flex-end;
    justify-content: center;
    animation: fadeIn 0.2s;
}
.result-overlay.show { display: flex; }
.result-panel {
    background: #fff;
    border-radius: 24px 24px 0 0;
    padding: 24px 20px 34px;
    width: 100%;
    max-width: 480px;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideUp 0.3s;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.result-platform {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
}
.result-close {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: #f0f0f0;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
    cursor: pointer;
    color: #999;
}
.result-text {
    background: #f8f9fa;
    border-radius: 14px;
    padding: 16px;
    font-size: 14px;
    line-height: 1.8;
    color: #444;
    white-space: pre-wrap;
    word-break: break-word;
    margin-bottom: 16px;
    max-height: 45vh;
    overflow-y: auto;
}
.result-actions {
    display: flex;
    gap: 10px;
}
.result-btn {
    flex: 1;
    padding: 13px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: transform 0.2s;
}
.result-btn:active { transform: scale(0.96); }
.btn-copy { background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; }
.btn-regen { background: #f0f0f0; color: #555; }
.btn-edit { background: #fff5f5; color: #ff4757; }

/* Toast */
.toast {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.78);
    color: #fff;
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 14px;
    z-index: 9999;
    display: none;
    animation: fadeIn 0.2s;
}

/* 加载动画 */
.spinner {
    display: inline-block;
    width: 18px; height: 18px;
    border: 2.5px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 小屏适配 */
@media (max-width: 360px) {
    .platform-grid { grid-template-columns: repeat(2, 1fr); }
    .app-header h1 { font-size: 22px; }
}
