
/* Forms */
.form-container, .login-container {
    max-width: 500px;
    margin: 2rem auto;
    padding: 2rem;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

input[type="text"],
input[type="password"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="number"],
input[type="file"],
select,
textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 16px;
}

textarea {
    resize: vertical;
    min-height: 120px;
}

.remember-account {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 1rem;
    font-weight: 500;
}

.login-remember-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 0.4rem;
}

.login-remember-group .remember-account {
    margin-bottom: 0.55rem;
}

.remember-account input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    margin: 0;
}

.login-helper-actions {
    margin-top: 0.75rem;
}

.login-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
    gap: 1.5rem;
    align-items: stretch;
}

.login-welcome-panel {
    position: relative;
    overflow: hidden;
    padding: 2rem;
    border-radius: 28px;
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.9), transparent 34%),
        linear-gradient(135deg, #eef7ff 0%, #f6f7ff 46%, #fef3c7 100%);
    border: 1px solid #dbeafe;
    box-shadow: 0 20px 45px rgba(59, 130, 246, 0.12);
}

.login-kicker {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    color: #1d4ed8;
    font-size: 0.92rem;
    font-weight: 700;
}

.login-welcome-panel h1 {
    margin: 1rem 0 0.7rem;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.12;
    color: #0f172a;
}

.login-welcome-copy {
    margin: 0;
    max-width: 34rem;
    font-size: 1.02rem;
    line-height: 1.8;
    color: #334155;
}

.login-feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem;
    margin-top: 1.5rem;
}

.login-feature-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(191, 219, 254, 0.95);
}

.login-feature-card strong {
    color: #0f172a;
    font-size: 1rem;
}

.login-feature-card span {
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.7;
}

.login-quote-card {
    display: flex;
    gap: 0.8rem;
    align-items: center;
    margin-top: 1.5rem;
    padding: 1rem 1.15rem;
    border-radius: 20px;
    background: rgba(15, 23, 42, 0.05);
    color: #334155;
}

.login-quote-mark {
    font-size: 2rem;
    line-height: 1;
    color: #f59e0b;
    font-weight: 800;
}

.login-quote-card p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Quick Time Selector */
.quick-time-selector {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.quick-scroll-list {
    display: flex;
    overflow-x: auto;
    gap: 0.4rem;
    padding-bottom: 0.25rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.quick-scroll-list::-webkit-scrollbar {
    display: none;
}
.quick-btn {
    flex: 0 0 auto;
    padding: 0.4rem 0.8rem;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #475569;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}
.quick-btn.active {
    background: #e0f2fe;
    border-color: #3b82f6;
    color: #1d4ed8;
    font-weight: 600;
}

.login-card-panel {
    max-width: none;
    margin: 0;
    padding: 2rem;
    border-radius: 28px;
    border: 1px solid #dbe7ff;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

.login-card-head {
    margin-bottom: 1.5rem;
}

.login-card-badge {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0.2rem 0.8rem;
    border-radius: 999px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 0.9rem;
    font-weight: 700;
}

.login-card-head h2 {
    margin: 0.75rem 0 0.35rem;
    color: #0f172a;
    font-size: 1.9rem;
}

.login-card-head p {
    margin: 0;
    color: #64748b;
    line-height: 1.7;
}

.login-action-row {
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
}

.login-action-row .btn,
.login-action-row button[type="submit"] {
    width: 50%;
}

.login-helper-actions .btn {
    background-color: #6c757d;
}

.login-helper-actions .btn:hover {
    background-color: #5a6268;
}

button[type="submit"], .btn {
    display: inline-block;
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-radius: 4px;
    color: #fff;
    background-color: #007bff;
    cursor: pointer;
    font-size: 1rem;
    text-align: center;
    text-decoration: none;
}

button[type="submit"]:hover, .btn:hover {
    background-color: #0056b3;
}

.btn-danger {
    background-color: #dc3545;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-success {
    background-color: #28a745;
}

.btn-success:hover {
    background-color: #218838;
}

.btn-warning {
    background-color: #ffc107;
    color: #333;
}

.btn-warning:hover {
    background-color: #e0a800;
}

/* 表格/行内小按钮 */
button.btn-sm,
.btn-sm {
    width: auto;
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
}

.btn-sm + .btn-sm {
    margin-left: 0.3rem;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5rem;
}

th, td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

th {
    background-color: #f8f9fa;
    font-weight: 600;
}

/* Messages */
.message {
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 4px;
    border: 1px solid transparent;
}

.success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.error {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 1rem;
    transform: translateX(-50%);
    background: rgba(20, 20, 20, 0.92);
    color: #fff;
    padding: 0.75rem 1rem;
    border-radius: 999px;
    font-size: 0.95rem;
    line-height: 1.2;
    box-shadow: 0 8px 24px rgba(0,0,0,0.22);
    z-index: 9999;
    max-width: calc(100vw - 2rem);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.toast.error {
    background: rgba(220, 53, 69, 0.95);
    border: 0;
    color: #fff;
}

/* Homework Specific */
.homework-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: background-color 0.3s;
    display: grid;
    grid-template-areas:
        "content content"
        "details actions";
    grid-template-columns: 1fr auto;
    gap: 1rem;
}

.homework-content { grid-area: content; }
.homework-content strong { display: block; font-size: 1.05rem; line-height: 1.3; }
.homework-content p { margin: 0.5rem 0 0; line-height: 1.6; word-break: break-word; }
.file-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 999px;
    background-color: #eef5ff;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}
.file-link:hover { background-color: #dbeaff; }
.homework-details { grid-area: details; display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.item-actions { grid-area: actions; display: flex; gap: 0.5rem; align-self: end; }

.detail-item { display: flex; align-items: center; gap: 0.5rem; }
.detail-item label { margin-bottom: 0; }
.detail-item select { min-width: 8.5rem; }

.homework-item.finished { background-color: #f0fff0; }
.homework-item.optional { border-left: 5px solid #17a2b8; }
.homework-item.must-not-finished { border-left: 5px solid #dc3545; }

.header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.date-filter-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.date-filter-form input[type="date"] {
    width: auto;
}

.date-filter-form label {
    margin-bottom: 0;
}

.header-actions .btn {
    width: auto;
}

.item-actions .btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    width: auto;
}

/* Action Buttons & Responsive Table */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 0;
    align-items: stretch;
}

.action-buttons .btn {
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 0.5rem 0.75rem;
}
.action-buttons .btn + .btn {
    margin-top: calc((1rem + (2 * 0.5rem)) / 2);
}

.child-action-buttons {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}
.child-action-buttons .btn {
    margin: 0 !important;
}

.btn-primary {
    background-color: #007bff;
}
.btn-primary:hover {
    background-color: #0056b3;
}

.btn-secondary {
    background-color: #6c757d;
}
.btn-secondary:hover {
    background-color: #5a6268;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.page-title {
    margin: 0;
    font-size: 1.5rem;
    line-height: 1.2;
}

.unit-page-meta {
    margin-top: 0.35rem;
    color: #666;
    font-size: 0.95rem;
}

.page-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.page-header-btn {
    width: auto;
    margin: 0;
    padding: 0.55rem 0.9rem;
    font-size: 0.95rem;
    line-height: 1.2;
}

.page-header-inline {
    flex-wrap: nowrap;
}

.page-header-inline .page-header-actions {
    margin-left: auto;
    width: auto;
    flex-wrap: nowrap;
}

.page-header-inline .page-header-btn {
    white-space: nowrap;
}

.unit-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.unit-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    background: #fff;
    text-decoration: none;
    color: inherit;
}

.unit-row:hover {
    border-color: #cfe0ff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}

.unit-row-title {
    font-size: 1.05rem;
    font-weight: 700;
}

.unit-row-subtitle {
    margin-top: 0.2rem;
    color: #666;
    font-size: 0.9rem;
}

.unit-row-right {
    color: var(--primary);
    font-weight: 700;
    white-space: nowrap;
}

.unit-tabs {
    position: sticky;
    top: 60px;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(248,251,255,0.96) 100%);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(217, 230, 255, 0.9);
}

.unit-tab {
    appearance: none;
    border: 1px solid #d9e6ff;
    background: linear-gradient(180deg, #ffffff 0%, #f5f8ff 100%);
    color: #3563c9;
    border-radius: 14px;
    padding: 0.9rem 0.75rem;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(53, 99, 201, 0.08);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
    position: relative;
    overflow: hidden;
}

.unit-tab::before {
    content: "";
    position: absolute;
    top: 0.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 2.2rem;
    height: 0.24rem;
    border-radius: 999px;
    background: rgba(53, 99, 201, 0.18);
    transition: background 0.18s ease, width 0.18s ease;
}

.unit-tab::after {
    content: "";
    position: absolute;
    left: 18%;
    right: 18%;
    bottom: 0.35rem;
    height: 3px;
    border-radius: 999px;
    background: transparent;
    transition: background 0.18s ease;
}

.unit-tab:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(53, 99, 201, 0.16);
    border-color: #bfd5ff;
}

.unit-tab.is-active {
    background: linear-gradient(180deg, #2d7dff 0%, var(--primary) 100%);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 14px 28px rgba(11, 94, 215, 0.26);
    transform: translateY(-2px) scale(1.015);
}

.unit-tab.is-active::before {
    background: rgba(255,255,255,0.35);
    width: 2.8rem;
}

.unit-tab.is-active::after {
    background: rgba(255,255,255,0.9);
}

.unit-tab-panel {
    display: none;
}

.unit-tab-panel.is-active {
    display: block;
}

.word-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.word-card {
    display: grid;
    grid-template-columns: 2.5rem minmax(0, 1fr);
    align-items: stretch;
    gap: 1rem;
    padding: 0.95rem 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    background: #fff;
}

.word-no {
    color: #666;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    text-align: right;
    align-self: center;
}

.word-card.important {
    border-left: 5px solid #ffc107;
}

.word-speak-icon {
    width: 1.05em;
    height: 1.05em;
    fill: currentColor;
    display: inline-block;
}

.word-text {
    color: #0f172a;
    font-size: 1.15rem;
    font-weight: 800;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.word-main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    min-width: 0;
}

.audio-actions,
.sentence-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    flex: 0 0 auto;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.speak-icon-btn {
    appearance: none;
    border: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.speak-icon-btn:active {
    transform: translateY(1px);
}

.speak-icon-btn-normal {
    background: #ffc107;
    color: #6b5200;
    box-shadow: inset 0 0 0 1px rgba(107, 82, 0, 0.08);
}

.speak-icon-btn-slow {
    background: #eef5ff;
    color: var(--primary);
    box-shadow: inset 0 0 0 1px rgba(11, 94, 215, 0.12);
}

.word-body {
    min-width: 0;
}

.word-line {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
    min-width: 0;
}

.word-line + .word-line {
    margin-top: 0.3rem;
}

.word-line-top {
    align-items: flex-start;
}

.word-line-bottom {
    align-items: flex-start;
}

.word-phonetic-inline {
    color: #666;
    font-size: 0.95rem;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    flex: 0 1 auto;
}

.word-translation {
    color: #111;
    font-weight: 600;
    text-align: right;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    flex: 1 1 10rem;
    margin-left: auto;
}

.segment-title {
    margin: 1rem 0 0.75rem;
    color: var(--primary);
    font-size: 0.98rem;
    font-weight: 800;
}

.segment-title:first-child {
    margin-top: 0;
}

.sentence-list,
.vocabulary-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sentence-card,
.vocabulary-card {
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    background: #fff;
    padding: 1rem;
}

.sentence-card.important {
    border-left: 5px solid #ffc107;
}

.sentence-card-title {
    background: linear-gradient(135deg, #f8fbff 0%, #eef5ff 100%);
}

.sentence-card-sub {
    background: #fafcff;
}

.sentence-main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.sentence-text-btn {
    appearance: none;
    border: 0;
    background: transparent;
    padding: 0;
    margin: 0;
    color: #0f172a;
    font-size: 1.05rem;
    line-height: 1.7;
    text-align: left;
    cursor: pointer;
    flex: 1 1 auto;
    min-width: 0;
}

.sentence-card-title .sentence-text-btn {
    font-size: 1.2rem;
    font-weight: 800;
}

.sentence-card-sub .sentence-text-btn {
    font-size: 1.1rem;
    font-weight: 700;
}

.translation-toggle {
    appearance: none;
    border: 0;
    background: #f1f5f9;
    color: #334155;
    border-radius: 999px;
    padding: 0.38rem 0.75rem;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
}

.translation-toggle-all {
    background: #e8f1ff;
    color: var(--primary);
}

.translation-toggle.is-open {
    background: var(--primary);
    color: #fff;
}

.sentence-translation {
    margin-top: 0.8rem;
    padding: 0.8rem 0.95rem;
    border-radius: 10px;
    background: #fff7db;
    color: #6b5200;
    line-height: 1.65;
}

.vocabulary-line {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.vocabulary-card.important {
    border-left: 5px solid #ffc107;
}

.vocabulary-content {
    margin-top: 0.8rem;
    padding-top: 0.8rem;
    border-top: 1px dashed #e5e7eb;
    min-width: 0;
    color: #334155;
    line-height: 1.65;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.vocabulary-content-head {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.45rem;
    margin-bottom: 0.45rem;
    flex-wrap: wrap;
}

.vocabulary-content-label {
    color: var(--primary);
    font-size: 0.88rem;
    font-weight: 800;
}

.vocabulary-content-head .audio-actions {
    gap: 0.35rem;
    width: auto;
}

.vocabulary-content-body {
    min-width: 0;
}

.vocabulary-content-empty {
    color: #94a3b8;
}

.vocabulary-word-wrap {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem;
    min-width: 0;
}

.vocabulary-word {
    color: #0f172a;
    font-size: 1.08rem;
    font-weight: 800;
}

.listen-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.listen-sidebar,
.listen-content {
    min-width: 0;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.listen-sidebar {
    position: sticky;
    top: 60px;
    padding: 1rem;
}

.listen-sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.listen-sidebar-title {
    color: #0f172a;
    font-size: 1rem;
    font-weight: 800;
}

.listen-sidebar-action {
    appearance: none;
    border: 1px solid #dbe7ff;
    border-radius: 999px;
    background: #fff;
    color: var(--primary);
    padding: 0.42rem 0.8rem;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.listen-category-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.listen-tree-node + .listen-tree-node {
    margin-top: 0.35rem;
}

.listen-tree-children {
    margin-top: 0.35rem;
    margin-left: 1rem;
    padding-left: 0.65rem;
    border-left: 1px dashed #dbe7ff;
}

.listen-tree-row {
    display: flex;
    align-items: stretch;
    gap: 0.45rem;
}

.listen-tree-row.is-active .listen-tree-label {
    border-color: var(--primary);
    background: linear-gradient(180deg, #2d7dff 0%, var(--primary) 100%);
    box-shadow: 0 12px 24px rgba(11, 94, 215, 0.18);
}

.listen-tree-row.is-active .listen-tree-title,
.listen-tree-row.is-active .listen-tree-meta {
    color: #fff;
}

.listen-tree-toggle,
.listen-tree-toggle-placeholder {
    flex: 0 0 2rem;
    width: 2rem;
    min-height: 2rem;
}

.listen-tree-toggle {
    appearance: none;
    border: 1px solid #dbe7ff;
    border-radius: 10px;
    background: #fff;
    color: var(--primary);
    font-size: 0.92rem;
    cursor: pointer;
}

.listen-tree-toggle.is-expanded {
    background: #eef5ff;
    border-color: var(--primary);
}

.listen-tree-toggle-placeholder {
    display: inline-block;
}

.listen-tree-label,
.listen-tree-folder-only {
    flex: 1 1 auto;
    min-width: 0;
    border: 1px solid #dbe7ff;
    border-radius: 12px;
    background: #f8fbff;
    padding: 0.72rem 0.8rem;
    text-align: left;
}

.listen-tree-label {
    appearance: none;
    cursor: pointer;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.listen-tree-label:hover {
    border-color: #bfd5ff;
    box-shadow: 0 6px 18px rgba(11, 94, 215, 0.08);
    transform: translateY(-1px);
}

.listen-tree-title,
.listen-tree-meta {
    display: block;
}

.listen-tree-title {
    color: #0f172a;
    font-size: 0.96rem;
    font-weight: 800;
    line-height: 1.45;
    word-break: break-word;
}

.listen-tree-meta {
    margin-top: 0.28rem;
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 700;
}

.listen-category-btn {
    appearance: none;
    width: 100%;
    border: 1px solid #dbe7ff;
    border-radius: 12px;
    background: #f8fbff;
    padding: 0.85rem 0.9rem;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.listen-category-btn:hover {
    border-color: #bfd5ff;
    box-shadow: 0 6px 18px rgba(11, 94, 215, 0.08);
    transform: translateY(-1px);
}

.listen-category-btn.is-active {
    border-color: var(--primary);
    background: linear-gradient(180deg, #2d7dff 0%, var(--primary) 100%);
    box-shadow: 0 12px 24px rgba(11, 94, 215, 0.18);
}

.listen-category-btn-title,
.listen-category-btn-meta {
    display: block;
}

.listen-category-btn-path {
    display: block;
    margin-top: 0.3rem;
    color: #64748b;
    font-size: 0.82rem;
    line-height: 1.4;
    word-break: break-word;
}

.listen-category-btn-title {
    color: #0f172a;
    font-size: 1rem;
    font-weight: 800;
}

.listen-category-btn.is-active .listen-category-btn-title,
.listen-category-btn.is-active .listen-category-btn-meta,
.listen-category-btn.is-active .listen-category-btn-path {
    color: #fff;
}

.listen-category-btn-meta {
    margin-top: 0.3rem;
    color: #64748b;
    font-size: 0.88rem;
}

.listen-content {
    padding: 1rem;
}

.listen-content-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid #eef2f7;
}

.listen-content-title {
    margin: 0;
    color: #0f172a;
    font-size: 1.25rem;
}

.listen-content-breadcrumb {
    margin-bottom: 0.35rem;
    color: #64748b;
    font-size: 0.84rem;
    line-height: 1.45;
    word-break: break-word;
}

.listen-content-meta,
.listen-storage-usage {
    margin-top: 0.35rem;
    color: #64748b;
    font-size: 0.94rem;
    line-height: 1.5;
}

.listen-track-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.listen-track-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
}

.listen-track-card.is-active {
    border-color: var(--primary);
    background: linear-gradient(180deg, #f7fbff 0%, #eef5ff 100%);
    box-shadow: 0 10px 24px rgba(11, 94, 215, 0.12);
}

.listen-track-card-main {
    min-width: 0;
}

.listen-track-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.listen-track-title {
    color: #0f172a;
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.4;
    word-break: break-word;
}

.listen-track-duration {
    color: var(--primary);
    font-weight: 800;
    white-space: nowrap;
}

.listen-track-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.65rem;
}

.listen-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.28rem 0.65rem;
    background: #eef5ff;
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 700;
}

.listen-badge.is-cached {
    background: #dcfce7;
    color: #15803d;
}

.listen-badge.is-complete {
    background: #fff7db;
    color: #9a6700;
}

.listen-track-progress {
    margin-top: 0.65rem;
    color: #475569;
    font-size: 0.92rem;
}

.listen-track-actions {
    display: flex;
    align-items: center;
}

.listen-track-btn {
    appearance: none;
    border: 0;
    border-radius: 999px;
    padding: 0.6rem 1rem;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    min-width: 5.25rem;
}

.listen-player-spacer {
    height: 260px;
}

.listen-player-spacer.is-hidden {
    height: 0;
}

.listen-player {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    padding: 1rem;
    border-top: 1px solid rgba(219, 231, 255, 0.9);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 -10px 30px rgba(15, 23, 42, 0.12);
}

.listen-player.is-collapsed {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.listen-player-toggle-row {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
}

.listen-player-panel {
    margin-top: 0.9rem;
}

.listen-player.is-collapsed .listen-player-panel {
    display: none;
}

.listen-player-toggle-row .listen-chip-btn {
    width: auto;
    min-width: 9rem;
}

.listen-player.is-collapsed .listen-player-toggle-row .listen-chip-btn {
    width: 100%;
    min-height: 3.25rem;
    font-size: 1.05rem;
    border-radius: 16px;
    background: linear-gradient(180deg, #2d7dff 0%, var(--primary) 100%);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 12px 28px rgba(11, 94, 215, 0.24);
}

.listen-player-main,
.listen-controls {
    max-width: 960px;
    margin: 0 auto;
}

.listen-player-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
    gap: 1rem;
    align-items: center;
}

.listen-now-label {
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 700;
}

.listen-now-title {
    margin-top: 0.2rem;
    color: #0f172a;
    font-size: 1.1rem;
    font-weight: 800;
    word-break: break-word;
}

.listen-now-meta {
    margin-top: 0.3rem;
    color: #64748b;
    font-size: 0.92rem;
}

.listen-progress-wrap {
    min-width: 0;
}

.listen-progress-time {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.45rem;
    color: #334155;
    font-size: 0.92rem;
    font-weight: 700;
}

.listen-progress {
    width: 100%;
}

.listen-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.9rem;
}

.listen-control-group {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.listen-control-btn,
.listen-chip-btn {
    appearance: none;
    border: 1px solid #dbe7ff;
    border-radius: 999px;
    padding: 0.58rem 0.9rem;
    background: #fff;
    color: #0f172a;
    font-weight: 700;
    cursor: pointer;
}

.listen-control-btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    min-width: 4.2rem;
    font-size: 1.2rem;
    letter-spacing: 0;
}

.listen-chip-btn.is-active {
    background: #eef5ff;
    border-color: var(--primary);
    color: var(--primary);
}

.listen-volume-group {
    margin-left: auto;
}

.listen-volume-group label {
    margin-bottom: 0;
    color: #334155;
    font-weight: 700;
}

.listen-volume-group input[type="range"] {
    width: 120px;
}

.listen-ab-status {
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 700;
}

.adjust-section + .adjust-section {
    margin-top: 1.5rem;
}

.adjust-section-head {
    margin-bottom: 0.75rem;
}

.adjust-section-head h2 {
    margin: 0;
    color: #0f172a;
    font-size: 1.15rem;
}

.adjust-section-meta {
    margin-top: 0.3rem;
    color: #64748b;
    font-size: 0.9rem;
}

.adjust-nav-card,
.adjust-card {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03);
}

.adjust-nav-card {
    padding: 0.85rem 1rem;
    margin-bottom: 1.2rem;
}

.adjust-card {
    padding: 0.85rem 1rem;
}

.adjust-card + .adjust-card {
    margin-top: 0.75rem;
}

.adjust-card-title {
    margin-bottom: 0.65rem;
    color: #0f172a;
    font-size: 0.95rem;
    font-weight: 800;
}

.adjust-module-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.adjust-module-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 5rem;
    padding: 0.55rem 0.85rem;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #fff;
    color: #334155;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s ease;
}

.adjust-module-tab:hover {
    border-color: #93c5fd;
    background: #eff6ff;
    color: #1d4ed8;
}

.adjust-module-tab.is-active {
    border-color: #2563eb;
    background: #2563eb;
    color: #fff;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.15);
}

.adjust-unit-layout {
    display: grid;
    gap: 0.85rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.adjust-unit-card {
    height: 100%;
}

.adjust-inline-actions {
    display: flex;
    gap: 0.65rem;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    margin-top: 0.85rem;
}

.adjust-current-chip {
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 0.9rem;
    font-weight: 700;
}

.adjust-inline-form,
.adjust-grid {
    display: grid;
    gap: 0.65rem;
}

.adjust-inline-form {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
}

.adjust-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.adjust-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.adjust-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.adjust-field {
    min-width: 0;
}

.adjust-field-wide {
    grid-column: 1 / -1;
}

.adjust-field label {
    margin-bottom: 0.35rem;
    font-size: 0.85rem;
    color: #475569;
    font-weight: 700;
}

.adjust-field input[type="text"],
.adjust-field input[type="number"],
.adjust-field select {
    padding: 0.5rem 0.65rem;
    font-size: 0.95rem;
    border-radius: 6px;
}

.adjust-field textarea {
    min-height: 96px;
    padding: 0.5rem 0.65rem;
    font-size: 0.95rem;
    border-radius: 6px;
}

.adjust-checkbox-field {
    display: flex;
    align-items: end;
}

.adjust-checkbox-field label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
    min-height: 2.2rem;
    font-size: 0.9rem;
    color: #334155;
    font-weight: 600;
}

.adjust-checkbox-field input[type="checkbox"] {
    width: 0.9rem;
    height: 0.9rem;
    margin: 0;
}

.adjust-actions {
    display: flex;
    gap: 0.65rem;
    justify-content: flex-end;
    margin-top: 0.85rem;
    flex-wrap: wrap;
}

.adjust-action-btn,
.adjust-inline-btn,
.adjust-submit-btn {
    width: auto;
    min-width: 7rem;
    padding: 0.5rem 0.85rem;
    font-size: 0.9rem;
}

.adjust-preview-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.adjust-preview-row {
    padding: 0.9rem;
    border: 1px dashed #dbe7ff;
    border-radius: 12px;
    background: #f8fbff;
}

.adjust-card-danger {
    border-color: #f5c2c7;
    background: linear-gradient(180deg, #fff9fa 0%, #fff 100%);
}

.adjust-danger-note,
.adjust-danger-tip {
    border-radius: 10px;
    padding: 0.85rem 0.95rem;
    line-height: 1.6;
}

.adjust-danger-note {
    margin-bottom: 0.9rem;
    background: #fff1f2;
    color: #8a1c2a;
    border: 1px solid #f5c2c7;
}

.adjust-danger-tip {
    margin-top: 0.9rem;
    background: #fff7db;
    color: #7a5600;
    border: 1px solid #ffe69c;
}

.adjust-log-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.adjust-log-item {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.9rem;
    background: #f8fafc;
}

.adjust-log-title {
    color: #0f172a;
    font-weight: 800;
}

.adjust-log-meta {
    margin-top: 0.3rem;
    color: #64748b;
    font-size: 0.9rem;
}

.adjust-log-detail,
.adjust-log-empty {
    margin-top: 0.45rem;
    color: #475569;
    line-height: 1.6;
}

.adjust-modal {
    position: fixed;
    inset: 0;
    z-index: 1100;
}

.adjust-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
}

.adjust-modal-dialog {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    padding: 1rem;
    box-sizing: border-box;
}

.adjust-modal-card {
    width: min(100%, 680px);
    max-height: calc(100vh - 2rem);
    overflow: auto;
}

.children-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

@media screen and (max-width: 1024px) {
    .child-manage-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .child-action-buttons {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .children-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media screen and (max-width: 768px) {
    .children-cards {
        grid-template-columns: 1fr;
    }

    header {
        margin-bottom: 1rem;
    }

    .form-container, .login-container {
        max-width: none;
        width: 100%;
        margin: 1rem auto;
        padding: 1rem;
        box-sizing: border-box;
    }

    .login-shell {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .login-welcome-panel,
    .login-card-panel {
        padding: 1rem;
        border-radius: 22px;
    }

    .login-card-panel {
        order: 1;
        margin: 0;
    }

    .login-welcome-panel {
        display: none;
    }

    .login-mobile-hero {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        margin: -1rem -1rem 1.5rem -1rem;
        padding: 2rem 1rem;
        background: linear-gradient(135deg, #eef7ff 0%, #fef3c7 100%);
        border-top-left-radius: 22px;
        border-top-right-radius: 22px;
        text-align: center;
    }

    .login-mobile-hero-icon {
        font-size: 3rem;
        margin-bottom: 0.5rem;
        animation: float 3s ease-in-out infinite;
    }

    @keyframes float {
        0% { transform: translateY(0px); }
        50% { transform: translateY(-10px); }
        100% { transform: translateY(0px); }
    }

    .login-mobile-hero-text {
        font-weight: 800;
        color: #1e3a8a;
        font-size: 1.15rem;
    }

    .login-card-head {
        text-align: center;
    }

    .login-card-badge {
        background: #fffbeb;
        color: #d97706;
        border: 1px solid #fef3c7;
    }

    input[type="text"],
    input[type="password"] {
        border-radius: 12px;
        padding: 0.85rem;
        border: 2px solid #e2e8f0;
        background-color: #f8fafc;
        transition: all 0.3s ease;
    }

    input[type="text"]:focus,
    input[type="password"]:focus {
        background-color: #fff;
        border-color: #3b82f6;
        outline: none;
        box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
    }

    body.page-login {
        background-color: #fff;
    }

    body.page-login main.container {
        padding: 0.5rem 1rem;
        background-color: transparent;
        box-shadow: none;
    }

    body.page-login header.site-header {
        margin-bottom: 0.5rem;
    }

    body.page-login footer {
        display: none;
    }

    .login-feature-grid {
        display: none;
    }

    .login-quote-card {
        display: none;
    }

    .login-card-head {
        margin-bottom: 1rem;
    }

    .login-card-head h2 {
        margin-top: 0.55rem;
        font-size: 1.55rem;
    }

    .login-card-head p {
        font-size: 0.92rem;
        line-height: 1.55;
    }

    .remember-account {
        margin-bottom: 0.85rem;
    }

    .login-action-row {
        flex-direction: row;
        gap: 0.5rem;
        flex-wrap: nowrap;
    }

    .login-action-row .btn,
    .login-action-row button[type="submit"] {
        width: 50%;
        min-width: 0;
        padding: 0.85rem 0.35rem;
        font-size: 0.95rem;
        font-weight: 700;
        border-radius: 14px;
        white-space: nowrap;
        border: none;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    }

    .login-action-row button[type="submit"] {
        background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
        box-shadow: 0 6px 16px rgba(37, 99, 235, 0.25);
    }

    .login-action-row .btn-secondary {
        background: #fff;
        color: #475569;
        border: 2px solid #e2e8f0;
    }

    .page-header {
        align-items: flex-start;
        margin-bottom: 1rem;
    }

    .page-header-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .unit-tabs {
        top: 60px;
        gap: 0.5rem;
        padding: 0.55rem;
        border-radius: 14px;
    }

    .unit-tab {
        padding: 0.72rem 0.4rem;
        font-size: 0.95rem;
        border-radius: 12px;
    }

    .unit-tab::after {
        left: 16%;
        right: 16%;
    }

    .word-card {
        grid-template-columns: 2.25rem minmax(0, 1fr);
        gap: 0.75rem;
        padding: 0.85rem 0.9rem;
    }

    .word-text { font-size: 1.05rem; }
    .word-phonetic-inline { font-size: 0.9rem; }
    .word-translation { font-size: 0.95rem; }
    .word-line-bottom { gap: 0.45rem 0.75rem; }
    .word-main,
    .sentence-main,
    .vocabulary-line,
    .vocabulary-content-head {
        flex-direction: column;
    }

    .audio-actions,
    .sentence-actions {
        width: 100%;
    }

    .vocabulary-content-head {
        display: inline-flex;
        flex-direction: row;
    }

    .vocabulary-content-head .audio-actions {
        width: auto;
    }

    .listen-content-header,
    .listen-track-card,
    .listen-player-main {
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .listen-layout {
        grid-template-columns: 1fr;
    }

    .listen-sidebar {
        position: static;
    }

    .listen-track-card-head,
    .listen-content-header {
        flex-direction: column;
    }

    .listen-track-actions {
        width: 100%;
    }

    .listen-track-btn {
        width: 100%;
    }

    .listen-player {
        padding: 0.85rem;
    }

    .listen-player-spacer {
        height: 360px;
    }

    .listen-player-spacer.is-hidden {
        height: 0;
    }

    .listen-controls {
        gap: 0.6rem;
    }

    .listen-control-group,
    .listen-volume-group {
        width: 100%;
        margin-left: 0;
    }

    .adjust-inline-form,
    .adjust-unit-layout,
    .adjust-grid-2,
    .adjust-grid-3,
    .adjust-grid-4 {
        grid-template-columns: 1fr;
    }

    .adjust-actions {
        flex-direction: column;
    }

    .adjust-action-btn,
    .adjust-inline-btn,
    .adjust-submit-btn {
        width: 100%;
    }

    .listen-control-btn,
    .listen-chip-btn {
        flex: 1 1 auto;
        text-align: center;
    }

    .listen-volume-group input[type="range"] {
        width: 100%;
        flex: 1;
    }

    .sentence-text-btn {
        font-size: 1rem;
    }

    .sentence-card-title .sentence-text-btn {
        font-size: 1.12rem;
    }

    .sentence-card-sub .sentence-text-btn {
        font-size: 1.04rem;
    }

    .header-actions {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
    }

    .date-filter-form {
        width: auto;
        flex: 1;
        flex-wrap: nowrap;
        justify-content: flex-start;
    }

    .date-filter-form input[type="date"] {
        width: auto;
        flex: 1;
        min-width: 120px;
    }

    .date-filter-form label {
        width: auto;
        white-space: nowrap;
    }

    .header-actions .btn {
        flex: none;
        white-space: nowrap;
    }

    header .container,
    .site-header-inner {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    nav ul,
    .site-nav ul {
        justify-content: center;
    }

    nav a,
    .site-nav a {
        width: 100%;
    }

    table thead {
        display: none;
    }

    table tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        padding: 1rem;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    }

    table td {
        display: block;
        text-align: right;
        border-bottom: 1px solid #eee;
        padding: 0.75rem;
        padding-left: 50%;
        position: relative;
    }

    table td:last-child {
        border-bottom: 0;
    }

    table td::before {
        content: attr(data-label);
        position: absolute;
        left: 0.75rem;
        width: calc(50% - 1.5rem);
        text-align: left;
        font-weight: 600;
        color: #333;
    }

    .action-buttons {
        flex-direction: column;
        justify-content: flex-start;
        gap: 0.5rem;
    }

    .action-buttons .btn {
        width: 100%;
        padding: 0.55rem 0.75rem;
    }
    .action-buttons .btn + .btn {
        margin-top: 0.5rem;
        margin-left: 0;
    }
    
    .child-action-buttons {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .homework-item {
        grid-template-areas:
            "content"
            "details"
            "actions";
        grid-template-columns: 1fr;
        padding: 1rem;
    }

    .item-actions {
        justify-self: stretch;
        width: 100%;
        display: flex;
        flex-direction: row;
        gap: 0.5rem;
    }

    .item-actions .btn {
        flex: 1;
        width: auto;
        padding: 0.6rem 0.75rem;
        font-size: 0.95rem;
    }

    .homework-details {
        gap: 0.75rem;
    }

    .detail-item {
        width: 100%;
        justify-content: space-between;
    }

    .detail-item select {
        min-width: 0;
        width: 12rem;
        max-width: 70%;
    }
}

body.quiz-modal-open,
body.adjust-modal-open {
    overflow: hidden !important;
}

.quiz-entry-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.75rem;
    margin-top: 1rem;
    align-items: center;
}

.quiz-entry-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 0;
    margin: 0;
    padding: 0.55rem 0.9rem;
    font-size: 0.95rem;
    line-height: 1.2;
    white-space: nowrap;
}

.quiz-module-tabs {
    margin-bottom: 1rem;
}

.quiz-module-tabs .unit-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.quiz-mode-modal {
    position: fixed;
    inset: 0;
    z-index: 9998;
}

.quiz-mode-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
}

.quiz-mode-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(32rem, calc(100vw - 2rem));
    margin: 12vh auto 0;
    padding: 1.25rem;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.22);
}

.quiz-mode-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.quiz-mode-modal-head h2 {
    margin: 0;
    font-size: 1.15rem;
}

.quiz-mode-close {
    width: 2.2rem;
    height: 2.2rem;
    padding: 0;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    background: #fff;
    color: #334155;
    font-size: 1.35rem;
    line-height: 1;
}

.quiz-mode-options {
    display: grid;
    gap: 0.85rem;
}

.quiz-mode-option {
    display: grid;
    gap: 0.35rem;
    padding: 1rem;
    border: 1px solid #dbeafe;
    border-radius: 14px;
    background: #f8fbff;
    text-decoration: none;
    color: inherit;
}

.quiz-mode-option:hover {
    border-color: #60a5fa;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.08);
}

.quiz-mode-option strong {
    font-size: 1rem;
}

.quiz-mode-option span {
    color: #64748b;
    font-size: 0.94rem;
}

.quiz-session-card,
.quiz-review-summary,
.quiz-admin-empty {
    padding: 1rem 1.1rem;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: #f8fbff;
    margin-bottom: 1rem;
}

.quiz-session-meta,
.quiz-review-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.quiz-session-item {
    display: grid;
    gap: 0.2rem;
    min-width: 6rem;
}

.quiz-session-label,
.quiz-review-label,
.quiz-review-field-label {
    color: #64748b;
    font-size: 0.9rem;
}

.quiz-session-tip {
    margin-top: 0.85rem;
    color: #475569;
    font-size: 0.95rem;
}

.quiz-status-error {
    color: #b91c1c;
}

.quiz-question-list,
.strength-word-page {
    display: grid;
    gap: 1rem;
}

.quiz-question-card,
.quiz-review-card,
.strength-word-section {
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: #fff;
    padding: 1rem;
}

.quiz-question-head,
.quiz-review-card-head {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
}

.quiz-question-no,
.quiz-review-no {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    background: #2563eb;
    color: #fff;
    font-weight: 700;
    flex-shrink: 0;
}

.quiz-question-content,
.quiz-review-head-main {
    flex: 1;
    min-width: 0;
}

.quiz-question-text {
    margin-top: 0.3rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: #0f172a;
}

.quiz-dictation-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.quiz-dictation-tip,
.strength-word-meta {
    color: #64748b;
    font-size: 0.92rem;
}

.quiz-answer-wrap {
    margin-top: 0.9rem;
}

.quiz-answer-input {
    font-size: 1rem;
}

.quiz-answer-status {
    margin-top: 0.35rem;
    color: #64748b;
    font-size: 0.9rem;
}

.quiz-answer-status.is-error {
    color: #b91c1c;
}

.quiz-submit-bar {
    margin-top: 1rem;
}

.quiz-submit-btn {
    width: 100%;
}

.quiz-admin-table-wrap {
    overflow-x: auto;
}

.quiz-admin-table th,
.quiz-admin-table td {
    vertical-align: middle;
}

.quiz-admin-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.quiz-admin-view-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 6.5rem;
    margin: 0;
    padding-inline: 1rem;
}

.quiz-admin-delete-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 6.5rem;
    margin: 0;
    padding-inline: 1rem;
}

.quiz-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 600;
}

.quiz-status-badge.status-submitted {
    background: #fef3c7;
    color: #92400e;
}

.quiz-status-badge.status-reviewed {
    background: #dcfce7;
    color: #166534;
}

.quiz-status-badge.status-draft {
    background: #e2e8f0;
    color: #334155;
}

.quiz-review-score {
    font-size: 1.3rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.6rem;
}

.quiz-review-meta {
    color: #475569;
}

.quiz-review-progress {
    margin-top: 0.75rem;
    color: #166534;
    font-weight: 600;
}

.quiz-review-progress.is-pending {
    color: #b45309;
}

.quiz-review-answer-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
    margin-top: 0.9rem;
}

.quiz-review-field-value {
    min-height: 2.75rem;
    padding: 0.8rem;
    border: 1px solid #dbeafe;
    border-radius: 12px;
    background: #f8fbff;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.quiz-review-correct {
    color: #166534;
    font-weight: 600;
}

.quiz-review-mark-row {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.9rem;
    flex-wrap: wrap;
}

.quiz-mark-option {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.7rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quiz-mark-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.quiz-mark-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 999px;
    background: #e2e8f0;
    color: #475569;
}

.quiz-mark-icon svg {
    width: 1rem;
    height: 1rem;
    fill: currentColor;
}

.quiz-mark-option-correct input:checked + .quiz-mark-icon {
    background: #dcfce7;
    color: #15803d;
}

.quiz-mark-option-wrong input:checked + .quiz-mark-icon {
    background: #fee2e2;
    color: #dc2626;
}

.quiz-mark-option-correct input:checked ~ span:last-child {
    color: #166534;
}

.quiz-mark-option-wrong input:checked ~ span:last-child {
    color: #b91c1c;
}

.quiz-mark-option:has(input:checked) {
    border-color: #94a3b8;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.quiz-delete-modal-dialog {
    width: min(28rem, calc(100vw - 2rem));
}

.quiz-delete-note {
    color: #475569;
    line-height: 1.6;
}

.quiz-delete-target {
    margin-top: 0.85rem;
    padding: 0.85rem 0.95rem;
    border: 1px solid #dbeafe;
    border-radius: 12px;
    background: #f8fbff;
    color: #0f172a;
    word-break: break-word;
}

.quiz-delete-field {
    margin-top: 0.95rem;
}

.quiz-delete-field label {
    display: block;
    margin-bottom: 0.45rem;
    font-weight: 600;
    color: #334155;
}

.quiz-delete-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.strength-word-title {
    margin-bottom: 0.8rem;
    font-size: 1.05rem;
    font-weight: 700;
}

@media (max-width: 768px) {
    .quiz-mode-modal-dialog {
        margin-top: 10vh;
        padding: 1rem;
    }

    .quiz-review-answer-grid {
        grid-template-columns: 1fr;
    }

    .quiz-review-mark-row,
    .quiz-session-meta,
    .quiz-review-meta,
    .quiz-delete-actions,
    .quiz-admin-actions {
        flex-direction: column;
    }

    .quiz-entry-btn,
    .quiz-admin-view-btn,
    .quiz-admin-delete-btn {
        width: 100%;
    }
}

/* ============ 管理后台 ============ */
.admin-body {
    background: #f5f7fa;
}

.admin-header {
    background: #1f2937;
    color: #fff;
    padding: 0.9rem 0;
    border-bottom: 3px solid var(--primary);
    margin-bottom: 1.5rem;
}

.admin-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: nowrap;
}

.admin-brand {
    color: #fff;
    font-size: 1.15rem;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 1px;
    white-space: nowrap;
}

.admin-brand:hover {
    color: #93c5fd;
}

.admin-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.admin-user-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    background: transparent;
    color: #fff;
    cursor: pointer;
    font-size: 0.92rem;
    width: auto;
}

.admin-user-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

.admin-user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
}

.admin-logout-btn {
    display: inline-block;
    padding: 0.4rem 1rem;
    border-radius: 999px;
    background: #dc3545;
    color: #fff;
    text-decoration: none;
    font-size: 0.92rem;
}

.admin-logout-btn:hover {
    background: #c82333;
}

.admin-main {
    padding-bottom: 2.5rem;
}

.admin-statline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
}

.admin-stat {
    display: inline-flex;
    align-items: baseline;
    gap: 0.4rem;
    background: #fff;
    padding: 0.45rem 1.05rem;
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
    color: #6b7280;
    font-size: 0.92rem;
    white-space: nowrap;
}

.admin-stat b {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
}

.admin-section {
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
}

.admin-section h2 {
    margin: 0 0 1rem;
    font-size: 1.1rem;
    color: #1f2937;
    border-bottom: 1px solid #eef1f5;
    padding-bottom: 0.65rem;
}

.admin-create-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem;
}

.admin-create-form .form-group {
    flex: 1 1 180px;
    margin-bottom: 0;
}

.admin-create-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.admin-create-row h2 {
    margin: 0;
    padding: 0;
    border-bottom: none;
    white-space: nowrap;
}

.admin-create-row .admin-create-form {
    flex: 1 1 400px;
    margin: 0;
}

.admin-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: nowrap;
}

.admin-actions .btn-sm {
    padding: 0.25rem 0.55rem;
    font-size: 0.8rem;
}

.admin-table {
    margin-top: 0.5rem;
}

.admin-table th {
    background: #f8fafc;
    color: #374151;
    font-weight: 600;
    white-space: nowrap;
}

.admin-table tbody tr:hover {
    background: #f8fafc;
}

.admin-table td:last-child {
    white-space: nowrap;
}

.badge {
    display: inline-block;
    padding: 0.22rem 0.65rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-muted {
    background: #e9ecef;
    color: #495057;
}

.admin-login-wrap {
    display: flex;
    justify-content: center;
    padding: 6vh 1rem;
}

.admin-login-box {
    width: min(400px, 100%);
    background: #fff;
    border-radius: 14px;
    padding: 2rem 2.25rem;
    box-shadow: 0 8px 30px rgba(15, 23, 42, 0.1);
}

.admin-login-box h2 {
    margin: 0 0 0.25rem;
    font-size: 1.35rem;
}

.admin-login-sub {
    margin: 0 0 1.5rem;
    color: #6b7280;
    font-size: 0.9rem;
}

.admin-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.admin-modal {
    background: #fff;
    border-radius: 14px;
    padding: 1.5rem 1.75rem;
    width: min(420px, 92vw);
    box-shadow: 0 14px 44px rgba(15, 23, 42, 0.28);
}

.admin-modal h3 {
    margin: 0 0 0.3rem;
}

.admin-modal-tip {
    color: #6b7280;
    font-size: 0.85rem;
    margin: 0 0 1.1rem;
}

.admin-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
    margin-top: 1.25rem;
}

.btn-secondary {
    background-color: #6c757d;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

@media (max-width: 768px) {
    .admin-user-btn {
        padding: 0.35rem 0.6rem;
        font-size: 0.85rem;
    }

    .admin-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}
