/* ===========================================
   CSS 变量 / 全局重置
   =========================================== */
:root {
    --primary-color: #007AFF;
    --success-color: #4CAF50;
    --warning-color: #FF9500;
    --danger-color: #FF3B30;
    --text-primary: #333;
    --text-secondary: #666;
    --text-muted: #999;
    --border-color: #ddd;
    --bg-primary: #fff;
    --bg-secondary: #f5f5f5;
    --bg-tertiary: #f0f0f0;
    --text-inverse: #fff;
    --border-radius: 8px;
    --border-radius-sm: 4px;
    --border-radius-lg: 16px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.5;
}

/* ===========================================
   顶部导航栏
   =========================================== */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background-color: var(--bg-primary);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-left h1 {
    font-size: 18px;
    color: var(--primary-color);
    margin-bottom: 2px;
}

.header-left p {
    font-size: 12px;
    color: var(--text-muted);
}

.header-right {
    display: flex;
    gap: 12px;
}

.btn-log, .btn-pingte, .btn-settings {
    padding: 10px 16px;
    border: none;
    border-radius: 0;
    font-size: 16px;
    cursor: pointer;
    min-width: 60px;
}

.btn-log, .btn-pingte {
    background-color: var(--success-color);
    color: var(--text-inverse);
}

.btn-settings {
    background-color: #666;
    color: var(--text-inverse);
}

/* ===========================================
   主要内容
   =========================================== */
.main-content {
    padding: 16px;
    min-height: calc(100vh - 120px);
}

/* ===========================================
   数据输入区域
   =========================================== */
.input-section {
    margin-bottom: 12px;
}

/* 标签切换 */
.tabs {
    display: flex;
    gap: 2px;
    margin-bottom: 8px;
    align-items: center;
}

.btn-add-user {
    padding: 8px;
    border: none;
    border-radius: 50%;
    background-color: var(--success-color);
    color: var(--text-inverse);
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
}

.tab, .tab-select {
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    background-color: var(--bg-tertiary);
    cursor: pointer;
    transition: var(--transition);
}

.tab {
    font-size: 14px;
    min-width: 70px;
    max-width: 90px;
}

.tab-select {
    padding: 8px 30px 8px 12px;
    font-size: 16px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="6" viewBox="0 0 12 6"><path fill="%23333" d="M0 0l6 6 6-6z"/></svg>') no-repeat right 8px center;
    min-width: 100px;
    max-width: 120px;
}

.tab.active {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.tab-select.active {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="6" viewBox="0 0 12 6"><path fill="%23fff" d="M0 0l6 6 6-6z"/></svg>');
}

/* 自定义下拉框 */
.custom-dropdown {
    position: relative;
    display: inline-block;
    min-width: 100px;
    max-width: 120px;
    vertical-align: middle;
}

.dropdown-selected {
    padding: 6px 24px 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    background: var(--bg-tertiary) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="10" height="5" viewBox="0 0 10 5"><path fill="%23333" d="M0 0l5 5 5-5z"/></svg>') no-repeat right 6px center;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    min-height: 28px;
    display: flex;
    align-items: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-selected:hover {
    background-color: #e0e0e0;
}

.dropdown-selected.active {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="6" viewBox="0 0 12 6"><path fill="%23fff" d="M0 0l6 6 6-6z"/></svg>');
}

.dropdown-list {
    position: absolute;
    inset: 100% 0 auto 0;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    margin-top: 4px;
    min-width: 120px;
}

.dropdown-item {
    padding: 10px 12px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

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

.dropdown-item:hover {
    background-color: var(--bg-secondary);
}

.dropdown-text {
    flex: 1;
    font-size: 16px;
    color: var(--text-primary);
}

.delete-btn {
    color: #FF3B30;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
    line-height: 1;
}

.delete-btn:hover {
    background-color: #FF3B30;
    color: #fff;
}

/* 输入容器 */
.input-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.input-container textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    resize: none;
    margin-bottom: 8px;
    overflow-y: hidden;
}

.input-buttons {
    display: flex;
    gap: 8px;
    justify-content: space-between;
    flex-wrap: nowrap;
    width: 100%;
}

.btn-submit, .btn-cancel, .btn-clear {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 0;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    min-height: 36px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-submit {
    background-color: var(--primary-color);
    color: #fff;
}

.btn-cancel {
    background-color: var(--warning-color);
    color: #fff;
}

.btn-clear {
    background-color: var(--danger-color);
    color: #fff;
}

/* ===========================================
   统计结果区域
   =========================================== */
.result-section {
    background-color: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    padding: 10px 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.result-header {
    margin-bottom: 16px;
}

.result-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.result-item {
    flex: 1;
    text-align: center;
    font-size: 14px;
    color: var(--text-primary);
}

.result-item:first-child {
    font-size: 16px;
    color: var(--primary-color);
    font-weight: bold;
    flex: 0 0 40px;
    text-align: left;
}

.result-item:nth-child(2) {
    font-size: 14px;
    color: var(--text-primary);
}

.total-amount {
    color: var(--danger-color);
    font-weight: bold;
}

.rebate-amount {
    color: var(--primary-color);
    font-weight: bold;
}

.result-controls {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    align-items: center;
}

.sort-select {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 16px;
    background-color: var(--bg-tertiary);
    min-width: 0;
}

.btn-copy, .btn-report {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    min-width: 0;
}

.btn-copy {
    background-color: var(--primary-color);
    color: #fff;
    min-width: 120px;
}

.btn-report {
    background-color: var(--warning-color);
    color: #fff;
}

.result-table {
    width: 100%;
    overflow-x: auto;
    max-height: calc(100vh - 300px);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #eee;
    font-size: 18px;
}

th {
    font-weight: 600;
    color: var(--text-secondary);
    background-color: var(--bg-secondary);
}

/* 号码波色 */
.number-red { color: var(--danger-color); }
.number-blue { color: var(--primary-color); }
.number-green { color: var(--success-color); }

/* 风险值颜色 */
.risk-high { color: var(--danger-color); }
.risk-low { color: var(--success-color); }

/* ===========================================
   底部导航栏
   =========================================== */
.footer {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 4px 0;
    background-color: var(--bg-primary);
    box-shadow: 0 -2px 4px rgba(0,0,0,0.1);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
}

.footer-btn {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 12px;
    min-width: 80px;
    gap: 6px;
}

.footer-btn.active {
    color: var(--primary-color);
}

.footer-icon {
    font-size: 16px;
}

.footer-btn span:last-child {
    font-size: 14px;
}

/* ===========================================
   添加记录全屏弹窗
   =========================================== */
.popup {
    position: fixed;
    inset: 0;
    background-color: var(--bg-primary);
    z-index: 1000;
    display: none;
    flex-direction: column;
}

.popup.show {
    display: flex;
}

@keyframes popupSlideIn {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.popup-header {
    background-color: var(--warning-color);
    color: #fff;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    position: relative;
    height: 44px;
    min-height: 44px;
}

.popup-back {
    background: none;
    border: none;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    margin-right: 16px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup-header h2 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    padding: 0;
    line-height: 1.5;
}

.popup-content {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
}

.input-row {
    position: relative;
    margin-bottom: 20px;
}

.input-row.fixed-top {
    position: sticky;
    top: 0;
    background-color: var(--bg-primary);
    padding: 10px 0;
    z-index: 10;
    border-bottom: 1px solid var(--border-color);
}

.input-row input,
.input-row textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 16px;
    box-sizing: border-box;
}

.input-row textarea {
    resize: vertical;
    min-height: 100px;
}

.input-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.result-section h3 {
    font-size: clamp(12px, 2.5vw, 16px);
    color: var(--text-primary);
    margin: 0;
}

.section-header .slider-toggle {
    margin-left: 10px;
}

.result-summary {
    display: flex;
    justify-content: space-between;
    padding: 8px;
    background-color: var(--bg-secondary);
    border-radius: var(--border-radius-sm);
    margin-bottom: 12px;
    font-size: 14px;
}

.record-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.record-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background-color: var(--bg-secondary);
    border-radius: var(--border-radius-sm);
}

/* 左右滑动切换按钮（默认文字"详细"，紧凑模式下 JS 切换为"紧凑"） */
.slider-toggle {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
    --toggle-text: "详细";
}

.slider-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider-label {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.slider-label:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: var(--success-color);
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider-label {
    background-color: #ccc;
}

input:checked + .slider-label:before {
    transform: translateX(24px);
}

.slider-toggle::before {
    content: var(--toggle-text);
    position: absolute;
    left: -40px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: var(--text-secondary);
}

.popup-footer {
    padding: 16px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 12px;
}

.btn-primary, .btn-secondary {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    min-height: auto;
    color: #fff;
}

.btn-primary {
    background-color: var(--primary-color);
}

.btn-secondary {
    background-color: var(--warning-color);
}

/* ===========================================
   轻提示 / 输入弹窗 / 确认弹窗
   =========================================== */
.alert-box {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: #fff;
    border-radius: 8px;
    padding: 16px 24px;
    font-size: 16px;
    text-align: center;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: fadeInOut 1s ease-in-out;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
    20% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    80% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
}

/* 输入弹窗 */
.prompt-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.prompt-dialog {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    width: 90%;
    max-width: 400px;
}

.prompt-message {
    margin: 0 0 16px 0;
    font-size: 16px;
}

.prompt-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    margin-bottom: 16px;
    box-sizing: border-box;
}

.prompt-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.prompt-button {
    padding: 8px 16px;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    cursor: pointer;
}

.prompt-button.cancel {
    border: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
}

.prompt-button.confirm {
    background-color: var(--primary-color);
    color: white;
}

/* 确认对话框 */
.confirm-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.confirm-box {
    background-color: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    padding: 20px;
    width: 80%;
    max-width: 300px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.confirm-message {
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 20px;
    text-align: center;
}

.confirm-buttons {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.confirm-button {
    flex: 1;
    padding: 10px;
    border: 1px solid transparent;
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    cursor: pointer;
}

.confirm-button.cancel {
    border-color: var(--border-color);
    background-color: var(--bg-secondary);
}

.confirm-button.confirm {
    background-color: var(--primary-color);
    color: #fff;
}

/* 用户名输入框 */
.user-input {
    margin: 0;
    padding: 5px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    width: 120px;
    max-width: 120px;
}

/* ===========================================
   兑奖统计界面
   =========================================== */
.stats-container {
    padding: 16px;
    background-color: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.stats-nav {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.stats-nav-btn {
    flex: 1;
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    background-color: var(--bg-tertiary);
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition);
}

.stats-nav-btn.active {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

/* 平码输入区域 */
.pingma-container {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
    align-items: center;
    flex-wrap: nowrap;
    overflow-x: auto;
    font-size: 0;
}

.pingma-container label {
    font-size: 16px;
    font-weight: 600;
    min-width: 60px;
    white-space: nowrap;
}

.pingma-container input {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 16px;
    min-width: 45px;
    width: auto;
    text-align: center;
    -webkit-appearance: textfield;
    -moz-appearance: textfield;
    appearance: textfield;
    margin: 0;
    display: inline-block;
    box-sizing: border-box;
}

.pingma-container input::-webkit-outer-spin-button,
.pingma-container input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

/* 特码输入区域 */
.special-number-container {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    align-items: center;
    flex-wrap: nowrap;
}

.special-number-container #period-display {
    font-size: 18px;
    font-weight: bold;
    white-space: nowrap;
}

.special-number-container label {
    font-size: 16px;
    font-weight: 600;
    min-width: 60px;
    white-space: nowrap;
}

.special-number-container input {
    flex: 1;
    max-width: 100px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 16px;
    white-space: nowrap;
    text-align: center;
    -webkit-appearance: textfield;
    -moz-appearance: textfield;
    appearance: textfield;
}

.special-number-container input::-webkit-outer-spin-button,
.special-number-container input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

/* 统计列表 */
.stats-table-container {
    overflow-x: auto;
}

#stats-table {
    width: 100%;
    border-collapse: collapse;
}

#stats-table th,
#stats-table td {
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid #ddd;
}

#stats-table th {
    background-color: var(--bg-tertiary);
    font-weight: 600;
    position: sticky;
    top: 0;
}

#stats-table tr:hover {
    background-color: var(--bg-secondary);
}

#stats-table tr:first-child {
    background-color: var(--bg-secondary);
}

/* ===========================================
   日志窗口
   =========================================== */
.log-window {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    touch-action: none;
    overflow: hidden;
}

.log-content {
    background-color: white;
    border-radius: 12px;
    width: 90%;
    max-height: 90vh;
    min-height: clamp(500px, 60vh, 1000px);
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transform: translateZ(0);
    position: relative;
}

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

.log-title {
    margin: 0;
    font-size: clamp(16px, 3vw, 24px);
    font-weight: 600;
}

.log-actions {
    display: flex;
    gap: 8px;
}

.log-clear-btn {
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    background-color: var(--bg-secondary);
    font-size: clamp(10px, 2vw, 14px);
    cursor: pointer;
    font-weight: 500;
    min-width: 40px;
    text-align: center;
    transition: all 0.2s ease;
}

.log-clear-btn:hover {
    background-color: #e0e0e0;
}

.log-clear-btn:active {
    transform: scale(0.98);
    background-color: #d0d0d0;
}

.log-close-btn {
    padding: 4px 8px;
    border: none;
    border-radius: 3px;
    background-color: #007AFF;
    color: white;
    font-size: clamp(10px, 2vw, 14px);
    cursor: pointer;
    font-weight: 500;
    min-width: 40px;
    text-align: center;
    transition: all 0.2s ease;
}

.log-close-btn:hover {
    background-color: #0056b3;
}

.log-close-btn:active {
    transform: scale(0.98);
    background-color: #004085;
}

.log-list {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.log-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 40px 0;
}

.log-item {
    padding: 16px 12px;
    border-bottom: 1px solid #f0f0f0;
    font-size: clamp(12px, 2.5vw, 16px);
    margin-bottom: 8px;
    background-color: #fafafa;
    border-radius: 6px;
}

.log-item:last-child {
    margin-bottom: 0;
}

.log-time,
.log-user,
.log-action {
    margin-right: 8px;
}

.log-time {
    color: var(--text-secondary);
}

.log-user,
.log-content-text {
    color: var(--text-primary);
}

.log-user {
    font-weight: 500;
}

.log-action {
    color: #007AFF;
}

.log-content-text {
    margin-top: 8px;
    line-height: 1.6;
}

.log-content-line {
    margin-bottom: 6px;
    padding: 4px 0;
    border-bottom: 1px dashed #f0f0f0;
}

.log-content-line:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.log-content-continuation {
    margin-bottom: 6px;
    padding-left: 16px;
    color: var(--text-secondary);
    font-size: 0.95em;
}

/* 日志过滤器 */
.log-filter {
    display: flex;
    gap: 16px;
    align-items: center;
}

.log-filter-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: clamp(12px, 2.5vw, 16px);
    cursor: pointer;
}

.log-filter-item.log-filter-parse { color: #FF3B30; }
.log-filter-item.log-filter-submit { color: #007AFF; }
.log-filter-item.log-filter-undo { color: #4CAF50; }

.log-filter-item input[type="checkbox"] {
    cursor: pointer;
}

/* 日志类型颜色 */
.log-parse { color: #FF3B30; }
.log-submit { color: #007AFF; }
.log-undo { color: #4CAF50; }

.log-parse .log-action,
.log-submit .log-action,
.log-undo .log-action,
.log-parse .log-content-text,
.log-submit .log-content-text,
.log-undo .log-content-text {
    color: inherit;
}

/* ===========================================
   响应式适配（移动端）
   =========================================== */
@media (max-width: 480px) {
    .header {
        padding: 10px 12px;
    }

    .header-left h1 {
        font-size: 16px;
    }

    .header-right {
        gap: 8px;
    }

    .btn-log, .btn-pingte, .btn-settings {
        padding: 4px 8px;
        font-size: 12px;
    }

    .main-content {
        padding: 12px;
        padding-bottom: 80px;
    }

    .result-controls {
        flex-wrap: nowrap;
        gap: 8px;
    }

    .sort-select {
        flex: 1;
        min-width: 100px;
        font-size: 12px;
    }

    .btn-copy, .btn-report {
        flex: 0 0 auto;
        min-width: 80px;
        font-size: 12px;
        padding: 10px;
    }

    /* 移动端表格 */
    .result-table {
        max-height: calc(100vh - 320px);
        overflow-y: auto;
        overflow-x: auto;
        scrollbar-width: thin;
        scrollbar-color: #007AFF #f0f0f0;
    }

    .result-table::-webkit-scrollbar {
        width: 6px;
        height: 6px;
    }

    .result-table::-webkit-scrollbar-track {
        background: #f0f0f0;
        border-radius: 3px;
    }

    .result-table::-webkit-scrollbar-thumb {
        background: #007AFF;
        border-radius: 3px;
    }

    .result-table::-webkit-scrollbar-thumb:hover {
        background: #0056b3;
    }

    #zodiac-table {
        width: 100%;
        table-layout: fixed;
    }

    #zodiac-table th:first-child,
    #zodiac-table td:first-child {
        width: 60px;
        min-width: 60px;
        max-width: 60px;
    }

    #zodiac-table th:nth-child(2),
    #zodiac-table td:nth-child(2) {
        width: 80px;
        min-width: 80px;
        max-width: 100px;
    }

    #zodiac-table th:nth-child(3),
    #zodiac-table td:nth-child(3) {
        width: 80px;
        min-width: 80px;
        text-align: right;
    }

    #zodiac-table th:nth-child(4),
    #zodiac-table td:nth-child(4) {
        width: 80px;
        min-width: 80px;
        text-align: right;
    }

    th, td {
        padding: 10px 8px;
        font-size: 14px;
    }

    .number-checkbox {
        transform: scale(1.2);
        margin-right: 6px;
    }

    /* 弹窗动画与尺寸 */
    .prompt-dialog {
        width: 95%;
        padding: 16px;
        animation: popupSlideIn 0.3s ease-out;
    }

    .confirm-box {
        width: 90%;
        padding: 16px;
        animation: popupSlideIn 0.3s ease-out;
    }

    .prompt-button,
    .confirm-button {
        padding: 12px 20px;
        font-size: 16px;
        min-height: 44px;
        transition: all 0.2s ease;
        border-radius: 8px;
    }

    .prompt-button:active,
    .confirm-button:active {
        transform: scale(0.95);
        opacity: 0.8;
    }

    /* 兑奖界面 */
    .stats-nav {
        gap: 8px;
    }

    .stats-nav-btn {
        padding: 6px 12px;
        font-size: 14px;
    }

    .special-number-container {
        flex-direction: row;
        align-items: center;
    }

    .special-number-container label {
        min-width: 60px;
        margin-bottom: 0;
    }

    .special-number-container input {
        flex: 1;
    }

    #stats-table th,
    #stats-table td {
        padding: 10px 8px;
        font-size: 14px;
    }

    /* 日志窗口 */
    .log-content {
        width: 95%;
        max-height: 85%;
    }

    .log-header {
        padding: 16px;
    }

    .log-title {
        font-size: 18px;
    }

    .log-clear-btn, .log-close-btn {
        padding: 8px 12px;
        font-size: 14px;
        min-width: 70px;
    }

    .log-list {
        padding: 12px;
    }

    .log-item {
        padding: 10px;
        font-size: 13px;
    }
}
