* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
}

body {
    background: linear-gradient(135deg, #1a2a6c, #2c3e50, #4a6fa5);
    color: #333;
    min-height: 100vh;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: start;
    padding-top: 30px;
}

.container {
    width: 100%;
    max-width: 850px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    padding: 30px;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.3);
    margin-top: 20px;
}

.container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #1a3a6c, #4a6fa5, #1a3a6c);
    z-index: 10;
}

header {
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 18px;
    border-bottom: 1px solid #eaeaea;
    position: relative;
}

header::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 70px;
    height: 2px;
    background: #4a6fa5;
    border-radius: 2px;
}

h1 {
    font-size: 2.1rem;
    color: #1a1a2e;
    margin-bottom: 10px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    background: linear-gradient(to right, #1a3a6c, #2c5282);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.subtitle {
    color: #4a5568;
    font-size: 1.05rem;
    max-width: 700px;
    margin: 10px auto 0;
    line-height: 1.7;
}

.input-area {
    margin-bottom: 25px;
    position: relative;
}

textarea {
    width: 100%;
    height: 180px;
    padding: 18px;
    border: 2px solid #4a6fa5;
    border-radius: 14px;
    font-size: 1.05rem;
    line-height: 1.7;
    resize: vertical;
    transition: all 0.3s;
    background: #f8fafc;
}

textarea:focus {
    outline: none;
    border-color: #2c5282;
    box-shadow: 0 0 0 3px rgba(44, 82, 130, 0.2);
}

textarea::placeholder {
    color: #718096;
    font-style: italic;
    opacity: 0.8;
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.stat-card {
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    border-radius: 14px;
    padding: 20px 8px;
    text-align: center;
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.09);
    transition: all 0.3s;
    border: 1px solid #e2e8f0;
    position: relative;
    overflow: hidden;
    cursor: help;
}

.stat-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #4a6fa5, #2c5282);
}

.stat-card.chinese-card::before {
    background: linear-gradient(90deg, #c0392b, #e74c3c);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 7px 18px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    font-size: 1.8rem;
    margin-bottom: 8px;
    color: #4a6fa5;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chinese-card .stat-icon {
    color: #e74c3c;
}

.stat-value {
    font-size: 2.2rem;
    font-weight: 800;
    margin: 6px 0;
    color: #1a202c;
    line-height: 1;
}

.stat-label {
    font-size: 1rem;
    font-weight: 600;
    color: #2d3748;
    margin-top: 4px;
}

.stat-description {
    font-size: 0.85rem;
    color: #718096;
    margin-top: 3px;
    display: none;
}

.analysis-section {
    margin-top: 25px;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.4s ease;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
}

.analysis-section.show {
    max-height: 600px;
    opacity: 1;
    margin-top: 30px;
}

.analysis-header {
    background: linear-gradient(to right, #2c5282, #4a6fa5);
    color: white;
    padding: 14px 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.15rem;
    cursor: pointer;
}

.analysis-header i.toggle-icon {
    margin-left: auto;
    transition: transform 0.3s;
}

.analysis-section.show .analysis-header i.toggle-icon {
    transform: rotate(180deg);
}

.analysis-content {
    background: #f8fafc;
    padding: 20px;
    line-height: 1.7;
}

.analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.analysis-item {
    background: white;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.07);
    border-left: 4px solid #4a6fa5;
    transition: all 0.3s;
}

.analysis-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.1);
}

.analysis-item.chinese {
    border-left-color: #e74c3c;
}

.analysis-item.english {
    border-left-color: #3498db;
}

.analysis-item.numbers {
    border-left-color: #2ecc71;
}

.analysis-item.symbols {
    border-left-color: #9b59b6;
}

.analysis-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c5282;
    margin: 5px 0;
}

.analysis-percent {
    font-size: 1.1rem;
    font-weight: 600;
    color: #4a6fa5;
    margin-top: 3px;
}

.analysis-label {
    font-size: 0.95rem;
    color: #4a5568;
    font-weight: 500;
}

.analysis-suggestions {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px dashed #cbd5e0;
}

.suggestion-title {
    font-weight: 600;
    color: #2c5282;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.suggestion-item {
    display: flex;
    margin: 10px 0;
    font-size: 1rem;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 8px;
    transition: all 0.2s;
}

.suggestion-item:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: translateX(5px);
}

.suggestion-icon {
    color: #2c5282;
    margin-right: 10px;
    min-width: 24px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 15px;
    padding-top: 20px;
    border-top: 1px dashed #e2e8f0;
}

.limit-control {
    display: flex;
    align-items: center;
    gap: 15px;
    background: #f8fafc;
    padding: 12px 20px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

label {
    font-weight: 600;
    color: #2c5282;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

input[type="number"] {
    width: 80px;
    padding: 8px 12px;
    border: 2px solid #a0aec0;
    border-radius: 10px;
    font-size: 1.05rem;
    font-weight: 600;
    text-align: center;
}

.buttons {
    display: flex;
    gap: 15px;
}

.btn {
    padding: 10px 22px;
    border: none;
    border-radius: 10px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.18);
}

.btn:active {
    transform: translateY(0);
}

.btn-clear {
    background: linear-gradient(to right, #e53e3e, #c53030);
    color: white;
}

.btn-analyze {
    background: linear-gradient(to right, #38a169, #2c7a7b);
    color: white;
}

.btn-analyze.active {
    background: linear-gradient(to right, #2c7a7b, #2a4e5f);
    box-shadow: 0 0 0 3px rgba(44, 122, 123, 0.3);
}

.limit-warning {
    color: #e53e3e;
    font-weight: 600;
    font-size: 1.1rem;
    margin: 18px 0 8px;
    text-align: center;
    min-height: 28px;
    padding: 8px 15px;
    border-radius: 10px;
    background: rgba(255, 240, 240, 0.85);
    border: 1px solid rgba(229, 62, 62, 0.4);
    display: none;
    font-weight: 700;
}

.limit-warning.show {
    display: block;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(229, 62, 62, 0.4); }
    70% { box-shadow: 0 0 0 8px rgba(229, 62, 62, 0); }
    100% { box-shadow: 0 0 0 0 rgba(229, 62, 62, 0); }
}

footer {
    text-align: center;
    margin-top: 25px;
    color: #4a5568;
    font-size: 0.95rem;
    padding-top: 15px;
    border-top: 1px solid #e2e8f0;
    font-weight: 500;
}

@media (max-width: 850px) {
    .stats-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .container {
        padding: 22px 18px;
        border-radius: 18px;
        margin: 10px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    textarea {
        height: 160px;
        font-size: 1rem;
        padding: 15px;
    }
    
    .stat-card {
        padding: 16px 5px;
    }
    
    .stat-value {
        font-size: 1.8rem;
    }
    
    .stat-label {
        font-size: 0.95rem;
    }
    
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .limit-control {
        width: 100%;
        justify-content: center;
    }
    
    .buttons {
        width: 100%;
        justify-content: center;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .analysis-grid {
        grid-template-columns: 1fr;
    }
}