.stroke-tool {
    flex: 1 0 auto;
    color: #222;
}

.content-box {
    display: flex;
    flex-direction: column;
}

.input-area {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
}

.input-area label {
    font-weight: 600;
}

#chinese-text {
    box-sizing: border-box;
    width: 100%;
    min-height: 6rem;
    padding: 0.65rem;
    border: 1px solid #000;
    border-radius: 0;
    background: #fff;
    font: inherit;
    line-height: 1.5;
    resize: vertical;
}

.button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.button-group button {
    padding: 0.5rem 0.8rem;
    border: 1px solid #000;
    border-radius: 0;
    color: #222;
    background: #fff;
    font: inherit;
    cursor: pointer;
}

.button-group button:hover:not(:disabled) {
    background: #eee;
}

#generate-btn {
    border-color: var(--link-color);
    color: #fff;
    background: var(--link-color);
}

#generate-btn:hover {
    border-color: var(--link-hover-color);
    background: var(--link-hover-color);
}

.button-group button:disabled {
    border-color: #bbb;
    color: #777;
    background: #f4f4f4;
    cursor: not-allowed;
}

.sentence {
    display: none;
}

.stroke-container {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 1.5rem;
    padding: 2rem 0 1rem;
}

.character-box {
    box-sizing: border-box;
    width: 100%;
    padding: 1.5rem;
    border: 1px solid #ddd;
    background: #fff;
    text-align: center;
}

.metadata {
    color: #666;
    font-size: 0.85rem;
    text-align: left;
}

.char {
    margin-bottom: 1rem;
    color: #333;
    font-family: 'KaiTi', 'SimSun', sans-serif;
    font-size: 3.75rem;
}

.stroke-order {
    display: block;
    width: 100%;
    max-width: 500px;
    height: auto;
    margin: 0 auto;
}

.missing {
    padding: 3rem 0;
    color: #777;
    font-size: 1rem;
    font-style: italic;
}

.placeholder {
    margin: 0;
    color: #666;
}

.line-separator {
    width: 100%;
    height: 0;
    margin: 0.5rem 0;
    border: 0;
    border-top: 1px solid #000;
}

.tool-credits {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin: 1.5rem 0 0;
}

.data-attribution {
    margin: 0;
    color: #666;
    font-size: 0.85rem;
}

@media print {
    .nav-bar,
    .pattern-background,
    .back-link,
    .content-heading,
    .content-divider,
    .input-area,
    .button-group,
    .tool-credits,
    .stroke-container .placeholder {
        display: none;
    }

    .content-wrapper {
        display: block;
        min-height: 0;
        padding: 0;
    }

    .content-box {
        max-width: none;
        min-height: 0;
        padding: 0;
        border: 0;
    }

    .sentence {
        display: block;
    }

    .stroke-container {
        padding: 0;
    }

    .character-box {
        width: 90%;
        max-width: none;
        margin: 20px auto;
        padding: 20px;
        overflow: hidden;
        border: 1px solid #ddd;
        page-break-after: always;
    }

    .line-separator {
        display: block;
        width: 100%;
        max-width: none;
        height: 0;
        border-top: 4px solid #000;
        page-break-before: always;
    }
}
