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

:root {
    --primary-color: #ff2442;
    --secondary-color: #ff6b81;
    --success-color: #00d2a0;
    --warning-color: #ffa502;
    --danger-color: #ff4757;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-primary: #2d3436;
    --text-secondary: #636e72;
    --border-color: #dfe6e9;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.12);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 16px;
    line-height: 1.6;
    color: var(--text-primary);
}

/* 容器 */
.container {
    max-width: 800px;
    margin: 0 auto;
}

/* 头部 */
.header {
    background: var(--card-bg);
    padding: 24px 20px;
    border-radius: 16px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    margin-bottom: 20px;
}

.title {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

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

/* 输入区域 */
.input-section {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.label {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.textarea {
    width: 100%;
    min-height: 200px;
    padding: 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(255, 36, 66, 0.1);
}

.char-count {
    text-align: right;
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 8px;
}

/* 操作按钮区 */
.action-section {
    display: flex;
    gap: 12px;
}

.btn {
    flex: 1;
    padding: 16px 24px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.btn-primary {
    background: linear-gradient(135deg, #ff2442 0%, #ff6b81 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: #f8f9fa;
    color: var(--text-secondary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

/* 结果区域 */
.result-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 健康分卡片 */
.score-card {
    background: var(--card-bg);
    padding: 24px;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
}

.score-header h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
}

.score-display {
    display: flex;
    align-items: center;
    gap: 24px;
}

.score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    box-shadow: var(--shadow);
    position: relative;
    flex-shrink: 0;
}

.score-circle::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    z-index: -1;
}

.score-circle.excellent {
    background: linear-gradient(135deg, #00d2a0 0%, #06f593 100%);
    color: white;
}

.score-circle.excellent::before {
    background: linear-gradient(135deg, #00d2a0 0%, #06f593 100%);
    opacity: 0.3;
}

.score-circle.good {
    background: linear-gradient(135deg, #48dbfb 0%, #0abde3 100%);
    color: white;
}

.score-circle.good::before {
    background: linear-gradient(135deg, #48dbfb 0%, #0abde3 100%);
    opacity: 0.3;
}

.score-circle.warning {
    background: linear-gradient(135deg, #ffa502 0%, #ff6348 100%);
    color: white;
}

.score-circle.warning::before {
    background: linear-gradient(135deg, #ffa502 0%, #ff6348 100%);
    opacity: 0.3;
}

.score-circle.danger {
    background: linear-gradient(135deg, #ff4757 0%, #ee5a6f 100%);
    color: white;
}

.score-circle.danger::before {
    background: linear-gradient(135deg, #ff4757 0%, #ee5a6f 100%);
    opacity: 0.3;
}

.score-number {
    font-size: 42px;
    line-height: 1;
}

.score-label {
    font-size: 16px;
    margin-top: 4px;
}

.score-info {
    flex: 1;
}

.risk-level {
    margin-bottom: 12px;
}

.risk-badge {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.risk-badge.safe {
    background: #e8f8f5;
    color: #00d2a0;
}

.risk-badge.low {
    background: #e3f6fc;
    color: #0abde3;
}

.risk-badge.medium {
    background: #fff3e0;
    color: #ffa502;
}

.risk-badge.high {
    background: #ffe5e8;
    color: #ff4757;
}

.risk-description {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* 统计卡片 */
.stats-card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.stats-card h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.stat-item {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 12px;
    text-align: center;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-value.high-risk {
    color: var(--danger-color);
}

.stat-value.medium-risk {
    color: var(--warning-color);
}

.stat-value.low-risk {
    color: #48dbfb;
}

/* 违禁词列表卡片 */
.forbidden-list-card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.forbidden-list-card h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
}

.forbidden-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.forbidden-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
}

.forbidden-item.risk-high {
    background: #ffe5e8;
    color: #ff4757;
    border: 2px solid #ff4757;
}

.forbidden-item.risk-medium {
    background: #fff3e0;
    color: #ffa502;
    border: 2px solid #ffa502;
}

.forbidden-item.risk-low {
    background: #e3f6fc;
    color: #0abde3;
    border: 2px solid #0abde3;
}

.risk-icon {
    font-size: 12px;
}

/* 内容预览卡片 */
.preview-card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.preview-card h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
}

.content-preview {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 12px;
    font-size: 15px;
    line-height: 1.8;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.highlighted-word {
    background: #ff4757;
    color: white;
    padding: 2px 4px;
    border-radius: 4px;
    font-weight: 600;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}

.highlighted-word:hover {
    background: #ee5a6f;
    transform: scale(1.05);
}

.highlighted-word.risk-medium {
    background: #ffa502;
}

.highlighted-word.risk-medium:hover {
    background: #ff8800;
}

.highlighted-word.risk-low {
    background: #0abde3;
}

.highlighted-word.risk-low:hover {
    background: #0095c7;
}

/* 建议卡片 */
.suggestions-card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.suggestions-card h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
}

.suggestions-list {
    list-style: none;
}

.suggestions-list li {
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    border-left: 4px solid var(--primary-color);
}

/* 页脚 */
.footer {
    background: rgba(255, 255, 255, 0.95);
    padding: 16px;
    border-radius: 12px;
    text-align: center;
    margin-top: 20px;
    box-shadow: var(--shadow);
}

.footer p {
    font-size: 13px;
    color: var(--text-secondary);
}

/* 移动端适配 */
@media (max-width: 768px) {
    body {
        padding: 12px;
    }

    .title {
        font-size: 24px;
    }

    .subtitle {
        font-size: 13px;
    }

    .header {
        padding: 20px 16px;
    }

    .input-section,
    .score-card,
    .stats-card,
    .forbidden-list-card,
    .preview-card,
    .suggestions-card {
        padding: 16px;
    }

    .textarea {
        min-height: 180px;
        font-size: 16px; /* 防止iOS自动缩放 */
    }

    .action-section {
        flex-direction: column;
    }

    .btn {
        padding: 14px 20px;
        font-size: 15px;
    }

    .score-display {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }

    .score-circle {
        width: 100px;
        height: 100px;
    }

    .score-number {
        font-size: 36px;
    }

    .score-label {
        font-size: 14px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .stat-item {
        padding: 14px;
    }

    .forbidden-list {
        gap: 6px;
    }

    .forbidden-item {
        padding: 6px 10px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 20px;
    }

    .score-card h2,
    .stats-card h3,
    .forbidden-list-card h3,
    .preview-card h3,
    .suggestions-card h3 {
        font-size: 16px;
    }
}

/* 加载动画 */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

