* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --danger-color: #ff4757;
    --success-color: #2ed573;
    --warning-color: #ffa502;
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --bg-light: #f8f9fa;
    --border-color: #e1e8ed;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 
                 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: var(--primary-gradient);
    min-height: 100vh;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

/* 背景动画 */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(102, 126, 234, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(118, 75, 162, 0.3) 0%, transparent 50%);
    animation: backgroundMove 15s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes backgroundMove {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(30px, -30px); }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeInDown 0.6s ease-out;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.logo svg {
    animation: rotate 3s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

h1 {
    color: white;
    font-size: 2.5em;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    margin: 0;
}

.subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1em;
    font-weight: 300;
    letter-spacing: 1px;
}

/* 主内容区 */
.main-content {
    display: grid;
    gap: 25px;
}

.card {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: var(--shadow-lg);
    animation: fadeInUp 0.6s ease-out;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 区块头部 */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--bg-light);
}

.section-header h2 {
    color: var(--text-primary);
    font-size: 1.4em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.section-header h2 svg {
    color: #667eea;
}

.char-count {
    color: var(--text-secondary);
    font-size: 0.9em;
    font-weight: 500;
    padding: 4px 12px;
    background: var(--bg-light);
    border-radius: 20px;
}

/* 输入区域 */
#inputText {
    width: 100%;
    min-height: 180px;
    padding: 18px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 15px;
    line-height: 1.6;
    resize: vertical;
    transition: all 0.3s ease;
    font-family: inherit;
    color: var(--text-primary);
}

#inputText:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

#inputText::placeholder {
    color: #bdc3c7;
}

/* 按钮组 */
.button-group {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

button {
    padding: 12px 28px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    flex: 1;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    background: white;
    color: var(--text-secondary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-light);
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

/* 状态徽章 */
.status-badge {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status-badge::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-pending {
    background: #e8f4f8;
    color: #3498db;
}

.status-pending::before {
    background: #3498db;
}

.status-safe {
    background: #d4edda;
    color: #28a745;
}

.status-safe::before {
    background: #28a745;
    animation: pulse 2s ease-in-out infinite;
}

.status-warning {
    background: #fff3cd;
    color: #ff9f43;
}

.status-warning::before {
    background: #ff9f43;
    animation: pulse 2s ease-in-out infinite;
}

.status-danger {
    background: #f8d7da;
    color: #dc3545;
}

.status-danger::before {
    background: #dc3545;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* 高亮文本区域 */
.highlighted-text {
    min-height: 150px;
    padding: 20px;
    background: var(--bg-light);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    line-height: 1.8;
    font-size: 15px;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: var(--text-primary);
    position: relative;
}

.placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 150px;
    color: var(--text-secondary);
}

.placeholder svg {
    margin-bottom: 15px;
    color: var(--text-secondary);
}

.placeholder p {
    font-size: 1em;
    opacity: 0.7;
}

/* 违规词（红色） */
.violation-word {
    background: linear-gradient(135deg, #ff4757 0%, #ff6348 100%);
    color: white;
    padding: 3px 6px;
    border-radius: 4px;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(255, 71, 87, 0.3);
    position: relative;
    display: inline-block;
    animation: highlight 0.3s ease-out;
}

/* 容易违规词（橙色） */
.suspicious-word {
    background: linear-gradient(135deg, #ff9f43 0%, #ffa502 100%);
    color: white;
    padding: 3px 6px;
    border-radius: 4px;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(255, 159, 67, 0.3);
    position: relative;
    display: inline-block;
    animation: highlight 0.3s ease-out;
}

/* 重叠词（红色背景，橙色字体） */
.overlap-word {
    background: linear-gradient(135deg, #ff4757 0%, #ff6348 100%);
    color: #ffa502;
    padding: 3px 6px;
    border-radius: 4px;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(255, 71, 87, 0.3);
    position: relative;
    display: inline-block;
    animation: highlight 0.3s ease-out;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

@keyframes highlight {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 71, 87, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 8px rgba(255, 71, 87, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 2px 6px rgba(255, 71, 87, 0.3);
    }
}

/* 违规词列表 */
.violations-list {
    min-height: 120px;
    position: relative;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    color: var(--text-secondary);
}

.empty-state svg {
    margin-bottom: 15px;
}

.empty-state p {
    font-size: 1em;
    opacity: 0.7;
}

.stats {
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    border-left: 4px solid #667eea;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9em;
    margin-bottom: 5px;
}

.stat-value {
    color: #667eea;
    font-size: 1.8em;
    font-weight: 700;
}

.words-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.violation-item {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, #ff4757 0%, #ff6348 100%);
    color: white;
    padding: 10px 18px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(255, 71, 87, 0.3);
    animation: slideIn 0.3s ease-out;
    transition: transform 0.2s ease;
    cursor: pointer;
}

.violation-item:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 5px 15px rgba(255, 71, 87, 0.4);
}

.suspicious-item {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, #ff9f43 0%, #ffa502 100%);
    color: white;
    padding: 10px 18px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(255, 159, 67, 0.3);
    animation: slideIn 0.3s ease-out;
    transition: transform 0.2s ease;
    cursor: pointer;
}

.violation-item-single:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 5px 15px rgba(255, 159, 67, 0.4);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 15px;
    }
    
    h1 {
        font-size: 1.8em;
    }
    
    .subtitle {
        font-size: 0.9em;
    }
    
    .card {
        padding: 20px;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .btn-secondary {
        order: 2;
    }
    
    .stats {
        grid-template-columns: 1fr;
    }
}

/* 加载动画 */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading {
    animation: spin 1s linear infinite;
}
