* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 10px;
}

.container {
    max-width: 600px;
    margin: 0 auto;
}

/* 头部 */
.header {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.header h1 {
    font-size: 24px;
    color: #333;
    margin-bottom: 10px;
}

.user-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #666;
}

.credits {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: bold;
}

/* 科目选择 */
.subject-section {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.subject-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.subject-select {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    background: white;
    color: #333;
}

.btn-recharge {
    padding: 12px 20px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
}

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

.subject-search {
    margin-top: 10px;
}

/* 搜索框 */
.search-section {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.search-box {
    display: flex;
    gap: 10px;
}

.search-input,
.search-input-main {
    flex: 1;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
}

.search-input-main {
    font-size: 18px;
    border: 3px solid #667eea;
}

.search-input-main:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
}

.btn-search {
    padding: 15px 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
    white-space: nowrap;
}

.btn-search:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn-search:active:not(:disabled) {
    transform: scale(0.95);
}

.search-tip {
    text-align: center;
    color: #999;
    font-size: 13px;
    margin-top: 10px;
}

/* 搜索结果 */
.results-section {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.results-title {
    font-size: 18px;
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.result-item {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    border-left: 4px solid #667eea;
}

.result-question {
    font-size: 16px;
    color: #333;
    margin-bottom: 10px;
    font-weight: 500;
}

.result-answer {
    font-size: 15px;
    color: #666;
    line-height: 1.6;
    background: white;
    padding: 10px;
    border-radius: 5px;
}

.result-answer mark {
    background: #ffeb3b;
    padding: 2px 5px;
    border-radius: 3px;
    font-weight: bold;
    color: #333;
}

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

.empty-icon {
    font-size: 80px;
    margin-bottom: 20px;
}

.empty-state p {
    font-size: 16px;
    opacity: 0.9;
}

/* 弹窗 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background-color: white;
    width: 90%;
    max-width: 400px;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.modal-header h3 {
    font-size: 20px;
    color: #333;
}

.close {
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

.modal-body {
    padding: 20px;
}

.recharge-tip {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
    text-align: center;
}

.voucher-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    margin-bottom: 15px;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}

.voucher-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn-confirm {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
}

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

/* 响应式 */
@media (max-width: 480px) {
    .header h1 {
        font-size: 20px;
    }

    .search-box {
        flex-direction: column;
    }

    .btn-search {
        width: 100%;
    }

    .subject-selector {
        flex-direction: column;
    }

    .btn-recharge {
        width: 100%;
    }
}
/* 登录页面样式 */
.login-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.login-box {
    background: white;
    border-radius: 20px;
    padding: 40px 30px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.login-title {
    font-size: 28px;
    color: #333;
    text-align: center;
    margin-bottom: 30px;
}

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

.input-group label {
    display: block;
    color: #666;
    font-size: 14px;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s;
}

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

.btn-login {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
    margin-top: 10px;
}

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

.login-tip {
    text-align: center;
    color: #999;
    font-size: 13px;
    margin-top: 15px;
}

.form-footer {
    text-align: center;
    margin-top: 15px;
}

.link-text {
    color: #667eea;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.link-text:hover {
    color: #764ba2;
    text-decoration: underline;
}

.login-footer {
    margin-top: 30px;
    color: rgba(255,255,255,0.8);
    font-size: 13px;
    text-align: center;
}

.login-footer a {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,0.5);
    transition: all 0.3s;
}

.login-footer a:hover {
    color: white;
    border-bottom-color: white;
}

/* 退出按钮 */
.btn-logout {
    padding: 5px 15px;
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 13px;
    cursor: pointer;
    margin-left: 10px;
    transition: background 0.3s;
}

.btn-logout:hover {
    background: #ff5252;
}

/* 用户姓名 */
.user-name {
    color: #333;
    font-weight: 500;
    margin-right: 10px;
}

/* 兑换码链接 */
.voucher-link {
    display: block;
    text-align: center;
    margin-top: 15px;
    padding: 10px;
    background: #f5f5f5;
    color: #667eea;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    transition: background 0.3s;
}

.voucher-link:hover {
    background: #e8e8e8;
}

/* 主页面底部版权 */
.main-footer {
    background: white;
    border-radius: 15px;
    padding: 15px;
    margin-top: 20px;
    text-align: center;
    color: #999;
    font-size: 13px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.main-footer a {
    color: #667eea;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.3s;
}

.main-footer a:hover {
    color: #764ba2;
    border-bottom-color: #764ba2;
}

/* 响应式调整 */
@media (max-width: 600px) {
    .login-box {
        padding: 30px 20px;
    }
    
    .login-title {
        font-size: 24px;
    }
    
    .user-info {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .btn-logout {
        margin-left: 0;
    }
}
