* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --primary-green: #4CAF50;
    --bg-light: #F5F8F5;
    --card-bg: #FFFFFF;
    --text-primary: #1A1A1A;
    --text-secondary: #666666;
    --banner-green: #E8F5E9;
    --banner-green-light: #C8E6C9;
    --error-color: #FF3B30;
    --input-border: #E5E5EA;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Noto Sans SC', 'Segoe UI', sans-serif;
    background: var(--bg-light);
    min-height: 100vh;
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

.header {
    padding: 20px 16px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-title {
    font-family: 'Noto Serif SC', serif;
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.banner {
    margin: 12px 16px 24px;
    background: linear-gradient(135deg, var(--banner-green) 0%, var(--banner-green-light) 100%);
    border-radius: 24px;
    padding: 28px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.banner:hover {
    box-shadow: 0 8px 24px rgba(76, 175, 80, 0.15);
}

.text-search-banner {
    background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
}

.text-search-banner:hover {
    box-shadow: 0 8px 24px rgba(33, 150, 243, 0.15) !important;
}

.banner-content {
    z-index: 1;
}

.banner-title {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
}

.banner-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    font-weight: 400;
}

.banner-icon {
    width: 76px;
    height: 76px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    z-index: 1;
}

.text-search-banner {
    display: flex;
    flex-direction: column;
    position: relative;
}

.text-search-banner .banner-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.text-search-banner .banner-content {
    flex: 1;
    text-align: left;
}

.text-search-expand {
    margin-top: 0;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease, margin-top 0.4s ease;
    box-sizing: border-box;
    width: 100%;
}

.text-search-banner.active .text-search-expand {
    max-height: 400px;
    opacity: 1;
    margin-top: 20px;
}

.text-search-input-wrapper {
    width: 100%;
    margin-bottom: 16px;
    box-sizing: border-box;
}

.text-search-input {
    width: 100%;
    min-height: 120px;
    padding: 16px;
    font-size: 16px;
    border: none;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.9);
    resize: vertical;
    font-family: inherit;
    line-height: 1.6;
    outline: none;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
}

.text-search-input::placeholder {
    color: var(--text-secondary);
}

.text-search-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.text-search-btn:active {
    transform: scale(0.97);
}

.text-search-btn:hover {
    box-shadow: 0 4px 16px rgba(33, 150, 243, 0.3);
}

.section {
    padding: 0 16px 24px;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-left: 4px;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.tool-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 20px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tool-card:active {
    transform: scale(0.97);
}

.tool-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.tool-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin-bottom: 14px;
}

.tool-icon.blue {
    background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
}

.tool-icon.purple {
    background: linear-gradient(135deg, #F3E5F5 0%, #E1BEE7 100%);
}

.tool-icon.green {
    background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
}

.tool-icon.orange {
    background: linear-gradient(135deg, #FFF3E0 0%, #FFE0B2 100%);
}

.tool-icon.cyan {
    background: linear-gradient(135deg, #E0F7FA 0%, #B2EBF2 100%);
}

.tool-icon.pink {
    background: linear-gradient(135deg, #FCE4EC 0%, #F8BBD9 100%);
}

.tool-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.tool-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: flex-end;
    z-index: 1000;
    animation: fadeIn 0.2s ease-out;
}

.modal-overlay.show {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--card-bg);
    width: 100%;
    border-radius: 24px 24px 0 0;
    padding: 20px 20px max(20px, env(safe-area-inset-bottom));
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-handle {
    width: 36px;
    height: 4px;
    background: #E0E0E0;
    border-radius: 2px;
    margin: 0 auto 20px;
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 20px;
}

.modal-option {
    background: var(--bg-light);
    border-radius: 16px;
    padding: 18px 20px;
    margin-bottom: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: background 0.2s ease;
}

.modal-option:active {
    background: #E8E8E8;
}

.modal-option-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary-green) 0%, #66BB6A 100%);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.modal-option-text {
    flex: 1;
}

.modal-option-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 2px;
}

.modal-option-desc {
    font-size: 13px;
    color: var(--text-secondary);
}

.camera-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #000000;
    display: none;
    z-index: 2000;
    flex-direction: column;
    animation: fadeIn 0.2s ease-out;
    overflow: hidden;
    touch-action: none;
}

.camera-modal.show {
    display: flex;
}

.camera-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 16px;
    padding-top: max(16px, env(safe-area-inset-top));
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
}

.camera-close {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    font-size: 28px;
}

.camera-view {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.video-element {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.camera-frame {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    max-width: 500px;
    aspect-ratio: 4/3;
    border: 3px solid white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    padding: 30px;
    pointer-events: none;
}

.camera-frame-text {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.6;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.camera-footer {
    padding: 20px 16px max(30px, env(safe-area-inset-bottom));
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
}

.camera-controls {
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 20px;
}

.camera-control-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: white;
}

.camera-control-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
}

.camera-control-label {
    font-size: 13px;
    color: white;
    font-weight: 500;
}

.capture-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.3);
    transition: transform 0.1s ease;
}

.capture-btn:active {
    transform: scale(0.9);
}

.capture-btn-inner {
    width: 66px;
    height: 66px;
    border-radius: 50%;
    border: 4px solid #000000;
}

/* 禁止页面滑动的类 */
.body-no-scroll {
    overflow: hidden;
    touch-action: none;
    -webkit-overflow-scrolling: none;
}

.camera-modal.show ~ .safe-bottom,
.crop-modal.show ~ .safe-bottom {
    z-index: -1;
}

.crop-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #000000;
    display: none;
    z-index: 3000;
    flex-direction: column;
    animation: fadeIn 0.2s ease-out;
    overflow: hidden;
    touch-action: none;
}

.crop-modal.show {
    display: flex;
}

.crop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    padding-top: max(16px, env(safe-area-inset-top));
    background: rgba(0,0,0,0.8);
}

.crop-btn {
    color: white;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 16px;
}

.crop-btn.confirm {
    color: #007AFF;
    font-weight: 600;
}

.crop-title {
    color: white;
    font-size: 16px;
    font-weight: 600;
}

.crop-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.crop-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.crop-box {
    position: absolute;
    border: 2px solid white;
    background: rgba(0,0,0,0.3);
    cursor: move;
}

.crop-handle {
    position: absolute;
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
}

.crop-handle.tl { top: -12px; left: -12px; }
.crop-handle.tr { top: -12px; right: -12px; }
.crop-handle.bl { bottom: -12px; left: -12px; }
.crop-handle.br { bottom: -12px; right: -12px; }

.crop-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.crop-overlay::before,
.crop-overlay::after,
.crop-overlay .crop-side-left,
.crop-overlay .crop-side-right {
    content: '';
    position: absolute;
    background: rgba(0,0,0,0.6);
}

.crop-overlay::before {
    top: 0;
    left: 0;
    right: 0;
    height: var(--crop-top, 0);
}

.crop-overlay::after {
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--crop-bottom, 0);
}

.crop-overlay .crop-side-left {
    top: var(--crop-top, 0);
    bottom: var(--crop-bottom, 0);
    left: 0;
    width: var(--crop-left, 0);
}

.crop-overlay .crop-side-right {
    top: var(--crop-top, 0);
    bottom: var(--crop-bottom, 0);
    right: 0;
    width: var(--crop-right, 0);
}

.crop-instructions {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 14px;
    text-align: center;
    background: rgba(0,0,0,0.6);
    padding: 8px 16px;
    border-radius: 8px;
}

.canvas-element {
    display: none;
}

/* Tabbar 和页面切换 */
.page-content {
    display: none;
    padding-bottom: 80px;
}

.page-content.active {
    display: block;
}

.tabbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    padding: 6px 16px;
    padding-bottom: max(6px, env(safe-area-inset-bottom));
    border-top: 0.5px solid rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.tabbar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 6px 0;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.25, 0.1, 0.25, 1);
    position: relative;
}

.tabbar-icon {
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.tabbar-svg {
    width: 25px;
    height: 25px;
    transition: all 0.25s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.tabbar-svg-fill-primary {
    fill: #C7C7CC;
    transition: fill 0.25s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.tabbar-svg-fill-secondary {
    fill: #8E8E93;
    transition: fill 0.25s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.tabbar-label {
    font-size: 10px;
    color: #8E8E93;
    font-weight: 500;
    transition: all 0.25s cubic-bezier(0.25, 0.1, 0.25, 1);
    letter-spacing: -0.2px;
}

.tabbar-item.active .tabbar-svg-fill-primary {
    fill: #B0EACD;
}

.tabbar-item.active .tabbar-svg-fill-secondary {
    fill: var(--primary-green);
}

.tabbar-item.active .tabbar-label {
    color: var(--primary-green);
    font-weight: 600;
}

.tabbar-item:active {
    transform: scale(0.95);
}

.safe-bottom {
    height: env(safe-area-inset-bottom);
}

/* 我的页面样式 */
.profile-card {
    margin: 16px;
    background: var(--card-bg);
    border-radius: 20px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.profile-avatar {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--banner-green) 0%, var(--banner-green-light) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-avatar-icon {
    font-size: 32px;
}

.profile-info {
    flex: 1;
}

.profile-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.profile-desc {
    font-size: 14px;
    color: var(--text-secondary);
}

.menu-list {
    background: var(--card-bg);
    border-radius: 20px;
    overflow: hidden;
}

.menu-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    cursor: pointer;
    transition: background 0.2s ease;
    border-bottom: 1px solid var(--bg-light);
}

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

.menu-item:active {
    background: var(--bg-light);
}

.menu-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.menu-item-icon {
    font-size: 22px;
}

.menu-item-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
}

.menu-item-arrow {
    font-size: 20px;
    color: var(--text-secondary);
    opacity: 0.5;
}

/* 登录页面样式 */
.login-page {
    min-height: 100vh;
    background: linear-gradient(180deg, var(--banner-green-light) 0%, var(--card-bg) 60%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 380px;
}

.login-header {
    text-align: center;
    margin-bottom: 48px;
}

.logo-icon {
    font-size: 72px;
    margin-bottom: 16px;
}

.login-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.login-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    font-weight: 400;
}

.login-form {
    background: var(--card-bg);
    border-radius: 24px;
    padding: 28px 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border: 2px solid var(--input-border);
    border-radius: 14px;
    background: var(--card-bg);
    color: var(--text-primary);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
    -webkit-appearance: none;
}

.form-input:focus {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.1);
}

.form-input::placeholder {
    color: var(--text-secondary);
}

.error-message {
    color: var(--error-color);
    font-size: 14px;
    margin-bottom: 20px;
    min-height: 20px;
    text-align: center;
}

.login-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary-green) 0%, #66BB6A 100%);
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.login-btn:active {
    transform: scale(0.97);
}

.login-btn:hover {
    box-shadow: 0 4px 16px rgba(76, 175, 80, 0.3);
}

.logout-item {
    color: var(--error-color) !important;
}

.logout-item .menu-item-title {
    color: var(--error-color);
}

/* 空状态样式 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.empty-text {
    font-size: 16px;
    color: var(--text-secondary);
}

/* 解题页面样式 */
.header-back {
    padding: 10px 20px;
    font-size: 15px;
    font-weight: 600;
    color: var(--primary-green);
    cursor: pointer;
    border-radius: 12px;
    background: rgba(76, 175, 80, 0.08);
    transition: all 0.2s ease;
    border: 1px solid rgba(76, 175, 80, 0.15);
}

.header-back:hover {
    background: rgba(76, 175, 80, 0.15);
    transform: scale(0.98);
}

.header-back:active {
    background: rgba(76, 175, 80, 0.2);
}

.question-display {
    margin: 16px;
    background: var(--card-bg);
    border-radius: 20px;
    padding: 20px;
}

.question-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-green);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.question-label::before {
    content: '';
    width: 4px;
    height: 16px;
    background: var(--primary-green);
    border-radius: 2px;
}

.question-text {
    font-family: 'Noto Serif SC', serif;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.6;
    color: var(--text-primary);
}

.part-tabs {
    display: flex;
    gap: 8px;
    padding: 0 16px 12px;
    overflow-x: auto;
}

.part-tab {
    flex-shrink: 0;
    padding: 8px 16px;
    background: var(--bg-light);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.part-tab.active {
    background: var(--primary-green);
    color: white;
}

.solve-progress {
    padding: 0 16px 16px;
}

.progress-nodes {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.progress-node {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.progress-node.locked {
    background: #E0E0E0;
    color: #999;
}

.progress-node.loading {
    background: #E0E0E0;
    color: #999;
    position: relative;
    overflow: hidden;
}

.progress-node.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(76, 175, 80, 0.3), transparent);
    animation: loadingShine 1.5s infinite;
}

@keyframes loadingShine {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

.progress-node.current {
    background: var(--primary-green);
    color: white;
    position: relative;
    animation: currentPulse 2s infinite;
}

.progress-node.current::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border: 2px solid rgba(76, 175, 80, 0.3);
    border-radius: 50%;
}

@keyframes currentPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.progress-node.simplified {
    position: relative;
}

.progress-node.simplified::after {
    content: '⭐';
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 12px;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 解题等待页面样式 */
.solving-state {
    padding: 20px 16px;
}

.solving-header {
    text-align: center;
    margin-bottom: 32px;
}

.solving-icon-container {
    margin-bottom: 20px;
}

.solving-icon {
    font-size: 64px;
}

.solving-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.solving-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
}

.solving-progress {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 16px;
}

.solving-progress-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
}

.solving-progress-item + .solving-progress-item {
    border-top: 1px solid var(--bg-light);
}

.solving-progress-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.solving-progress-icon.loading {
    background: var(--banner-green);
    animation: rotate 1s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.solving-progress-icon.done {
    background: var(--primary-green);
    color: white;
}

.solving-progress-content {
    flex: 1;
}

.solving-progress-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.solving-progress-text {
    font-size: 13px;
    color: var(--text-secondary);
}



.progress-node.completed {
    background: #4CAF50;
    color: white;
    animation: completedPop 0.3s ease-out;
}

@keyframes completedPop {
    0% {
        transform: scale(0.9);
        opacity: 0.7;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.current-node {
    margin: 0 16px 16px;
}

.node-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 20px;
}

.node-question {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
    line-height: 1.5;
}

/* 选择题样式 */
.choice-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.choice-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    min-height: 56px;
    background: var(--bg-light);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.choice-option:active {
    transform: scale(0.98);
}

.choice-option.selected {
    background: var(--primary-green);
    color: white;
}

.choice-option.correct {
    background: #4CAF50;
    color: white;
}

.choice-option.wrong {
    background: var(--error-color);
    color: white;
}

.choice-letter {
    width: 32px;
    height: 32px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
}

.choice-option.selected .choice-letter,
.choice-option.correct .choice-letter,
.choice-option.wrong .choice-letter {
    background: rgba(255,255,255,0.3);
}

.choice-text {
    font-family: 'Noto Serif SC', serif;
    flex: 1;
    font-size: 15px;
}

/* 填空题样式 */
.fill-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border: 2px solid var(--input-border);
    border-radius: 14px;
    background: var(--card-bg);
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.fill-input:focus {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.1);
}

.fill-submit {
    width: 100%;
    margin-top: 16px;
    padding: 16px;
    min-height: 52px;
    background: linear-gradient(135deg, var(--primary-green) 0%, #66BB6A 100%);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.2s ease;
}

.fill-submit:active {
    transform: scale(0.98);
}

/* 判断题样式 */
.truefalse-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.truefalse-option {
    padding: 20px;
    min-height: 64px;
    background: var(--bg-light);
    border-radius: 14px;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.truefalse-option:active {
    transform: scale(0.98);
}

.truefalse-option.selected {
    background: var(--primary-green);
    color: white;
}

.truefalse-option.correct {
    background: #4CAF50;
    color: white;
}

.truefalse-option.wrong {
    background: var(--error-color);
    color: white;
}

/* 反馈区域 */
.node-feedback {
    margin-top: 20px;
    padding: 16px;
    border-radius: 14px;
    display: none;
}

.node-feedback.show {
    display: block;
}

.node-feedback.correct {
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.2);
}

.node-feedback.wrong {
    background: rgba(255, 59, 48, 0.1);
    border: 1px solid rgba(255, 59, 48, 0.2);
}

.feedback-explanation {
    font-family: 'Noto Serif SC', serif;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 12px;
}

.feedback-hint {
    background: rgba(255,255,255,0.5);
    padding: 12px;
    border-radius: 10px;
    font-family: 'Noto Serif SC', serif;
    font-size: 14px;
}

.feedback-hint-title {
    font-family: 'Noto Serif SC', serif;
    font-weight: 600;
    margin-bottom: 6px;
}

.feedback-next-btn {
    width: 100%;
    margin-top: 16px;
    padding: 16px;
    min-height: 52px;
    background: linear-gradient(135deg, var(--primary-green) 0%, #66BB6A 100%);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.2s ease;
}

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

/* 简化题目样式 */
.simplified-node {
    margin-top: 16px;
    padding: 16px;
    background: #FFF3E0;
    border-radius: 14px;
    border: 1px solid #FFE0B2;
}

.simplified-title {
    font-size: 14px;
    font-weight: 600;
    color: #FF8F00;
    margin-bottom: 12px;
}

/* 最终答案 */
.final-answer {
    margin: 0 16px 16px;
    background: linear-gradient(135deg, var(--banner-green) 0%, var(--banner-green-light) 100%);
    border-radius: 20px;
    padding: 24px;
}

.final-answer-title {
    font-family: 'Noto Serif SC', serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.final-answer-text {
    font-family: 'Noto Serif SC', serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.final-answer-explanation {
    font-family: 'Noto Serif SC', serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* 加载状态 */
.solving-state {
    padding: 60px 20px;
    text-align: center;
}

.solving-icon {
    font-size: 72px;
    margin-bottom: 16px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.solving-text {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.6;
    white-space: pre-wrap;
    text-align: left;
    max-height: 300px;
    overflow-y: auto;
    background: var(--card-bg);
    padding: 16px;
    border-radius: 12px;
    margin-top: 16px;
}

@media (min-width: 768px) {
    body {
        max-width: 430px;
        margin: 0 auto;
    }
    .tabbar {
        left: 50%;
        transform: translateX(-50%);
        max-width: 430px;
        width: 100%;
    }
}