/* Phrases page */
.phrases-page h2 {
    font-size: 1.4em;
    margin: 0 0 0.3em;
}

.phrases-intro {
    color: #555;
    font-size: 0.95em;
    line-height: 1.5;
    margin: 0 0 1.5em;
}

/* Table of contents */
.toc {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 0.8em 1.2em;
    margin-bottom: 2em;
}

.toc h3 {
    margin: 0 0 0.4em;
    font-size: 1em;
    color: #333;
}

.toc ol {
    margin: 0;
    padding-left: 1.4em;
    columns: 2;
    column-gap: 2em;
}

.toc li {
    font-size: 0.9em;
    margin-bottom: 0.2em;
    break-inside: avoid;
}

.toc a {
    color: #3366CC;
    text-decoration: none;
}

.toc a:hover {
    text-decoration: underline;
}

/* Category sections */
.phrase-category {
    margin-bottom: 2em;
}

.phrase-category h3 {
    font-size: 1.15em;
    margin: 0 0 0.3em;
    padding-bottom: 0.3em;
    border-bottom: 2px solid #3366CC;
}

.category-intro {
    font-size: 0.9em;
    color: #555;
    margin: 0.3em 0 0.8em;
    font-style: italic;
}

/* Table wrapper for horizontal scroll on mobile */
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Phrase table */
.phrase-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95em;
}

.phrase-table th {
    text-align: left;
    font-size: 0.85em;
    color: #666;
    padding: 0.4em 0.6em;
    border-bottom: 1px solid #ddd;
    white-space: nowrap;
}

.phrase-table td {
    padding: 0.5em 0.6em;
    border-bottom: 1px solid #eee;
    vertical-align: top;
}

.phrase-table tbody tr:hover {
    background: #f0f4ff;
}

/* Vietnamese text styling */
.phrase-table .viet {
    font-weight: 600;
    font-size: 1.05em;
    color: #222;
    white-space: nowrap;
}

/* Note column */
.phrase-table .note {
    font-size: 0.88em;
    color: #888;
    font-style: italic;
}

/* Alternating rows */
.phrase-table tbody tr:nth-child(even) {
    background: #fafafa;
}

.phrase-table tbody tr:nth-child(even):hover {
    background: #f0f4ff;
}

/* Responsive */
@media (max-width: 600px) {
    .toc ol {
        columns: 1;
    }

    .phrase-table {
        font-size: 0.9em;
    }

    .phrase-table .viet {
        font-size: 1em;
    }

    .phrase-table .note {
        font-size: 0.82em;
    }
}

/* Print */
@media print {
    .toc {
        break-after: avoid;
    }

    .phrase-category {
        break-inside: avoid;
    }

    .phrase-table tbody tr:hover {
        background: none;
    }

    .phrase-table tbody tr:nth-child(even) {
        background: #f5f5f5;
    }
}
