:root {
    --primary-color: #ff6b35;
    --secondary-color: #f7931e;
    --accent-color: #ffd23f;
    --success-color: #4caf50;
    --danger-color: #f44336;
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --white: #ffffff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

html, body {
    font-family: Arial, sans-serif;
    overflow-x: hidden;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden; /* 禁止水平滚动 */
    -webkit-overflow-scrolling: touch; /* iOS平滑滚动 */
    touch-action: pan-y; /* 只允许垂直滑动 */
    background-color: #f4f4f4;
    a {
        text-decoration: none;
    }
}
.xh3d-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.analysis-section,
.insights-section,
.history-records,
.record-section {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 0.2rem;
    box-shadow: var(--shadow);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.2rem;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.section-header h2 {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-header h2::before {
    font-size: 1.5rem;
}

.section-subtitle {
    font-size: 0.85rem;
    color: #6c757d;
}

.link-more {
    font-size: 0.9rem;
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.link-more:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

.analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.5rem;
}

.analysis-card {
    border: 2px solid var(--light-color);
    border-radius: var(--border-radius);
    padding: 0.75rem;
    transition: var(--transition);
    background: linear-gradient(135deg, var(--white), var(--light-color));
}

.analysis-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.analysis-card .label {
    font-size: 0.85rem;
    color: var(--secondary-color);
    font-weight: 500;
}

.analysis-card .value {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0.5rem 0;
    color: var(--primary-color);
}

.analysis-card p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--dark-color);
}

/* 标签页容器 */
.insights-tabs {
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* 标签头部 */
.tabs-header {
    display: flex;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-bottom: 2px solid #e0e0e0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tabs-header::-webkit-scrollbar {
    height: 4px;
}

.tabs-header::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 2px;
}

.tab-btn {
    flex: 1;
    min-width: 100px;
    padding: 0.1rem 0.5rem;
    border: none;
    background: transparent;
    color: #666;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
}

.tab-btn:hover {
    color: var(--primary-color);
    background: rgba(255, 107, 53, 0.05);
}

.tab-btn.active {
    color: var(--primary-color);
    font-weight: 600;
    border-bottom-color: var(--primary-color);
    background: rgba(255, 107, 53, 0.08);
}

/* 标签内容区域 */
.tabs-content {
    position: relative;
    min-height: 200px;
}

.tab-panel {
    display: none;
    padding: 0 0.5rem;
    animation: fadeIn 0.3s ease-in;
}

.tab-panel.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tab-panel-header {
    padding-bottom: 0.2rem;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* “跟着大神买” 按钮样式 */
.section-header .cta-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 500;
    text-decoration: none;
    background: linear-gradient(135deg, #ff8a54, #ffc178);
    color: #fff;
    box-shadow: 0 2px 6px rgba(255, 138, 84, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.5);
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
}

.section-header .cta-link:hover {
    transform: translateY(-0.5px);
    box-shadow: 0 3px 8px rgba(255, 138, 84, 0.3);
}

.section-header .cta-link:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(255, 138, 84, 0.25);
}

.tab-panel-header h3 {
    margin: 0;
    font-size: 1rem;
    color: var(--dark-color);
    font-weight: 600;
}

.tab-panel-header p {
    margin: 0;
    font-size: 0.8rem;
    color: #6c757d;
}

.tab-panel-body {
    background: #fff;
    border-radius: 8px;
    border: 1px dashed #f0f0f0;
    min-height: 150px;
}

.insight-placeholder {
    margin: 0;
    text-align: center;
    color: #9a9a9a;
    font-size: 0.85rem;
}

.hotcold-columns {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.hotcold-column {
    flex: 1 1 140px;
}

.hotcold-column h4 {
    margin: 0 0 0.3rem;
    font-size: 0.9rem;
    color: var(--primary-color);
}

.hotcold-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.hotcold-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
}

.insight-badge {
    padding: 0.1rem 0.35rem;
    border-radius: 999px;
    font-size: 0.75rem;
    background: rgba(255, 107, 53, 0.1);
    color: var(--primary-color);
}

.insight-note {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #6c757d;
}

/* 按位置分组的冷热分析样式 - 标签页切换 */
.hotcold-position-tabs {
    width: 100%;
}

.hotcold-position-tabs-header {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid #e9ecef;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.hotcold-position-tabs-header::-webkit-scrollbar {
    height: 4px;
}

.hotcold-position-tabs-header::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 2px;
}

.hotcold-position-tab {
    flex: 1;
    min-width: 80px;
    border: none;
    background: transparent;
    color: #666;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.hotcold-position-tab:hover {
    color: var(--primary-color);
    background: rgba(255, 107, 53, 0.05);
}

.hotcold-position-tab.active {
    color: var(--primary-color);
    font-weight: 600;
    border-bottom-color: var(--primary-color);
    background: rgba(255, 107, 53, 0.08);
}

.hotcold-position-tabs-content {
    position: relative;
    min-height: 150px;
}

.hotcold-position-panel {
    display: none;
    padding: 0.5rem 0;
    animation: fadeIn 0.3s ease-in;
}

.hotcold-position-panel.active {
    display: block;
}

.hotcold-column h5 {
    margin: 0 0 0.3rem;
    font-size: 0.85rem;
    color: var(--secondary-color);
    font-weight: 500;
}

.position-overlap {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #f1f3f5;
    display: flex;
    justify-content: space-between;
    gap: 0.35rem;
    flex-wrap: nowrap;
}

.trend-summary {
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    gap: 0.35rem;
    padding: 0.35rem 0.45rem;
    background: #fafbfc;
    border-radius: 0.75rem;
    border: 1px solid #eef2f5;
}

.trend-chip {
    flex: 1 1 0;
    min-width: 0;
    padding: 0.4rem 0.6rem;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #e6ebf1;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.trend-chip.trend-hot {
    border-color: rgba(255, 107, 53, 0.35);
    background: rgba(255, 107, 53, 0.08);
}

.trend-chip.trend-cold {
    border-color: rgba(60, 118, 229, 0.35);
    background: rgba(60, 118, 229, 0.08);
}

.chip-label {
    font-size: 0.75rem;
    color: #5b6473;
    letter-spacing: 0.01em;
}

.chip-value {
    font-size: 0.8rem;
    font-weight: 600;
    color: #2f3542;
    display: inline-flex;
    align-items: center;
}

.omission-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.omission-table th,
.omission-table td {
    text-align: center;
    padding: 0.35rem 0.2rem;
    border-bottom: 1px solid #f0f0f0;
}

.omission-table th {
    color: #555;
    font-weight: 600;
}

.omission-table td {
    color: #333;
}

.omission-position-section {
    margin-bottom: 1.5rem;
}

.omission-position-section:last-child {
    margin-bottom: 0;
}

.omission-position-section h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.95rem;
    color: var(--primary-color);
    font-weight: 600;
}

.omission-table tr.high-omission td {
    background-color: #fff3cd;
    color: #856404;
    font-weight: 600;
}

.omission-table tr.medium-omission td {
    background-color: #fffbf0;
    color: #b8860b;
}

.omission-table tr.high-omission td:first-child,
.omission-table tr.medium-omission td:first-child {
    font-weight: 700;
}

.distribution-block {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.distribution-block h4 {
    margin: 0.5rem 0 0.2rem;
    font-size: 0.9rem;
    color: var(--primary-color);
}

.distribution-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
}

.distribution-label {
    width: 55px;
    color: #555;
}

.distribution-bars {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.distribution-bar {
    height: 14px;
    border-radius: 999px;
    background: #f0f0f0;
    position: relative;
    overflow: hidden;
}

.distribution-bar span {
    position: absolute;
    top: 50%;
    left: 8px;
    transform: translateY(-50%);
    font-size: 0.7rem;
    color: #fff;
}

.distribution-bar.history-fill {
    background: linear-gradient(90deg, rgba(255,107,53,0.9), rgba(247,147,30,0.9));
}

.distribution-bar.user-fill {
    background: linear-gradient(90deg, rgba(9,132,227,0.85), rgba(56,173,169,0.85));
}

.insight-legend {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: #666;
    margin-bottom: 0.3rem;
}

.insight-legend span::before {
    content: "";
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 0.3rem;
    vertical-align: middle;
}

.insight-legend .history::before {
    background: rgba(255,107,53,0.9);
}

.insight-legend .user::before {
    background: rgba(9,132,227,0.85);
}

.history-scroll {
    overflow-x: auto;
    border-radius: var(--border-radius);
    border: 2px solid var(--light-color);
}

.history-records .history-detail-btn {
    min-width: 64px;
    transition: var(--transition);
}

.history-records .period-no-link {
    color: var(--primary-color);
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.history-records .period-no-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.history-records .period-no-link:active {
    color: var(--primary-active);
}

.history-detail-modal .history-detail-content {
    max-width: 96%;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
}

.history-detail-scroll {
    max-height: 60vh;
    overflow: auto;
    border: 1px solid var(--light-color);
    border-radius: var(--border-radius);
}

.history-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0 0 0.5rem;
}

.history-detail-actions {
    display: flex;
    justify-content: center;
    margin-top: 0.75rem;
}

.history-detail-actions .ghost.small {
    min-width: 80px;
}

.meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
    background: #f5f6fa;
    font-size: 0.8rem;
    color: #4b4f5c;
    border: 1px solid #e4e7f1;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
}

.meta-chip .meta-label {
    font-weight: 600;
    color: #2c3e50;
}

.meta-chip .meta-value {
    font-weight: 500;
}

.meta-chip-winning .meta-value {
    display: inline-flex;
    align-items: center;
}

.winner-balls {
    display: inline-flex;
    gap: 0.25rem;
    align-items: center;
}

.winner-ball {
    display: inline-flex;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff9e6f, #ff6b35);
    color: #fff;
    font-weight: 600;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(255, 107, 53, 0.35);
    font-size: 0.85rem;
}

.winner-ball.placeholder {
    background: #dfe4ea;
    color: #6b7280;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}

.meta-chip.highlight {
    background: rgba(255, 107, 53, 0.08);
    border-color: rgba(255, 107, 53, 0.35);
    color: #ff5a1f;
}

.history-detail-disabled {
    display: inline-block;
    min-width: 48px;
    color: #bbb;
    font-size: 0.85rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
}

table thead {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

table th {
    color: var(--white);
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
    position: sticky;
    top: 0;
}

table td {
    padding: 0.3rem;
    text-align: center;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--light-color);
    transition: var(--transition);
}

table tbody tr:hover {
    background: var(--light-color);
}

table tbody tr:last-child td {
    border-bottom: none;
}

.numbers .ball {
    display: inline-flex;
    width: 30px;
    height: 30px;
    margin: 0 0.25rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    align-items: center;
    justify-content: center;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
}

.numbers .ball:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(255, 107, 53, 0.3);
}

/* 控制面板容器 */
.control-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0.5rem;
}

/* 控制组 */
.control-group {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: var(--transition);
}

.control-group:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: #dee2e6;
}

/* 组头部 */
.group-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #f0f0f0;
}

.group-icon {
    font-size: 1.2rem;
    line-height: 1;
}

.group-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-color);
    letter-spacing: 0.5px;
}

/* 组内容 */
.group-content {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-start;
}

/* 控制字段 */
.control-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1 1 auto;
    min-width: 140px;
}

.control-field.full-width {
    width: 100%;
    min-width: 100%;
}

.control-field.compact {
    flex: 0 0 auto;
    min-width: 100px;
    max-width: 140px;
}

.field-hint {
    display: block;
    font-size: 0.75rem;
    color: #999;
    margin-top: 0.25rem;
    line-height: 1.2;
}

.field-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--dark-color);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.label-icon {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* 输入框样式 */
.input-field {
    padding: 0.75rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: var(--transition);
    background: var(--white);
    color: var(--dark-color);
    width: 100%;
    box-sizing: border-box;
}

.input-field:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
    background: #fffefb;
}

.input-field::placeholder {
    color: #adb5bd;
    opacity: 0.7;
}

.input-field.number-display {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    cursor: not-allowed;
    font-weight: 500;
    color: var(--primary-color);
    border-color: #d0d0d0;
}

/* 下拉框样式 */
select.input-field {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ff6b35' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 12px;
    padding-right: 2.5rem;
    cursor: pointer;
    font-weight: 500;
    background-color: var(--white);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

select.input-field:hover {
    border-color: var(--primary-color);
    background-color: #fffefb;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23f7931e' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 12px;
}

select.input-field:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.15), 0 4px 12px rgba(0, 0, 0, 0.1);
    background-color: #fffefb;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ff6b35' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 12px;
}

select.input-field option {
    padding: 1rem 1.25rem;
    background: var(--white);
    color: var(--dark-color);
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.6;
    min-height: 2.5rem;
    border: none;
    transition: all 0.2s ease;
}

/* 选中状态的选项 */
select.input-field option:checked,
select.input-field option[selected] {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)) !important;
    color: var(--white) !important;
    font-weight: 600;
    padding: 1rem 1.25rem;
}

/* 悬停状态的选项（部分浏览器支持） */
select.input-field option:hover {
    background: #fff5f0;
    color: var(--primary-color);
}

/* 针对不同浏览器的优化 */
select.input-field::-ms-expand {
    display: none;
}

/* Firefox 下拉列表样式 */
@-moz-document url-prefix() {
    select.input-field option {
        padding: 0.875rem 1.25rem;
        background-color: #ffffff;
        color: #2c3e50;
    }
    
    select.input-field option:checked {
        background-color: var(--primary-color);
        color: var(--white);
    }
}

/* WebKit 浏览器（Chrome, Safari）下拉列表样式 */
select.input-field option {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.input-hint {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 0.25rem;
    padding-left: 0.25rem;
    font-style: italic;
}

/* 按钮样式 */
.control-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    width: 100%;
    margin-top: 0.5rem;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    flex: 1 1 auto;
    min-width: 120px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}


.action-btn .btn-icon {
    font-size: 1rem;
    line-height: 1;
}

.action-btn.primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.action-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 107, 53, 0.4);
}

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


.action-btn.secondary {
    background: var(--white);
    color: var(--dark-color);
    border: 2px solid #dee2e6;
}

.action-btn.secondary:hover {
    background: #f8f9fa;
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-1px);
}

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


.save-record-btn {
    width: 40%;
    align-self: center;
    margin-top: 0.25rem;
    padding: 0.9rem 1.25rem;
    border: none;
    border-radius: 14px;
    background: linear-gradient(120deg, #ff7a45 0%, #ffb347 100%);
    color: var(--white);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(255, 122, 69, 0.25), inset 0 -3px 0 rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
    position: relative;
    overflow: hidden;
}

.save-record-btn span {
    position: relative;
    z-index: 1;
}

.save-record-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.35), transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.save-record-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 24px rgba(255, 122, 69, 0.35);
    filter: brightness(1.03);
}

.save-record-btn:hover::after {
    opacity: 1;
}

.save-record-btn:active {
    transform: translateY(0);
    box-shadow: 0 6px 12px rgba(255, 122, 69, 0.3);
}


.manual-message {
    min-height: 20px;
    font-size: 0.85rem;
    color: var(--danger-color);
    margin: 0.5rem 0 0;
    padding-left: 0.25rem;
}

.analysis-content {
    position: relative;
    background-color: var(--white);
}

.analysis-body {
    position: relative;
}

.select-number-btn {
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    border: none;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: var(--transition);
    white-space: nowrap;
}

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

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

.analysis-content.collapsed .analysis-body {
    max-height: 120px;
    overflow: hidden;
}

.analysis-content.collapsed .analysis-body::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 48px;
    background: linear-gradient(180deg, rgba(255,255,255,0) 0%, var(--white) 80%);
    pointer-events: none;
}

.analysis-toggle {
    position: absolute;
    right: 0.75rem;
    bottom: 0.75rem;
    z-index: 2;
}

.analysis-toggle.hidden {
    display: none;
}

.hidden {
    display: none !important;
}

.number-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999;
}

/* 输入号码和随机生成模态框需要显示在选号模态框之上 */
#numberModal,
#randomModal {
    z-index: 1000;
}

.number-modal.active {
    display: block;
}

.number-modal .modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.number-modal .modal-content {
    position: relative;
    width: 95%;
    margin: 40px auto;
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
    overflow: hidden;
}

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

.number-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
}

.number-modal .modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--white);
}

.number-modal .modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    color: var(--white);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.number-modal .modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}



.digit-inputs {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.digit-input {
    width: 60px;
    padding: 0.75rem;
    text-align: center;
    font-size: 1.2rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    transition: var(--transition);
}

.digit-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.modal-tip {
    font-size: 0.85rem;
    color: var(--secondary-color);
    text-align: center;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    background: var(--light-color);
}

.random-modal .modal-body {
    padding: 1.5rem;
}

.random-modal .random-label {
    font-size: 0.9rem;
    color: var(--dark-color);
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.random-modal .random-input {
    width: 80px;
    padding: 0.5rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    margin-bottom: 0.75rem;
    font-size: 1rem;
    transition: var(--transition);
}

.random-modal .random-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.random-modal .random-preview {
    min-height: 40px;
    background: var(--light-color);
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 0.75rem;
    font-size: 0.9rem;
    color: var(--dark-color);
    line-height: 1.6;
}

.random-modal .random-status {
    min-height: 20px;
    font-size: 0.85rem;
    color: var(--danger-color);
    margin-top: 0.5rem;
}

.record-modal-content {
    max-width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    margin: 40px auto !important;
}


/* 模态框中的控制面板样式 */
.record-modal-content .control-panel {
    gap: 0.3rem;
}

.record-modal-content .control-group {
    padding: 0.3rem 0.6rem;
}

.record-modal-content .group-content {
    gap: 0.3rem;
}

.record-modal-content .group-header {
    margin-bottom: 0.3rem;
    padding-bottom: 0.4rem;
    border-bottom-width: 1px;
}

.record-modal-content .control-field {
    min-width: 120px;
}

.record-modal-content .control-field.compact {
    min-width: 100px;
    max-width: 140px;
}

.record-modal-content .control-field.full-width {
    min-width: 100%;
}

.record-modal-content .action-btn {
    min-width: 90px;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
}

.record-modal-content .manual-message {
    font-size: 0.85rem;
    color: var(--secondary-color);
    margin-top: 0.5rem;
    min-height: 20px;
}

.primary,
.ghost,
.history-meta button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
}

.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
}

.ghost {
    background: var(--light-color);
    color: var(--dark-color);
    border: 1px solid transparent;
}

.ghost:hover {
    background: #ddd;
    transform: translateY(-1px);
}

.ghost.small {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

.ghost.tiny {
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
}

.history-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--secondary-color);
}

/* 水印样式 */
body::before {
    content: '29彩票网';
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-25%, -95%) rotate(-45deg);
    font-size: 3rem;
    color: rgba(0, 0, 0, 0.20);
    font-weight: 600;
    z-index: 9999;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

body::after {
    content: 'www.29129.cn';
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-20%, -15%) rotate(-45deg);
    font-size: 3rem;
    color: rgba(0, 0, 0, 0.20);
    font-weight: 600;
    z-index: 9999;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* 移动端水印样式调整 */
@media (max-width: 768px) {
    body::before,
    body::after {
        font-size: 2rem;
    }
}


