body {
    font-family: Arial, sans-serif;
    background-color: #1a1a1d;
    color: #f4f4f9;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    background: linear-gradient(135deg, #f7931a 0%, #ff8f00 100%);
    color: #fff;
    padding: 20px 0;
    text-align: center;
}

main {
    flex: 1;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* 表格容器 */
.table-container {
    position: relative;
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    background: white;
}

/* 表格基础样式 */
.mining-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 0;
}

/* 表格单元格通用样式 */
.mining-table th,
.mining-table td {
    padding: 12px;
    background: white;
    border: 1px solid #e5e7eb;
    white-space: nowrap;
}

/* 表头样式 */
.mining-table thead th {
    background: #f3f4f6;
    font-weight: 600;
    color: #374151;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 2px solid #e5e7eb;
}

/* 固定列样式 */
.mining-table th.sticky-right,
.mining-table td.sticky-right {
    position: sticky;
    right: 0;
    z-index: 2;
    border-left: 2px solid #e5e7eb;
    box-shadow: -4px 0 6px -2px rgba(0, 0, 0, 0.1);
}

.mining-table th.sticky-right-2,
.mining-table td.sticky-right-2 {
    position: sticky;
    right: 40px; /* 减小与操作列的间距 */
    z-index: 2;
    border-left: 2px solid #e5e7eb;
    box-shadow: -4px 0 6px -2px rgba(0, 0, 0, 0.1);
}

/* 固定列的表头 */
.mining-table thead th.sticky-right,
.mining-table thead th.sticky-right-2 {
    z-index: 11;
    background: #f3f4f6;
}

/* 操作列样式 */
.mining-table td.sticky-right {
    padding: 8px;
    text-align: center;
    width: 40px; /* 固定操作列宽度 */
}

/* 确保固定列的背景色正确 */
.mining-table td.sticky-right,
.mining-table td.sticky-right-2,
.mining-table th.sticky-right,
.mining-table th.sticky-right-2 {
    background-color: white;
}

.mining-table tr:hover td.sticky-right,
.mining-table tr:hover td.sticky-right-2 {
    background-color: #f9fafb;
}

/* 调整最后两列的宽度 */
.mining-table th.sticky-right-2,
.mining-table td.sticky-right-2 {
    width: 100px; /* 回本周期列宽度 */
}

/* 输入框容器 */
.input-wrapper {
    position: relative;
    width: 100%;
}

/* 输入框样式 */
.custom-input,
.custom-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s;
    background: white;
}

.custom-input:focus,
.custom-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* 错误提示 */
.validation-message {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #fee2e2;
    color: #dc2626;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 4px;
    z-index: 20;
    display: none;
    white-space: nowrap;
    border: 1px solid #fecaca;
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.1);
}

/* 错误状态 */
.input-wrapper.error .custom-input {
    border-color: #dc2626;
    background-color: #fef2f2;
}

.input-wrapper.error .validation-message {
    display: block;
}

/* 只读输入框样式 */
.custom-input[readonly] {
    background-color: #f9fafb;
    border-color: #e5e7eb;
    color: #374151;
    cursor: default;
}

/* 删除按钮样式 */
.btn-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background-color: transparent;
    color: #ef4444;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-delete:hover {
    background-color: #fee2e2;
    color: #dc2626;
}

.btn-delete svg {
    width: 20px;
    height: 20px;
}

/* 表格行悬停效果 */
.mining-table tbody tr:hover td {
    background-color: #f9fafb;
}

/* 输入错误动画 */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

.input-wrapper.error .custom-input {
    animation: shake 0.4s ease-in-out;
}

/* 必填字段标记 */
.required-field::after {
    content: '*';
    color: #ef4444;
    margin-left: 4px;
}

/* 表格滚动阴影 */
.table-scroll-shadow {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 20px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
}

.table-container:hover .table-scroll-shadow {
    opacity: 1;
}

.table-scroll-shadow.left {
    left: 0;
    background: linear-gradient(to right, rgba(0,0,0,0.1), transparent);
}

.table-scroll-shadow.right {
    right: 0;
    background: linear-gradient(to left, rgba(0,0,0,0.1), transparent);
}

footer {
    background-color: #1a1a1d;
    color: #fff;
    text-align: center;
    padding: 20px 0;
    margin-top: auto;
    border-top: 1px solid #333;
}

@media (max-width: 768px) {
    .button-group {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}

[data-tooltip] {
    position: relative;
}

[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 8px;
    background-color: #333;
    color: white;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 10;
}

/* 输入提示 */
.input-tooltip {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    background-color: rgba(31, 41, 55, 0.95);
    color: #e5e7eb;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 20;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.input-wrapper.error .input-tooltip {
    opacity: 1;
    visibility: visible;
}

/* 进度指示器 */
.completion-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: rgba(31, 41, 55, 0.95);
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.completion-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.progress-bar {
    flex-grow: 1;
    height: 4px;
    background-color: rgba(75, 85, 99, 0.4);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: #10b981;
    transition: width 0.3s ease;
}

.remaining-fields {
    font-size: 12px;
    color: #e5e7eb;
}

.remaining-list {
    margin-top: 4px;
    padding-left: 16px;
    font-size: 12px;
    color: #9ca3af;
}

/* 错误抖动动画 */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

.input-wrapper.error .custom-input {
    animation: shake 0.4s ease-in-out;
}