/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', monospace;
    background-color: #2c3e50;
    color: #ecf0f1;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* 顶部信息栏 */
.header {
    background-color: #34495e;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.title {
    font-size: 20px;
    font-weight: bold;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

#userStatus {
    background-color: #2c3e50;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 14px;
}

.auth-btn {
    padding: 5px 10px;
    font-size: 12px;
    background-color: #3498db;
    color: white;
}

.auth-btn:hover {
    background-color: #2980b9;
}

#logoutBtn {
    background-color: #e74c3c;
}

#logoutBtn:hover {
    background-color: #c0392b;
}

#membershipBtn {
    background-color: #f1c40f;
    color: #2c3e50;
}

#membershipBtn:hover {
    background-color: #f39c12;
}

#adminBtn {
    background-color: #9b59b6;
}

#adminBtn:hover {
    background-color: #8e44ad;
}

.timer {
    font-size: 24px;
    font-weight: bold;
    background-color: #2c3e50;
    padding: 5px 15px;
    border-radius: 4px;
}

/* 粘贴区域 */
.paste-area {
    background-color: #34495e;
    padding: 10px 20px;
    margin: 10px 0;
}

.paste-area textarea {
    width: 100%;
    height: 150px;
    padding: 10px;
    background-color: #2c3e50;
    border: none;
    border-radius: 4px;
    color: #ecf0f1;
    font-family: 'Microsoft YaHei', sans-serif;
    font-size: 14px;
    resize: vertical;
    margin-bottom: 10px;
}

.paste-area textarea:focus {
    outline: 2px solid #3498db;
}

.paste-controls {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* 控制组样式 */
.control-group {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 0 10px;
    border-right: 2px solid #2c3e50;
}

.control-group:last-child {
    border-right: none;
}

.group-label {
    color: #bdc3c7;
    font-size: 14px;
}

/* 导入按钮样式 */
#importFileBtn, #showPasteBtn, #importSubtitleBtn, #showSubtitlePasteBtn {
    background-color: #3498db;
    color: white;
}

#importFileBtn:hover, #showPasteBtn:hover, #importSubtitleBtn:hover, #showSubtitlePasteBtn:hover {
    background-color: #2980b9;
}

/* 控制区域样式 */
.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 5px;
}

.group-label {
    font-weight: bold;
    margin-right: 5px;
}

#defaultSubtitlesSelect {
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: white;
    font-size: 14px;
    min-width: 200px;
    cursor: pointer;
}

#defaultSubtitlesSelect:hover {
    border-color: #888;
}

#defaultSubtitlesSelect:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

#loadDefaultSubtitleBtn {
    padding: 5px 10px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

#loadDefaultSubtitleBtn:hover {
    background-color: #2980b9;
}

#loadDefaultSubtitleBtn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* 打字区域 */
.typing-area {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background-color: #2c3e50;
}

.typing-lines {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.typing-line {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sample-text {
    font-family: monospace;
    font-size: 18px;
    line-height: 1.5;
    padding: 10px;
    background-color: #34495e;
    border-radius: 4px 4px 0 0;
    white-space: pre;
}

.typing-input {
    font-family: monospace;
    font-size: 18px;
    line-height: 1.5;
    padding: 10px;
    background-color: #456789;
    border: none;
    border-radius: 0 0 4px 4px;
    color: #ecf0f1;
    width: 100%;
}

.typing-input:focus {
    outline: 2px solid #3498db;
    background-color: #4a7296;
}

.typing-input:disabled {
    background-color: #2c3e50;
    cursor: not-allowed;
}

/* 正确和错误的字符样式 */
.correct {
    color: #2ecc71;
}

.incorrect {
    color: #e74c3c;
    text-decoration: underline;
}

/* 底部控制栏 */
.footer {
    background-color: #34495e;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stats {
    display: flex;
    gap: 20px;
}

.stat-item {
    background-color: #2c3e50;
    padding: 5px 10px;
    border-radius: 4px;
}

.controls {
    display: flex;
    gap: 10px;
}

/* 按钮样式 */
button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s;
}

/* 开始按钮样式 */
#startBtn {
    background-color: #2ecc71;
    color: white;
}

#startBtn:hover {
    background-color: #27ae60;
}

/* 提交按钮样式 */
#submitBtn {
    background-color: #f1c40f;
    color: white;
}

#submitBtn:hover {
    background-color: #f39c12;
}

/* 重置按钮样式 */
#resetBtn {
    background-color: #e74c3c;
    color: white;
}

#resetBtn:hover {
    background-color: #c0392b;
}

/* 确认和取消按钮样式 */
#confirmPasteBtn {
    background-color: #2ecc71;
    color: white;
}

#confirmPasteBtn:hover {
    background-color: #27ae60;
}

#cancelPasteBtn {
    background-color: #e74c3c;
    color: white;
}

#cancelPasteBtn:hover {
    background-color: #c0392b;
}

button:disabled {
    background-color: #bdc3c7 !important;
    cursor: not-allowed;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    overflow: auto;
}

.modal-content {
    background-color: #34495e;
    margin: 10% auto;
    padding: 20px;
    border-radius: 8px;
    width: 80%;
    max-width: 500px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    position: relative;
}

.membership-content {
    max-width: 700px;
}

.close {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #bdc3c7;
    cursor: pointer;
}

.close:hover {
    color: #ecf0f1;
}

.modal h2 {
    margin-bottom: 20px;
    color: #ecf0f1;
    text-align: center;
}

/* 表单样式 */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #bdc3c7;
}

.form-group input {
    width: 100%;
    padding: 10px;
    background-color: #2c3e50;
    border: 1px solid #7f8c8d;
    border-radius: 4px;
    color: #ecf0f1;
    font-size: 14px;
}

.form-group input:focus {
    outline: none;
    border-color: #3498db;
}

.btn-primary {
    width: 100%;
    padding: 10px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-primary:hover {
    background-color: #2980b9;
}

/* 会员中心样式 */
.user-profile, .membership-plans, .practice-stats {
    background-color: #2c3e50;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.user-profile h3, .membership-plans h3, .practice-stats h3 {
    color: #3498db;
    margin-bottom: 10px;
    border-bottom: 1px solid #3498db;
    padding-bottom: 5px;
}

.user-profile p, .practice-stats p {
    margin: 8px 0;
    color: #ecf0f1;
}

.plans-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.plan-card {
    background-color: #34495e;
    border-radius: 6px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    border: 1px solid #7f8c8d;
}

.plan-card.active {
    border-color: #2ecc71;
}

.plan-name {
    font-size: 18px;
    font-weight: bold;
    color: #ecf0f1;
    margin-bottom: 5px;
}

.plan-price {
    font-size: 20px;
    color: #f1c40f;
    margin-bottom: 10px;
}

.plan-description {
    color: #bdc3c7;
    margin-bottom: 10px;
    flex-grow: 1;
}

.plan-features {
    margin-bottom: 15px;
}

.plan-feature {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    color: #ecf0f1;
}

.plan-feature i {
    color: #2ecc71;
    margin-right: 5px;
}

.plan-button {
    width: 100%;
    padding: 8px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.plan-button:hover {
    background-color: #2980b9;
}

.plan-card.active .plan-button {
    background-color: #2ecc71;
}

.plan-card.active .plan-button:hover {
    background-color: #27ae60;
}

/* 剩余时间显示 */
#timeLimit {
    color: #f1c40f;
}
