/* 主容器样式 */
.unique-processor {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    font-family: Arial, sans-serif;
    box-sizing: border-box;
}

/* 表单样式 */
.processor-form {
    background: #fff;
    padding: 0;
    border-radius: 0;
    margin-top: 0;
}

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

.text-input, .text-output, .text-duplicates {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95rem;
    line-height: 1.5;
    resize: vertical;
    box-sizing: border-box;
    background: #fafafa;
    transition: border-color 0.3s ease;
}

.text-input:focus, .text-output:focus, .text-duplicates:focus {
    outline: none;
    border-color: #4CAF50;
    background: #fff;
}

.text-output, .text-duplicates {
    background: #f9f9f9;
}

/* 输出区域头部 - 新增样式 */
.output-area, .duplicates-area {
    position: relative;
}

.output-header, .duplicates-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding: 0 4px;
}

.output-title {
    font-weight: 600;
    color: #555;
    font-size: 0.95rem;
}

/* 复制按钮样式 - 类似聊天界面 */
.copy-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 12px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 32px;
    min-width: 60px;
}

.copy-btn:hover {
    background: #e9e9e9;
    color: #333;
    border-color: #ccc;
    transform: translateY(-1px);
}

.copy-btn:active {
    transform: translateY(0);
    background: #e0e0e0;
}

.duplicate-copy {
    padding: 4px 8px;
    min-width: auto;
}

.copy-icon {
    flex-shrink: 0;
}

.copy-text {
    font-size: 0.85rem;
}

/* 分隔符设置区域 */
.separator-settings {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .separator-settings {
        grid-template-columns: 1fr;
    }
}

.setting-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.setting-group label {
    font-weight: 600;
    color: #555;
    font-size: 0.9rem;
}

.setting-select, .custom-input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    background: white;
    box-sizing: border-box;
}

.setting-select {
    width: 100%;
    cursor: pointer;
}

.setting-select:focus, .custom-input:focus {
    outline: none;
    border-color: #4CAF50;
}

.custom-input {
    display: none;
    margin-top: 5px;
}

/* 按钮区域 - 优化手机端显示 */
.action-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin: 20px 0;
    padding: 15px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.action-buttons button {
    padding: 12px 8px;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    min-height: 44px;
    word-break: keep-all;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 平板和桌面端按钮更大 */
@media (min-width: 769px) {
    .action-buttons {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .action-buttons button {
        padding: 10px 20px;
        font-size: 0.95rem;
    }
}

/* 手机端小屏优化 */
@media (max-width: 480px) {
    .action-buttons {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .action-buttons button {
        padding: 10px 8px;
        font-size: 0.85rem;
        min-height: 40px;
    }
}

/* 中等屏幕优化 */
@media (min-width: 481px) and (max-width: 768px) {
    .action-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
}

.btn-primary {
    background: #4CAF50;
    color: white;
}

.btn-primary:hover {
    background: #45a049;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.btn-secondary {
    background: #2196F3;
    color: white;
}

.btn-secondary:hover {
    background: #0b7dda;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.btn-clear {
    background: #f44336;
    color: white;
}

.btn-clear:hover {
    background: #da190b;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* 消息提示区域 */
#process-messages {
    margin: 15px 0;
    padding: 12px;
    border-radius: 4px;
    display: none;
}

.error-message {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
    display: block !important;
}

.success-message {
    background: #e8f5e8;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
    display: block !important;
}

.loading {
    color: #666;
    font-style: italic;
}

/* 重复项显示区域 */
.duplicates-area {
    margin-top: 20px;
    animation: fadeIn 0.3s ease;
}

.duplicates-area label {
    font-weight: 600;
    color: #f44336;
    margin: 0;
    font-size: 0.95rem;
}

/* 使用提示 */
.usage-tips {
    margin: 20px 0;
    padding: 15px;
    background: #e8f5e8;
    border-radius: 4px;
    border-left: 4px solid #4CAF50;
}

.usage-tips p {
    margin: 0;
    color: #2e7d32;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* 功能说明区域 */
.tool-description {
    margin-top: 30px;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 4px;
}

.tool-description h5 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1.1rem;
}

.tool-description p {
    margin: 0 0 10px 0;
    color: #666;
    line-height: 1.6;
    font-size: 0.95rem;
}

.tool-description p:last-child {
    margin-bottom: 0;
}

/* 响应式调整 */
@media (max-width: 576px) {
    .text-input, .text-output, .text-duplicates {
        padding: 10px;
        font-size: 0.9rem;
    }
    
    .separator-settings {
        gap: 15px;
    }
    
    .setting-group label {
        font-size: 0.85rem;
    }
    
    .setting-select, .custom-input {
        padding: 6px 10px;
        font-size: 0.85rem;
    }
    
    .usage-tips, .tool-description {
        padding: 12px;
    }
    
    .tool-description h5 {
        font-size: 1rem;
    }
    
    .tool-description p {
        font-size: 0.9rem;
    }
    
    .copy-btn {
        padding: 4px 8px;
        font-size: 0.8rem;
        min-width: 50px;
    }
    
    .copy-text {
        font-size: 0.8rem;
    }
    
    .copy-icon {
        width: 14px;
        height: 14px;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 焦点状态 */
button:focus, select:focus, textarea:focus, input:focus {
    outline: 2px solid #4CAF50;
    outline-offset: 2px;
}

/* 按钮触摸优化 */
@media (hover: none) and (pointer: coarse) {
    .action-buttons button {
        padding: 14px 8px;
        min-height: 48px;
    }
    
    .action-buttons button:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
    
    .copy-btn:active {
        transform: scale(0.95);
        background: #e0e0e0;
    }
}

/* 禁用状态 */
button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}