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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a2980, #26d0ce);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    padding: 10px;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 10px;
}

/* 头部样式 */
header {
    text-align: center;
    margin-bottom: 20px;
    color: white;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

header h1 {
    font-size: 1.8rem;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.subtitle {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* 应用包装器 */
.app-wrapper {
    background-color: white;
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin-bottom: 20px;
}

/* 控制面板样式 */
.control-panel {
    background-color: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
}

.speed-control, .font-control {
    margin-bottom: 20px;
}

.speed-control label, .font-control label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #495057;
}

.speed-display, .font-display {
    font-size: 1.5rem;
    font-weight: bold;
    color: #1a2980;
    margin-bottom: 5px;
}

.unit {
    font-size: 0.9rem;
    color: #6c757d;
    margin-left: 3px;
}

.slider {
    width: 100%;
    height: 10px;
    border-radius: 5px;
    background: #dee2e6;
    outline: none;
    -webkit-appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: #1a2980;
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.slider::-moz-range-thumb {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: #1a2980;
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.speed-labels, .font-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    font-size: 0.8rem;
    color: #6c757d;
}

/* 按钮组样式 */
.button-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 20px;
}

.btn {
    padding: 12px 10px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(to right, #1a2980, #26d0ce);
    color: white;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

/* 提词器显示区域 */
.teleprompter-container {
    background-color: #1a1a2e;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    height: 300px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

.teleprompter-display {
    color: #e6e6e6;
    font-size: 24px;
    line-height: 1.8;
    padding: 10px;
    position: absolute;
    width: 100%;
    transition: transform 0.1s linear;
    font-family: 'Courier New', monospace;
    text-align: left;
    white-space: pre-line;
}

.tap-to-pause-hint {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.teleprompter-container:hover .tap-to-pause-hint,
.teleprompter-container.fullscreen .tap-to-pause-hint {
    opacity: 1;
}

/* 文本管理区域 */
.text-management {
    background-color: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    border: 1px solid #e9ecef;
}

.section-header {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-header h3 {
    color: #495057;
    font-size: 1.2rem;
}

.text-edit-area {
    margin-bottom: 15px;
}

#text-input {
    width: 100%;
    height: 150px;
    padding: 12px;
    border-radius: 8px;
    border: 2px solid #ced4da;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 1rem;
    resize: vertical;
    margin-bottom: 10px;
    white-space: pre-wrap;
}

#text-input:focus {
    outline: none;
    border-color: #1a2980;
    box-shadow: 0 0 0 3px rgba(26, 41, 128, 0.1);
}

.char-count {
    text-align: right;
    font-size: 0.9rem;
    color: #6c757d;
}

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

/* 全屏样式 */
.fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background-color: #000 !important;
    z-index: 2000 !important;
    padding: 20px !important;
    margin: 0 !important;
    border-radius: 0 !important;
    overflow: hidden !important;
}

.fullscreen .teleprompter-container {
    height: 100% !important;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 20px !important;
}

.fullscreen .teleprompter-display {
    color: #fff !important;
    font-weight: bold !important;
    text-align: left !important;
    font-size: 28px !important;
}

.fullscreen .tap-to-pause-hint {
    opacity: 1 !important;
    font-size: 1rem !important;
    bottom: 20px !important;
    background-color: rgba(0, 0, 0, 0.5) !important;
    padding: 10px !important;
    border-radius: 5px !important;
    margin: 0 auto !important;
    width: 80% !important;
}

/* 页脚样式 */
footer {
    text-align: center;
    color: white;
    font-size: 0.85rem;
    opacity: 0.8;
    margin-top: 20px;
}

.hint {
    font-size: 0.8rem;
    margin-top: 5px;
    opacity: 0.7;
}

/* 响应式调整 */
@media (min-width: 768px) {
    .container {
        max-width: 750px;
    }
    
    .button-group, .action-buttons {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .teleprompter-container {
        height: 400px;
    }
}

/* 移动设备优化 */
@media (max-width: 480px) {
    .button-group {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        grid-template-columns: 1fr;
    }
    
    .teleprompter-container {
        height: 250px;
    }
    
    .teleprompter-display {
        font-size: 20px;
    }
}

/* 横屏检测 */
@media (orientation: landscape) and (max-height: 500px) {
    .fullscreen .teleprompter-display {
        font-size: 22px !important;
    }
    
    .fullscreen .teleprompter-container {
        padding: 10px !important;
    }
}
