.alphabet-container {
    max-width: 1100px;
    margin: 1rem auto;
    padding: 0 1rem;
    position: relative;
    z-index: 1;
}

.alphabet-main-row {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    justify-content: center;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .alphabet-main-row {
        flex-direction: column;
    }
}

.alphabet-tool-header {
    margin-bottom: 1.5rem;
}

.alphabet-tool-header h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.alphabet-tool-header .tool-description {
    color: #666;
    font-size: 1rem;
}

.alphabet-list-wrap {
    flex: 0 0 auto;
    width: fit-content;
    max-width: 100%;
}

.alphabet-detail-panel {
    flex: 0 0 280px;
    background: var(--surface-color);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: calc(60px + 1rem);
}

@media (max-width: 768px) {
    .alphabet-detail-panel {
        flex: none;
        width: 100%;
        position: static;
    }
}

.alphabet-detail-panel h2 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
    color: var(--text-color);
}

.alphabet-detail-placeholder {
    color: #666;
    margin: 0;
}

.alphabet-detail-active {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.alphabet-detail-active.hidden {
    display: none;
}

.alphabet-detail-content.hidden {
    display: none;
}

.alphabet-detail-char {
    font-size: 3.5rem;
    line-height: 1.2;
    font-family: Georgia, 'Times New Roman', serif;
}

.alphabet-detail-name {
    font-size: 1.25rem;
    color: #555;
}

.alphabet-stroke-animation-wrap {
    width: 100%;
    padding: 0.75rem;
    background: var(--background-color);
    border-radius: 6px;
}

.alphabet-stroke-animation-wrap h3 {
    font-size: 0.95rem;
    margin: 0 0 0.5rem;
    color: var(--text-color);
}

.alphabet-stroke-count {
    font-weight: normal;
    color: #555;
    font-size: 0.9em;
}

.alphabet-stroke-svg-container {
    width: 100%;
    aspect-ratio: 1;
    max-width: 140px;
    margin: 0 auto 0.5rem;
    min-height: 80px;
}

.alphabet-stroke-svg {
    width: 100%;
    height: 100%;
    display: block;
    color: var(--text-color);
}

.alphabet-stroke-svg path {
    fill: none;
    stroke: currentColor;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    animation: alphabet-stroke-draw 0.5s ease-out forwards;
}

@keyframes alphabet-stroke-draw {
    to { stroke-dashoffset: 0; }
}

.alphabet-replay-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    padding: 0.4rem 0.75rem;
}

.alphabet-detail-strokes {
    width: 100%;
    padding: 0.75rem;
    background: var(--background-color);
    border-radius: 6px;
    font-size: 0.95rem;
}

.alphabet-detail-strokes h3 {
    font-size: 0.95rem;
    margin: 0 0 0.5rem;
    color: var(--text-color);
}

.alphabet-detail-strokes p {
    margin: 0;
}

.alphabet-detail-panel .btn-play {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.alphabet-list-wrap {
    background: var(--surface-color);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.alphabet-list-wrap h2 {
    width: 100%;
    box-sizing: border-box;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
    color: var(--text-color);
}

.alphabet-row {
    margin-bottom: 1.5rem;
}

.alphabet-row:last-child {
    margin-bottom: 0;
}

.alphabet-row-title {
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-weight: 600;
}

.alphabet-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.alphabet-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 4rem;
    padding: 0.75rem 0.5rem;
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.alphabet-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px var(--shadow-hover);
    background: #fff;
}

.alphabet-char {
    font-size: 2rem;
    line-height: 1.2;
    margin-bottom: 0.25rem;
    font-family: Georgia, 'Times New Roman', serif;
}

.alphabet-name {
    font-size: 0.85rem;
    color: #555;
}

.alphabet-item.selected {
    border-color: var(--primary-color);
    background: #fff;
    box-shadow: 0 2px 8px var(--shadow-hover);
}

/* Guide language switcher */
.guide-lang-switcher {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.guide-lang-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-color);
}

.guide-lang-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.guide-lang-btn {
    padding: 0.35rem 0.65rem;
    font-size: 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--surface-color);
    color: var(--text-color);
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.guide-lang-btn:hover {
    background: var(--background-color);
    border-color: var(--primary-color);
}

.guide-lang-btn.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.what-is-alphabet-chart {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #0078d4;
}

.instructions-container h2 {
    font-size: 1.2rem;
    margin: 1.5rem 0 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #0078d4;
    color: var(--text-color);
}

.instructions-container .text-emphasis {
    font-weight: 600;
    color: var(--text-color);
}

.instructions-container p,
.instructions-container ul {
    margin-bottom: 0.75rem;
}

.alphabet-practice-sheet-section {
    max-width: 800px;
    margin: 2rem auto;
    padding: 1.5rem;
    background: var(--surface-color);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.alphabet-practice-sheet-section h2 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
    color: var(--text-color);
}

.practice-sheet-desc {
    margin-bottom: 1rem;
    color: #555;
    font-size: 0.95rem;
    line-height: 1.5;
}

.practice-sheet-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.practice-sheet-preview-wrap {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    background: #fff;
    max-height: 70vh;
    overflow: auto;
}

.practice-sheet-preview {
    font-family: Georgia, 'Times New Roman', serif;
}

.alphabet-sheet-table {
    width: 100%;
    min-width: 56rem;
    border-collapse: collapse;
    table-layout: fixed;
}

.alphabet-sheet-table colgroup col {
    width: 10%;
}

.alphabet-sheet-table th,
.alphabet-sheet-table td {
    border: 1px solid #333;
    padding: 0;
    vertical-align: middle;
    text-align: center;
    width: 10%;
    box-sizing: border-box;
}

.alphabet-sheet-table tr {
    display: table-row;
}

.alphabet-sheet-table td {
    display: table-cell;
}

.alphabet-sheet-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 5.6rem;
    height: 5.6rem;
    font-size: 4.55rem;
    box-sizing: border-box;
    font-family: Georgia, 'Times New Roman', serif;
}

.alphabet-sheet-cell.sample {
    position: relative;
    font-weight: bold;
    color: #1a1a1a;
    background: #f5f5f5;
    border-width: 2px !important;
}

.alphabet-sheet-cell .sheet-name {
    position: absolute;
    right: 0.25rem;
    bottom: 0.25rem;
    font-size: 0.9rem;
    font-weight: bold;
    color: #555;
    line-height: 1;
}

.alphabet-sheet-cell.trace {
    color: rgba(0, 0, 0, 0.25);
    font-weight: normal;
    background: #fafafa;
}

.alphabet-sheet-cell.blank {
    background: #fff;
    color: transparent;
}

@media print {
    body * {
        visibility: hidden;
    }

    #nav-container,
    #footer-container,
    .alphabet-practice-sheet-section .practice-sheet-options,
    .alphabet-practice-sheet-section .practice-sheet-actions,
    .alphabet-practice-sheet-section h2,
    .alphabet-practice-sheet-section .practice-sheet-desc {
        display: none !important;
    }

    .practice-sheet-preview-wrap,
    .practice-sheet-preview-wrap * {
        visibility: visible;
    }

    .practice-sheet-preview-wrap {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        max-height: none;
        overflow: visible;
        border: none;
        padding: 0.5rem;
        background: #fff;
    }

    .alphabet-sheet-table {
        page-break-inside: auto;
    }

    .alphabet-sheet-table tr {
        page-break-inside: avoid;
    }

    .alphabet-sheet-cell {
        min-height: 5.6rem;
        height: 5.6rem;
        font-size: 4.55rem;
    }
}
