.tool-container {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin: 0 auto;
}

.input-section textarea {
    width: 100%;
    height: 150px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1.1rem;
    resize: vertical;
    margin-bottom: 20px;
    font-family: inherit;
}

.input-section textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

.options-bar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 30px;
}

.result-section {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
}

.result-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #333;
}

.stats {
    font-size: 0.9rem;
    color: #666;
}

.stats span {
    font-weight: bold;
    color: var(--primary-color);
    margin: 0 3px;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 15px;
}

.char-card {
    background: white;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 10px;
    text-align: center;
    transition: transform 0.2s;
    cursor: pointer;
}

.char-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border-color: var(--primary-color);
}

.char-text {
    font-size: 2rem;
    font-family: "KaiTi", "楷体", serif;
    margin-bottom: 5px;
    color: #333;
    line-height: 1;
}

.char-strokes {
    font-size: 0.9rem;
    color: #666;
    background: #f0f7ff;
    padding: 2px 6px;
    border-radius: 10px;
    display: inline-block;
}

/* Modal Styles */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #fff;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    animation: modalFadeIn 0.3s;
}

@keyframes modalFadeIn {
    from {opacity: 0; transform: translateY(-20px);}
    to {opacity: 1; transform: translateY(0);}
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.close-modal {
    font-size: 1.5rem;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    line-height: 1;
    background: none;
    border: none;
    padding: 0;
}

.close-modal:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
    text-align: center;
}

.draw-container {
    margin-bottom: 20px;
    min-height: 200px;
    display: flex;
    justify-content: center;
}

.stroke-controls {
    margin-bottom: 15px;
}

#replayBtn {
    padding: 8px 24px;
    background-color: white;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: 20px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

#replayBtn:hover {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(0,123,255,0.2);
    transform: translateY(-1px);
}

#replayBtn:active {
    transform: translateY(0);
}

#replayBtn::before {
    content: "↺";
    font-size: 1.2em;
    font-weight: bold;
}

.stroke-order-info {
    text-align: left;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    font-size: 0.95rem;
    line-height: 1.6;
}

