/* 移动端英语听写助手样式 */

/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #333;
    background-color: #f5f5f5;
    overflow: hidden;
    height: 100vh;
    /* 禁止双击缩放 */
    touch-action: manipulation;
}

html {
    font-size: 16px;
    height: 100vh;
    overflow: hidden;
}

#app {
    height: 100vh;
    display: flex;
    flex-direction: column;
}
em,i,strong{
    font-style: normal;
}
.flex-row {
  display: flex;
}

.flex-row-vcenter {
  display: flex;
  align-items: center;
}

/* 垂直居中对齐 */
.flex-row-rcenter {
  display: flex;
  justify-content: center;
}

/* 水平居中对齐 */
.flex-row-c {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 水平垂直居中对齐 */
.flex-row-bw {
  display: flex;
  justify-content: space-between;
}

.flex-row-ad {
  display: flex;
  justify-content: space-around;
}

.flex-row-end {
  display: flex;
  justify-content: flex-end;
}

.flex-wrap {
  flex-wrap: wrap;
}

/* 换行，默认nowrap（不换行）*/

.flex-col {
  display: flex;
  flex-direction: column;
}

.flex-col-vcenter {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* 纵向布局垂直居中 */
.flex-col-rcenter {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* 纵向布局水平居中对齐 */
.flex-col-c {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.flex-col-bw {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.flex1-row {
  flex: 1;
  width: 1px;
}

.flex1-col {
  flex: 1;
  height: 1px;
}
.flex-shrink {
  flex-shrink: 0;
}
.ml-base{
    margin-left: 16px;
}
.mt-base{
    margin-top: 16px;
}
.text-gray{
    color:#666;
}

/* 页面切换 */
.page {
    display: none;
    flex: 1;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.page.active {
    display: flex;
}

/* 头部 */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.btn-back {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-back:active {
    background: rgba(255, 255, 255, 0.3);
}

/* 主内容区域 */
.main-content {
    flex: 1;
    min-height: 0;
    padding: 1rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* 播放页面主内容区域特殊样式 */
.play-page-content {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* 按钮基础样式 */
.btn {
    border: none;
    border-radius: 12px;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    touch-action: manipulation;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-secondary {
    background: #fff;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-danger {
    background: #ff6b6b;
    color: white;
}

.btn-large {
    width: 100%;
    max-width: 280px;
    height: 120px;
    font-size: 1.5rem;
    margin: 2rem auto;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-medium {
    width: 100%;
    max-width: 200px;
    height: 60px;
    font-size: 1.1rem;
    margin: 0.5rem auto;
}

.icon {
    font-size: 1.2rem;
}

/* 单元列表 */
.unit-section {
    margin-bottom: 2rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 1rem;
    flex-wrap: wrap;
    min-height: 32px;
}

.section-header h2 {
    font-size: 1.1rem;
    margin: 0;
    color: #333;
    flex: 1;
    min-width: 0;
    line-height: 32px;
    height: 32px;
}

.section-header .btn {
    margin: 0;
    height: 40px;
}

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
    white-space: nowrap;
    height: 32px;
    line-height: 1.2;
}

.unit-section h2,
.settings-section h2 {
    font-size: 1.25rem;
    margin-bottom: 0;
    color: #333;
}

.unit-list {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.unit-item {
    background: white;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
    position: relative;
}

.unit-item > div {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.unit-item:active {
    transform: scale(0.98);
}

.unit-item:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.unit-item.selected {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-color: #667eea;
}

.unit-item.selected::after {
    content: '✓';
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #667eea;
    font-size: 1.5rem;
    font-weight: bold;
}

/* 选择信息 */
.selected-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    border: 2px solid #667eea;
}

.selected-info #selected-count {
    font-weight: 500;
    color: #667eea;
}

.selected-info .btn {
    margin: 0;
    min-width: 120px;
}

.unit-name {
    font-weight: 500;
    font-size: 1.1rem;
}

.unit-count {
    color: #999;
    font-size: 0.9rem;
}

/* 教材分隔符 */
.book-divider {
    display: flex;
    align-items: center;
    color: #333;
    font-size: 0.95rem;
}

.book-divider::before,
.book-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, #ddd, transparent);
}

.book-divider::before {
    margin-right: 1rem;
}

.book-divider::after {
    margin-left: 1rem;
}

.book-divider-first {
    margin-top: 0;
}

/* 底部导航统计 */
.nav-stats {
    display: flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    margin-left: auto;
}

.nav-stats .stats-summary {
    display: flex;
    gap: 0.75rem;
}

.nav-stats .stat-item {
    text-align: center;
    padding: 0.25rem 0.5rem;
    background: transparent;
    border-radius: 8px;
}

.nav-stats .stat-value {
    font-size: 1rem;
    font-weight: 600;
    color: #667eea;
    line-height: 1.2;
}

.nav-stats .stat-label {
    font-size: 0.7rem;
    color: #999;
    line-height: 1.2;
}

/* 底部导航 */
.bottom-nav {
    background: white;
    border-top: 1px solid #eee;
    padding: 0.5rem;
    display: flex;
    justify-content: flex-start;
    gap: 0.5rem;
    flex-shrink: 0;
    align-items: center;
}

.nav-btn {
    background: transparent;
    border: none;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    color: #666;
    cursor: pointer;
    transition: color 0.2s;
    white-space: nowrap;
}

.nav-btn:active {
    color: #667eea;
}

.play-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-shrink: 0;
}

.play-info .unit-name {
    font-size: 1.25rem;
    margin-bottom: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.speed-control {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

.speed-label {
    font-size: 0.85rem;
    color: #666;
    white-space: nowrap;
}

.speed-select {
    padding: 0.4rem 0.75rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 0.9rem;
    background: white;
    cursor: pointer;
    color: #333;
}

.speed-select:focus {
    outline: none;
    border-color: #667eea;
}

.play-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-shrink: 0;
}

.btn-control {
    height: 76px;
    min-width: 100px;
    padding: 0 1.1rem;
    border-radius: 20px;
    background: #fff;
    border: 1px solid #e0e0e0;
    font-size: 14px;
    font-weight: 500;
    color: #555;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.18s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.btn-control .icon {
    font-size: 18px;
    line-height: 1;
    color: #667eea;
    opacity: 0.9;
}

.btn-control .text {
    line-height: 1;
}

.btn-control:hover {
    background: #fff;
    border-color: #667eea;
    color: #667eea;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.15);
    transform: translateY(-1px);
}

.btn-control:active {
    transform: translateY(0) scale(0.97);
}

.btn-control.disabled,
.btn-control:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none; /* 阻止点击事件 */
    background: #f0f0f0 !important;
    color: #999 !important;
}

.btn-control.disabled .icon,
.btn-control:disabled .icon {
    color: #999 !important;
}

.btn-control-middle {
    flex: 1;
    min-width: 0;
    height: 76px;
    padding: 0 1.5rem;
    border-radius: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-weight: 600;
    font-size: 15px;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.35);
    transition: all 0.2s ease;
}

.btn-control-middle .icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.22);
    border-radius: 50%;
    font-size: 14px;
    line-height: 1;
    color: #fff;
    opacity: 1;
}

.btn-control-middle .text {
    line-height: 1;
}

.btn-control-middle:hover {
    background: linear-gradient(135deg, #5a6fd6 0%, #674090 100%);
    color: #fff;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.45);
    transform: translateY(-1px);
}

.btn-control-middle:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

.btn-control-middle.disabled,
.btn-control-middle:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    background: linear-gradient(135deg, #ccc 0%, #aaa 100%) !important;
    color: #eee !important;
    box-shadow: none !important;
}

/* 单词列表 */
.word-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    background: white;
    border-radius: 16px;
    padding: 1rem;
    margin: 0.5rem 0;
    border: 2px solid #e0e0e0;
    -webkit-overflow-scrolling: touch;
}

.word-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    margin-bottom: 0.5rem;
    background: #f8f9fa;
    border-radius: 12px;
    cursor: default;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.word-item:last-child {
    margin-bottom: 0;
}

.word-item:hover {
    background: #fff;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
}

.word-item.current {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    border-color: #667eea;
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.word-item.completed {
    opacity: 0.6;
    background: #f0f0f0;
}

.word-item.completed::after {
    content: '✓';
    color: #28a745;
    font-weight: bold;
    font-size: 1.2rem;
}

.word-chinese {
    font-weight: 500;
    color: #333;
    font-size: 1rem;
}

.word-item.current .word-chinese {
    color: #667eea;
    font-weight: 600;
}

.word-status {
    font-size: 0.85rem;
    color: #999;
}

.word-item.current .word-status::after {
    content: '当前';
    color: #667eea;
    font-weight: 600;
}

/* 批改单词列表 */
.review-item {
    cursor: default;
}

.review-word-info {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    flex: 1;
    min-width: 0;
}

.word-index {
    color: #999;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.word-english {
    font-weight: 600;
    color: #333;
    font-size: 1.05rem;
    word-break: break-word;
}

.review-item .word-chinese {
    color: #666;
    font-size: 0.85rem;
    margin-right: 0.5rem;
    text-align: right;
    flex-shrink: 0;
}

.wrong-btn {
    padding: 0.45rem 0.9rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    color: #999;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.wrong-btn:active {
    transform: scale(0.95);
}

.wrong-btn.active {
    background: #ff6b6b;
    border-color: #ff6b6b;
    color: #fff;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.35);
}

.review-item.wrong {
    background: rgba(255, 107, 107, 0.08);
    border-color: rgba(255, 107, 107, 0.5);
}

.review-item.wrong .word-english {
    color: #ff6b6b;
}

/* 批改结果 */
.review-score {
    font-size: 2.2rem;
    font-weight: bold;
    color: #667eea;
    margin: 0.5rem 0;
}

.all-correct {
    color: #28a745;
}

.wrong-words-list {
    text-align: left;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    margin-top: 0.75rem;
}

.wrong-words-title {
    font-size: 0.9rem;
    color: #666;
    margin: 0 0 0.25rem;
}

.wrong-word-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.wrong-word-row:last-child {
    border-bottom: none;
}

.wrong-word-english {
    font-weight: 600;
    color: #ff6b6b;
}

.wrong-word-chinese {
    color: #666;
    font-size: 0.85rem;
}

/* 首页错题本提示条 */
.wrong-book-hint {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.08) 0%, rgba(255, 159, 67, 0.08) 100%);
    border: 1.5px solid rgba(255, 107, 107, 0.35);
    border-radius: 12px;
    padding: 0.7rem 1rem;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wrong-book-hint .hint-text {
    font-size: 0.9rem;
    color: #c0392b;
    line-height: 1.4;
}

.wrong-book-hint .hint-text b {
    font-size: 1.05rem;
}

.wrong-book-hint .hint-link {
    background: none;
    border: none;
    color: #667eea;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
}

.wrong-book-hint:active {
    transform: scale(0.99);
}

/* 错题本页面 */
.wrong-book-tip {
    font-size: 0.85rem;
    color: #999;
    margin: 0 0 1rem;
    line-height: 1.5;
}

.wrong-book-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.wrong-book-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: #f8f9fa;
    border: 2px solid transparent;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.wrong-book-item:hover {
    background: #fff;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.wb-info {
    flex: 1;
    min-width: 0;
}

.wb-english {
    font-weight: 600;
    font-size: 1.05rem;
    color: #333;
    word-break: break-word;
}

.wb-chinese {
    font-size: 0.8rem;
    color: #999;
    margin-top: 0.15rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wb-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.2rem;
    flex-shrink: 0;
}

.wb-count {
    font-size: 0.8rem;
    color: #ff6b6b;
    font-weight: 600;
}

.wb-streak {
    font-size: 0.75rem;
    color: #999;
}

.wb-remove-btn {
    padding: 0.4rem 0.75rem;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    color: #999;
    font-size: 0.85rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.wb-remove-btn:active {
    transform: scale(0.95);
}

/* 批改结果中的错题本摘要 */
.wrong-book-summary {
    color: #667eea;
    font-size: 0.9rem;
    margin-top: 0.75rem;
}

/* 完成和批改控制按钮 */
.finish-controls,
.review-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    padding: 1rem 1.25rem calc(1rem + env(safe-area-inset-bottom, 0));
    margin: 0.75rem -1rem -1rem;
    background: #fafafc;
    border-top: 1px solid #ebebef;
    flex-shrink: 0;
}

.finish-controls .btn,
.review-controls .btn {
    min-width: 160px;
    height: 48px;
    padding: 0 1.75rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    font-weight: 600;
    font-size: 15px;
    box-shadow: 0 4px 14px rgba(102, 126, 234, 0.3);
    transition: all 0.2s ease;
}

.finish-controls .btn:hover,
.review-controls .btn:hover {
    background: linear-gradient(135deg, #5a6fd6 0%, #674090 100%);
    box-shadow: 0 6px 18px rgba(102, 126, 234, 0.4);
    transform: translateY(-1px);
}

.finish-controls .btn:active,
.review-controls .btn:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.28);
}

.finish-controls .btn.btn-secondary,
.review-controls .btn.btn-secondary {
    background: #fff;
    color: #667eea;
    border: 2px solid #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.finish-controls .btn.btn-secondary:hover,
.review-controls .btn.btn-secondary:hover {
    background: linear-gradient(135deg, rgba(102,126,234,0.05), rgba(118,75,162,0.05));
}

.review-controls {
    display: none;
}

/* 导航控制 */
.nav-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 2rem 0;
}

/* 显示切换 */
.display-toggle {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 1rem 0;
}


/* 复选框标签 */
.toggle {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    padding: 10px 0;
}

.toggle input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: #667eea;
    flex-shrink: 0;
    margin: 0;
}

.toggle span {
    line-height: 20px;
    font-size: 1rem;
}

/* 设置页面 */
.settings-section {
    background: white;
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.settings-section h2 {
    margin-bottom: 1.25rem;
}

.setting-item {
    margin-bottom: 1.5rem;
}

.range-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.range-wrapper input[type="range"] {
    flex: 1;
    height: 8px;
    border-radius: 4px;
    background: #ddd;
    outline: none;
    accent-color: #667eea;
}

.range-value {
    min-width: 50px;
    text-align: right;
    font-weight: 600;
    color: #667eea;
}

/* 单选按钮组 */
.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.radio-item {
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
}

.radio-item input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.radio-item span {
    display: inline-block;
    border: 2px solid #ddd;
    border-radius: 999px;
    font-size: 1rem;
    width: 5rem;
    height: 44px;
    line-height:40px;
    text-align: center;
    color: #666;
    transition: all 0.2s ease;
    user-select: none;
}

.radio-item input[type="radio"]:checked + span {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.12) 0%, rgba(118, 75, 162, 0.12) 100%);
    color: #667eea;
    font-weight: 600;
}

.radio-item input[type="radio"]:focus-visible + span {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* 下拉选择框 */
.select-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
}

.select-input:focus {
    outline: none;
    border-color: #667eea;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    max-width: 400px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-content h2 {
    margin-bottom: 1rem;
}

/* 文件输入 */
.file-input-wrapper {
    margin: 1.5rem 0;
}

.file-input-wrapper input[type="file"] {
    display: none;
}

.file-label {
    display: inline-block;
    background: #f8f9fa;
    border: 2px dashed #ddd;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s;
}

.file-label:active {
    background: #e9ecef;
}

.file-label .icon {
    display: block;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.file-name {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #666;
    word-break: break-all;
}

/* 预览区域 */
.preview-area {
    margin: 1rem 0;
    border-top: 1px solid #eee;
    padding-top: 1rem;
}

.preview-area h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.preview-content {
    max-height: 200px;
    overflow-y: auto;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    font-size: 0.9rem;
}

.preview-item {
    padding: 0.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.preview-item:last-child {
    border-bottom: none;
}

/* 模态框操作按钮 */
.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.modal-actions .btn {
    flex: 1;
}

/* 完成摘要 */
.complete-summary {
    text-align: center;
    padding: 1rem 0;
}

.complete-summary p {
    margin: 0.5rem 0;
    font-size: 1.1rem;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #999;
}

.empty-state .icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.empty-state p {
    font-size: 1rem;
}

/* 首页最近听写记录区域 */
.recent-history-section {
    margin-bottom: 1.5rem;
}

.view-all-link {
    background: none;
    border: none;
    color: #667eea;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    padding: 0.25rem 0.5rem;
}

.view-all-link:active {
    opacity: 0.7;
}

.recent-history {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    border: 2px solid #e8eaf6;
}

.empty-history {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem 0.5rem;
    color: #999;
}

.empty-history-icon {
    font-size: 2rem;
}

.empty-history-text {
    font-size: 0.9rem;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: #f8f9fa;
    border-radius: 10px;
    padding: 10px 1rem;
    border-left: 4px solid #667eea;
    transition: all 0.2s ease;
    font-size: 1.1rem;
    line-height: 2rem;
}

.history-item:hover {
    background: #fff;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.history-date {
    /* font-size: 1rem; */
    color: #333;
    flex-shrink: 0;
}

.history-unit {
    font-weight: 400;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
    /* font-size: 1.05rem; */
}

.history-stat {
    color: #666;
    flex-shrink: 0;
    width: 3rem;
    text-align: right;
    /* font-size: 1.05rem; */
}

.history-stat b {
    color: #333;
}

.history-correct-num {
    /* color: #28a745; */
}

.history-correct {
    /* color: #28a745; */
}

.history-wrong {
    color: #ff6b6b;
    font-weight: 500;
    flex-shrink: 0;
    width: 2.5rem;
    text-align: right;
    font-size: 1.05rem;
}

.history-badge {
    flex-shrink: 0;
    min-width: 3rem;
    padding: 0 0.8rem;
    border-radius: 8px;
    text-align: center;
    font-size: 1rem;
    margin-left: 1.2rem;
}

.history-badge.badge-zero {
    background: #e8f5e9;
    color: #28a745;
    font-weight: 600;
}

.history-badge.badge-light {
    background: #4caf50;
    color: #fff;
    box-shadow: 0 1px 4px rgba(76, 175, 80, 0.35);
}

.history-badge.badge-mid {
    background: #ff9800;
    color: #fff;
    box-shadow: 0 1px 4px rgba(255, 152, 0, 0.35);
}

.history-badge.badge-deep {
    background: #ff5722;
    color: #fff;
    box-shadow: 0 1px 4px rgba(255, 87, 34, 0.35);
}

.history-score {
    font-weight: 600;
    font-size: 1.05rem;
    flex-shrink: 0;
    width: 3.8rem;
    text-align: right;
}

.history-right {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.history-score.score-high {
    color: #28a745;
}

.history-score.score-mid {
    color: #ff9f43;
}

.history-score.score-low {
    color: #ff6b6b;
}

/* 历史记录页面列表 */
.history-full-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.history-day-group {
    margin-bottom: 1rem;
}

.history-day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.25rem;
    border-bottom: 1px solid #eee;
    margin-bottom: 0.5rem;
}

.history-day-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #667eea;
}

.history-day-summary {
    font-size: 0.75rem;
    color: #999;
}

.history-day-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* 响应式设计 */
@media (min-width: 768px) {
    .main-content {
        max-width: 800px;
        margin: 0 auto;
        width: 100%;
    }

    .modal-content-large {
        max-width: 700px;
    }
}

@media (min-width: 1024px) {
    .main-content {
        max-width: 1000px;
    }
}

/* 书本选择样式 */
.modal-content-large {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
}

.book-list {
    display: grid;
    gap: 1rem;
    margin: 1.5rem 0;
    max-height: 400px;
    overflow-y: auto;
}

.book-item {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.book-item:active {
    transform: scale(0.98);
}

.book-item:hover:not(.selected) {
    border-color: #667eea;
    background: #fff;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

/* 未选中状态：默认样式 */
.book-item:not(.selected) {
    /* 使用默认样式 */
}

/* 已添加但未选中的：绿色样式 */
.book-item[data-is-added="true"]:not(.selected) {
    /* background: #e8f5e9;
    border-color: #28a745;
    opacity: 0.7; */
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-color: #667eea;
    opacity: 1;
}

.book-item[data-is-added="true"]:not(.selected):hover {
    opacity: 1;
    cursor: pointer;
}

.book-item[data-is-added="true"]:not(.selected) .book-status::after {
    /* content: '✓ 已添加'; */
    content: '✓';
}

/* 选中状态：统一样式 */
.book-item.selected {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-color: #667eea;
    opacity: 1;
}
.book-item.added.selected{
    border: 2px solid transparent;
    background: #f8f9fa;
}
.book-item:not([data-is-added="true"]).selected .book-status::after {
    /* content: '✓ 已选择'; */
    content: '✓';
}

.book-item[data-is-added="true"].selected .book-status::after {
    /* content: ' 已取消选择'; */
}

.book-info {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.book-name {
    font-weight: 600;
    color: #333;
}

.book-units {
    font-size: 0.85rem;
    color: #666;
}

.book-units-count {
    color: #667eea;
    font-weight: 500;
}

.book-status {
    font-size: 0.85rem;
    font-weight: 600;
    color: #667eea;
}

.book-item.added .book-status {
    /* color: #28a745; */
    color: #667eea;
}

/* 横屏模式优化 */
@media (orientation: landscape) and (max-height: 600px) {
    .header {
        padding: 0.5rem 1rem;
    }

    .header h1 {
        font-size: 1.2rem;
    }

    .main-content {
        padding: 0.75rem;
    }

    .btn-large {
        height: 80px;
        font-size: 1.2rem;
        margin: 1rem auto;
    }
}

/* 动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.unit-item {
    animation: fadeIn 0.3s ease-out;
}

/* 无障碍 */
.btn:focus-visible,
input:focus-visible,
.toggle:focus-within {
    outline-offset: 2px;
}

/* 打印样式 */
@media print {
    .header,
    .bottom-nav,
    .btn {
        display: none;
    }
}
