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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

/* 头部样式 */
.header {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex: 1;
    justify-content: center;
}

.header h1 {
    color: #2c3e50;
    font-size: 24px;
    font-weight: 600;
    margin: 0;
}

.version {
    font-size: 12px;
    color: #95a5a6;
    font-weight: 400;
}

.user-info {
    color: #666;
    font-size: 14px;
}

.user-info #userId {
    font-weight: 600;
    color: #3498db;
}

/* 主要内容区域 */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* 上限提示样式 */
.limit-hint {
    font-size: 12px;
    color: #666;
    margin-bottom: 12px;
    padding: 6px 10px;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #3498db;
}

.limit-hint span {
    font-weight: 600;
}

.limit-hint span:first-child {
    color: #27ae60;
}

.limit-hint span:last-child {
    color: #3498db;
}

/* 区块样式 */
.section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

.header-info {
    color: #666;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 2px;
}

.header-info span:nth-child(2),
.header-info span:nth-child(4) {
    font-weight: 600;
    color: #3498db;
}

.header-info span:nth-child(2) {
    color: #27ae60;
}

.input-hint {
    font-size: 12px;
    color: #8395a7;
    margin-bottom: 12px;
    padding: 6px 10px;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #f39c12;
}

.section h2 {
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

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

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: #555;
    font-size: 14px;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* 按钮样式 */
.btn {
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-success:hover {
    background: #229954;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
    transform: translateY(-1px);
}

.btn-large {
    padding: 12px 24px;
    font-size: 16px;
}

/* 关键词输入组 */
.keyword-input-group {
    position: relative;
    margin-bottom: 16px;
}

.keyword-input-group input {
    width: 100%;
    padding: 10px 12px;
    padding-right: 80px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.keyword-input-group input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.keyword-input-group::after {
    content: '添加';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.keyword-input-group::after:hover {
    background: #2980b9;
}

/* 标签列表样式 */
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 40px;
    padding: 8px;
    border: 1px dashed #ddd;
    border-radius: 6px;
    background: #fafafa;
}

.tag {
    background: #3498db;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    animation: fadeIn 0.2s ease-in;
}

.tag .remove {
    cursor: pointer;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.tag .remove:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* 卖家输入组 */
.seller-input-group {
    margin-bottom: 16px;
}

.seller-result {
    margin-bottom: 16px;
    padding: 12px;
    background: #e8f5e8;
    border: 1px solid #27ae60;
    border-radius: 6px;
}

.seller-info-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#sellerNameDisplay {
    font-weight: 500;
    color: #27ae60;
}

.seller-subtitle {
    font-size: 14px;
    font-weight: 500;
    color: #2c3e50;
    margin: 20px 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #e9ecef;
}

/* 输入框和按钮组合 */
.input-with-button {
    display: flex;
    gap: 8px;
    align-items: center;
}

.input-with-button input {
    flex: 1;
}

.input-with-button .btn {
    flex-shrink: 0;
    white-space: nowrap;
    min-width: auto;
    width: auto;
    padding: 10px 16px;
}

/* 手机端优化 */
@media (max-width: 768px) {
    .input-with-button .btn {
        padding: 8px 12px;
        font-size: 13px;
    }
}

.textarea-with-button {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.textarea-with-button textarea {
    flex: 1;
}

.textarea-with-button .btn-small {
    flex-shrink: 0;
    margin-top: 0;
}

/* 关键词和卖家设置也使用section-header */
.section:not(:has(.section-header)) h2 {
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}

/* 卖家列表样式 */
.seller-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 12px;
}

.seller-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: fadeIn 0.2s ease-in;
}

.seller-info {
    flex: 1;
}

.seller-id {
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
}

.seller-name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.seller-remove {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.seller-remove:hover {
    background: #c0392b;
}

/* 按钮组 */
.button-group {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* 保存警告提示 */
.save-warning {
    margin-top: 8px;
    color: #e74c3c;
    font-size: 14px;
    text-align: center;
}

/* 消息提示 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #2c3e50;
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
    z-index: 1000;
    max-width: 300px;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success {
    background: #27ae60;
}

.toast.error {
    background: #e74c3c;
}

.toast.warning {
    background: #f39c12;
}

/* 加载提示 */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading.show {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

.loading-text {
    color: white;
    font-size: 14px;
}

/* 动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 16px;
    }
    
    .header {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .header h1 {
        font-size: 20px;
    }
    
    .section {
        padding: 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr 1fr;
    }
    
    .keyword-input-group {
        flex-direction: column;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .seller-list {
        grid-template-columns: 1fr;
    }
    
    .toast {
        right: 16px;
        left: 16px;
        max-width: none;
    }
}
