/* 时间观测表移动版专用样式 */
/* 迁移自時間觀測表_mobile.html的内联样式 */

body {
    margin: 0;
    padding: 0;
    font-family: "Microsoft YaHei", "Segoe UI", sans-serif;
    background-color: #f5f7fa;
    color: #333;
}

.mobile-container {
    padding: 15px;
    padding-bottom: 80px; /* 为底部控制栏留空间 */
}

.mobile-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.sticky-top {
    position: sticky;
    top: 60px; /* 导航栏高度 */
    z-index: 100;
}

/* 计时器大字体 */
.timer-display {
    font-size: 48px;
    font-weight: bold;
    text-align: center;
    color: #1a3a6c;
    font-family: 'Courier New', monospace;
    margin: 10px 0;
}

/* 触控大按钮 */
.btn-timer {
    min-height: 60px;
    min-width: 60px;
    font-size: 16px;
    border-radius: 30px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.btn-start {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    color: white;
}

.btn-lap {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
}

.btn-stop {
    background: linear-gradient(135deg, #dc3545 0%, #bd2130 100%);
    color: white;
}

.timer-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 15px 0;
}

.status-info {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
    font-size: 14px;
    color: #666;
    background: #f8f9fa;
    padding: 10px 15px;
    border-radius: 8px;
}

/* 底部固定控制栏 */
.bottom-control-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 12px 20px;
    border-top: 1px solid #eee;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.bottom-btn {
    min-height: 44px;
    padding: 0 20px;
    font-size: 14px;
    border: none;
    border-radius: 8px;
    background: #f8f9fa;
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.bottom-btn:active {
    background: #e9ecef;
    transform: scale(0.95);
}

.btn-reset {
    color: #dc3545;
}

.btn-export {
    color: #28a745;
}

.btn-help {
    color: #007bff;
}

/* 设置区样式 */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #495057;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
}

.element-manager {
    margin-top: 20px;
}

.element-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.element-input-group input {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
}

.btn-add-element {
    background: #007bff;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0 20px;
    font-size: 16px;
    cursor: pointer;
}

.element-list {
    list-style: none;
    padding: 0;
    margin: 10px 0;
    max-height: 200px;
    overflow-y: auto;
}

.element-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    background: #fff;
}

.element-item:nth-child(even) {
    background-color: #fafafa;
}

.btn-delete-element {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 12px;
    cursor: pointer;
}

.btn-start-setup {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 15px;
}

/* 表格容器 */
.table-scroll-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
    border: 1px solid #eee;
}

.mobile-table {
    min-width: 600px;
    font-size: 14px;
    border-collapse: collapse;
    width: 100%;
}

.mobile-table th, .mobile-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
    min-width: 40px;
}

.mobile-table th {
    background-color: #007bff;
    color: white;
    font-weight: bold;
}

.row-read {
    background-color: #fff;
    color: #888;
    font-size: 0.85em;
}

.row-time {
    background-color: #f8f9fa;
    color: #000;
    font-weight: bold;
}

.active-cell {
    background-color: #ffeeba !important;
    border: 2px solid #d39e00 !important;
    position: relative;
}

.active-cell::after {
    content: "📍";
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 12px;
}

/* 帮助文本 */
.helper-text {
    font-size: 13px;
    color: #666;
    margin-top: 10px;
    line-height: 1.5;
}

/* 响应式调整 */
@media (max-width: 480px) {
    .timer-display {
        font-size: 40px;
    }

    .btn-timer {
        min-height: 50px;
        min-width: 50px;
        font-size: 14px;
    }

    .timer-controls {
        gap: 10px;
    }

    .bottom-btn {
        padding: 0 15px;
        font-size: 12px;
    }

    .mobile-container {
        padding: 10px;
        padding-bottom: 70px;
    }

    .mobile-card {
        padding: 15px;
    }
}

/* 横屏优化 */
@media (min-width: 481px) and (max-width: 768px) and (orientation: landscape) {
    .timer-display {
        font-size: 36px;
    }

    .timer-controls {
        gap: 8px;
    }

    .mobile-container {
        padding: 10px;
    }
}

/* 大屏幕手机优化 */
@media (min-width: 429px) {
    .timer-display {
        font-size: 52px;
    }

    .btn-timer {
        min-height: 65px;
        min-width: 65px;
        font-size: 18px;
    }
}

/* 触摸优化：增加按钮点击区域 */
.btn-timer::after {
    content: '';
    position: absolute;
    top: -10px;
    bottom: -10px;
    left: -10px;
    right: -10px;
}

/* 语音播报状态指示器 */
.voice-status {
    position: fixed;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    z-index: 1001;
    display: none;
}

/* 振动反馈模拟 */
.vibration-feedback {
    animation: vibrate 0.3s linear;
}

@keyframes vibrate {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-2px); }
    40%, 80% { transform: translateX(2px); }
}/* 触摸优化 */
* {
    -webkit-tap-highlight-color: transparent; /* 移除触摸高亮 */
    -webkit-touch-callout: none; /* 禁用长按菜单 */
}

input, textarea, button {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border-radius: 0;
}

/* 按钮触摸反馈增强 */
.btn-timer:active, .bottom-btn:active, .btn-add-element:active {
    opacity: 0.8;
    transform: scale(0.97);
}

/* 防止文本选择 */
.element-item, .mobile-table td, .mobile-table th {
    user-select: none;
    -webkit-user-select: none;
}

/* 优化滚动性能 */
.table-scroll-container, .element-list {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

/* 横屏优化 */
@media (orientation: landscape) {
    .timer-controls {
        flex-direction: row;
        gap: 10px;
    }

    .mobile-container {
        padding: 10px;
    }

    .timer-display {
        font-size: 42px;
    }
}

/* 小屏幕手机优化 */
@media (max-width: 360px) {
    .timer-display {
        font-size: 36px;
    }

    .btn-timer {
        min-height: 44px;
        min-width: 44px;
        font-size: 12px;
    }

    .bottom-btn {
        padding: 0 10px;
        font-size: 11px;
    }
}

/* 拇指操作按钮样式 */
.thumb-controls {
    display: flex;
    justify-content: space-around;
    gap: 15px;
}

.thumb-btn {
    flex: 1;
    min-height: 80px;
    border: none;
    border-radius: 20px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    color: white;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.thumb-btn:active {
    transform: scale(0.95);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.thumb-btn.btn-start {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
}

.thumb-btn.btn-lap {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
}

.thumb-btn.btn-stop {
    background: linear-gradient(135deg, #dc3545 0%, #bd2130 100%);
}

.thumb-btn i {
    font-size: 24px;
}

.thumb-btn span {
    font-size: 16px;
}

.secondary-controls {
    display: flex;
    justify-content: space-around;
    gap: 10px;
}

.secondary-btn {
    min-height: 44px;
    padding: 0 20px;
    font-size: 14px;
    border: none;
    border-radius: 8px;
    background: #f8f9fa;
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.secondary-btn:active {
    background: #e9ecef;
    transform: scale(0.95);
}

.secondary-btn.btn-reset {
    color: #dc3545;
}

.secondary-btn.btn-export {
    color: #28a745;
}

.secondary-btn.btn-help {
    color: #007bff;
}

/* 横屏时的拇指按钮优化 */
@media (orientation: landscape) {
    .thumb-controls {
        gap: 10px;
    }

    .thumb-btn {
        min-height: 70px;
        font-size: 18px;
    }

    .thumb-btn i {
        font-size: 22px;
    }

    .thumb-btn span {
        font-size: 14px;
    }
}

/* 小屏幕拇指按钮优化 */
@media (max-width: 360px) {
    .thumb-btn {
        min-height: 70px;
        font-size: 18px;
        border-radius: 15px;
    }

    .thumb-btn i {
        font-size: 20px;
    }

    .thumb-btn span {
        font-size: 14px;
    }

    .secondary-btn {
        padding: 0 15px;
        font-size: 12px;
    }
}

/* 计数显示容器 */
.count-display-container {
    text-align: right;
    margin-top: 10px;
}

.count-display {
    color: #666;
}

/* 表格单元格宽度类 */
.table-cell-no {
    width: 50px;
}

.table-cell-element {
    width: 200px;
    text-align: left;
}

.table-cell-stat {
    width: 60px;
}

.table-cell-current {
    /* 当前循环单元格样式 */
}

.table-cell-previous {
    /* 前一循环单元格样式 */
}

/* 表格页脚样式 */
.table-footer {
    background: #e9ecef;
    font-weight: bold;
}

/* 表格行特定样式 */
.table-row-number {
    font-weight: bold;
    background: #fff;
    vertical-align: middle;
}

.table-row-element {
    text-align: left;
    background: #fff;
    vertical-align: middle;
}

.table-row-stat {
    font-weight: bold;
    color: #1a3a6c;
    vertical-align: middle;
}

.table-row-min {
    color: #666;
    vertical-align: middle;
}

/* 辅助文本增强 */
.helper-text.with-margin {
    margin-top: 10px;
}

/* 额外的触摸优化 */
/* 确保所有交互元素都有足够大的触摸目标 */
.btn-add-element,
.secondary-btn,
.btn-delete-element {
    min-height: 44px;
    min-width: 44px;
}

/* 输入框触摸优化 */
input[type="text"],
input[type="date"] {
    font-size: 16px; /* 防止iOS缩放 */
    line-height: 1.5;
}

/* 防止长按选择文本 */
.element-item,
.mobile-table td,
.mobile-table th,
.btn-timer,
.thumb-btn,
.secondary-btn {
    -webkit-user-select: none;
    user-select: none;
}

/* 平滑过渡动画 */
.btn-timer,
.thumb-btn,
.secondary-btn,
.btn-add-element {
    transition: all 0.15s ease;
}

/* 禁用文字缩放 */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* 优化滚动条 */
.table-scroll-container::-webkit-scrollbar {
    height: 8px;
}

.table-scroll-container::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.table-scroll-container::-webkit-scrollbar-track {
    background: #f1f1f1;
}

/* 防止iOS橡皮筋效果过度滚动 */
body {
    overscroll-behavior-y: contain;
}

/* 加载状态指示器 */
.loading-indicator {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    z-index: 2000;
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .btn-start {
        background: #28a745;
    }
    .btn-lap {
        background: #007bff;
    }
    .btn-stop {
        background: #dc3545;
    }
}
