* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding-bottom: 20px;
}

.app {
    max-width: 600px;
    margin: 0 auto;
    background: #f5f5f5;
    min-height: 100vh;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header h1 {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.4;
    padding: 0 50px;
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 16px;
        padding: 0 40px;
    }
}

/* Tab切换 */
.tabs {
    display: flex;
    background: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.tab-btn {
    flex: 1;
    padding: 15px;
    border: none;
    background: white;
    color: #666;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    font-weight: 600;
}

.tab-content {
    display: none;
    padding: 20px;
}

.tab-content.active {
    display: block;
}

/* 扫描区域 */
.scan-area, .camera-area, .search-area {
    text-align: center;
}

.scan-tip {
    font-size: 18px;
    color: #666;
    margin-bottom: 20px;
}

video {
    width: 100%;
    max-width: 500px;
    border-radius: 12px;
    background: #000;
    margin: 20px 0;
    display: block;
}

.camera-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    max-height: 280px;
    margin: 20px auto;
    border-radius: 12px;
    overflow: visible;
    background: #000;
}

.camera-container video {
    width: 100%;
    height: 280px;
    object-fit: cover;
    display: block;
    margin: 0;
    border-radius: 12px;
}

/* 扫描框 - 适合扁长条形码 */
.scan-frame {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 85%;
    height: 120px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    pointer-events: none;
}

/* 四个角 */
.corner {
    position: absolute;
    width: 30px;
    height: 30px;
    border: 3px solid #52c41a;
}

.corner.top-left {
    top: -2px;
    left: -2px;
    border-right: none;
    border-bottom: none;
}

.corner.top-right {
    top: -2px;
    right: -2px;
    border-left: none;
    border-bottom: none;
}

.corner.bottom-left {
    bottom: -2px;
    left: -2px;
    border-right: none;
    border-top: none;
}

.corner.bottom-right {
    bottom: -2px;
    right: -2px;
    border-left: none;
    border-top: none;
}

/* 扫描线动画 */
.scan-line {
    position: absolute;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #52c41a, transparent);
    animation: scan 2s linear infinite;
}

@keyframes scan {
    0% { top: 0; }
    50% { top: 100%; }
    100% { top: 0; }
}

.scan-hint {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    white-space: nowrap;
}

.upload-section {
    margin: 20px 0;
}

.manual-input {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 12px;
    margin-top: 20px;
}

/* 按钮样式 */
.btn-primary, .btn-secondary, .btn-generate, .btn-copy {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    margin: 10px 0;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #52c41a;
    color: white;
    margin: 5px;
}

.quick-test {
    text-align: center;
}

.quick-test button {
    width: auto;
    padding: 10px 20px;
    margin: 5px;
    display: inline-block;
}

.btn-generate {
    background: #1890ff;
    color: white;
}

.btn-copy {
    background: #ff4d4f;
    color: white;
}

.btn-group {
    display: flex;
    gap: 10px;
}

.btn-group button {
    flex: 1;
}

/* 搜索框 */
.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

/* 统一搜索框 - 所有元素在一行 */
.search-unified {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

/* 紧凑搜索框 */
.search-box-compact {
    display: flex;
    gap: 8px;
    align-items: center;
}

.search-box-compact input {
    flex: 1;
    padding: 10px 12px;
    border: 2px solid #d9d9d9;
    border-radius: 8px;
    font-size: 14px;
}

.search-box-compact input:focus {
    outline: none;
    border-color: #667eea;
}

/* 级联选择 - 紧凑横向布局 */
.cascade-select-compact {
    display: flex;
    gap: 8px;
    align-items: center;
}

.select-box-compact {
    flex: 1;
    min-width: 100px;
    padding: 10px 12px;
    border: 2px solid #d9d9d9;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
}

.select-box-compact:focus {
    outline: none;
    border-color: #667eea;
}

.select-box-compact:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
    color: #999;
}

.input-compact {
    flex: 1;
    min-width: 120px;
    padding: 10px 12px;
    border: 2px solid #d9d9d9;
    border-radius: 8px;
    font-size: 14px;
}

.input-compact:focus {
    outline: none;
    border-color: #667eea;
}

.btn-compact {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.btn-compact:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-compact:disabled {
    background: #d9d9d9;
    cursor: not-allowed;
}

#search-input {
    flex: 1;
    padding: 15px;
    border: 2px solid #d9d9d9;
    border-radius: 8px;
    font-size: 16px;
}

#search-input:focus {
    outline: none;
    border-color: #667eea;
}

/* 搜索结果 */
.search-results {
    margin-top: 20px;
}

.result-item {
    background: white;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.result-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.item-name {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.item-price {
    font-size: 16px;
    color: #ff4d4f;
    font-weight: 600;
}

.item-info {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #666;
}

/* 结果展示 */
.result-area {
    padding: 20px;
}

.card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

.info-header {
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.info-title {
    font-size: 24px;
    color: #333;
    margin-bottom: 8px;
}

.info-brand {
    color: #667eea;
    font-size: 16px;
    font-weight: 600;
}

.info-row {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px solid #f5f5f5;
}

.label {
    color: #666;
    font-size: 16px;
    width: 120px;
}

.value {
    color: #333;
    font-size: 16px;
    flex: 1;
    font-weight: 500;
}

.features {
    margin-top: 15px;
}

.feature-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.tag {
    background: #e6f7ff;
    color: #1890ff;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 14px;
}

.description {
    margin-top: 15px;
}

.desc-text {
    margin-top: 10px;
    color: #666;
    line-height: 1.6;
    font-size: 15px;
}

/* 宣传话术 */
.promotion-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

.section-title {
    font-size: 20px;
    color: #333;
    margin-bottom: 15px;
}

.template-select {
    width: 100%;
    padding: 15px;
    border: 2px solid #d9d9d9;
    border-radius: 8px;
    font-size: 16px;
    margin-bottom: 15px;
}

.select-box {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #d9d9d9;
    border-radius: 8px;
    font-size: 16px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
}

.select-box:focus {
    outline: none;
    border-color: #667eea;
}

.select-box:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
    color: #999;
}

.cascade-select {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 12px;
}

.template-checkboxes {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.checkbox-item {
    display: inline-block;
    padding: 8px 15px;
    margin: 5px;
    background: white;
    border: 2px solid #d9d9d9;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.checkbox-item:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.checkbox-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-right: 6px;
    cursor: pointer;
    vertical-align: middle;
}

.checkbox-item input[type="checkbox"]:checked + span {
    color: #667eea;
    font-weight: 600;
}

.checkbox-item span {
    vertical-align: middle;
}

.promotion-result {
    background: #f6ffed;
    border: 2px solid #b7eb8f;
    border-radius: 8px;
    padding: 20px;
    margin-top: 15px;
}

.promotion-text {
    color: #333;
    line-height: 1.8;
    font-family: inherit;
    font-size: 15px;
    max-height: 600px;
    overflow-y: auto;
}

.promotion-item {
    background: white;
    padding: 20px;
    margin: 15px 0;
    border-radius: 8px;
    border-left: 4px solid #52c41a;
}

.promotion-item-title {
    font-size: 18px;
    font-weight: bold;
    color: #52c41a;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.promotion-item-content {
    white-space: pre-wrap;
    line-height: 1.8;
    color: #333;
}

/* 预览图片 */
.preview {
    margin: 20px 0;
}

.preview img {
    max-width: 100%;
    border-radius: 12px;
}

/* 加载动画 */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading p {
    color: white;
    margin-top: 20px;
    font-size: 18px;
}

/* Toast提示 */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 15px 30px;
    border-radius: 8px;
    display: none;
    z-index: 2000;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* 响应式 */
@media (max-width: 600px) {
    .header h1 {
        font-size: 20px;
    }
    
    .tab-btn {
        font-size: 14px;
        padding: 12px;
    }
    
    .info-title {
        font-size: 20px;
    }
}
/* 动销策略页面样式 */
.strategy-area {
    padding: 20px;
}

.section-title {
    font-size: 20px;
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

.filter-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.filter-section h4 {
    font-size: 16px;
    color: #333;
    margin-bottom: 15px;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: white;
}

.product-list-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.product-list-section h4 {
    font-size: 16px;
    color: #333;
    margin-bottom: 15px;
}

.product-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 15px;
}

.product-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.product-item:hover {
    background: #f8f9ff;
    border-color: #667eea;
}

.product-item.selected {
    background: #e6f7ff;
    border-color: #1890ff;
}

.product-checkbox {
    margin-right: 10px;
}

.product-info {
    flex: 1;
}

.product-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.product-tags {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.product-tag {
    background: #f0f0f0;
    color: #666;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

.product-tag.slim { background: #e6f7ff; color: #1890ff; }
.product-tag.capsule { background: #fff2e6; color: #fa8c16; }
.product-tag.low-tar { background: #f6ffed; color: #52c41a; }
.product-tag.high-price { background: #fff1f0; color: #ff4d4f; }

.strategy-result-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.strategy-result-section h4 {
    font-size: 16px;
    color: #333;
    margin-bottom: 15px;
}

.strategy-cards {
    display: grid;
    gap: 15px;
}

.strategy-card {
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9ff 0%, #fff 100%);
    transition: all 0.3s;
}

.strategy-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.strategy-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.strategy-description {
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
}

.strategy-details {
    background: rgba(102, 126, 234, 0.1);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.strategy-details h5 {
    color: #667eea;
    margin-bottom: 8px;
    font-size: 14px;
}

.strategy-details ul {
    margin: 0;
    padding-left: 20px;
    color: #666;
}

.strategy-details li {
    margin-bottom: 5px;
}

.strategy-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.strategy-difficulty {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.difficulty-easy { background: #f6ffed; color: #52c41a; }
.difficulty-medium { background: #fff7e6; color: #fa8c16; }
.difficulty-hard { background: #fff2f0; color: #ff4d4f; }

.strategy-copy-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.strategy-copy-btn:hover {
    background: #5a67d8;
}

@media (max-width: 480px) {
    .filter-grid {
        grid-template-columns: 1fr;
    }
    
    .strategy-footer {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
}
/* 动销策略模块样式 */
.marketing-strategy-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.marketing-result {
    margin-top: 20px;
}

#current-strategy-cards {
    display: grid;
    gap: 15px;
}

.current-strategy-card {
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 20px;
    background: linear-gradient(135deg, #f0f8ff 0%, #fff 100%);
    transition: all 0.3s;
}

.current-strategy-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.current-strategy-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.current-strategy-description {
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
}

.current-strategy-details {
    background: rgba(102, 126, 234, 0.1);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.current-strategy-details h5 {
    color: #667eea;
    margin-bottom: 8px;
    font-size: 14px;
}

.current-strategy-details ul {
    margin: 0;
    padding-left: 20px;
    color: #666;
}

.current-strategy-details li {
    margin-bottom: 5px;
}

.current-strategy-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.current-strategy-difficulty {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.current-strategy-copy-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.current-strategy-copy-btn:hover {
    background: #5a67d8;
}

.product-feature-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 15px;
    padding: 15px;
    background: #f8f9ff;
    border-radius: 8px;
}

.feature-tag {
    background: #667eea;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.feature-tag.slim { background: #1890ff; }
.feature-tag.medium { background: #722ed1; }
.feature-tag.capsule { background: #fa8c16; }
.feature-tag.low-tar { background: #52c41a; }
.feature-tag.high-end { background: #eb2f96; }
.feature-tag.imported { background: #13c2c2; }