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

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: white;
    padding: 30px 40px;
    text-align: center;
}

header h1 {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 8px;
}

header .subtitle {
    font-size: 14px;
    opacity: 0.7;
}

.settings-section {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 20px 40px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.setting-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.setting-item label {
    font-size: 16px;
    font-weight: 500;
    color: #495057;
}

.setting-item input[type="number"] {
    width: 70px;
    padding: 8px 12px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 16px;
    text-align: center;
    transition: border-color 0.3s;
}

.setting-item input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
}

.setting-item .unit {
    font-size: 14px;
    color: #6c757d;
}

.button-section {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 25px 40px;
    background: white;
    border-bottom: 1px solid #e9ecef;
    flex-wrap: wrap;
}

.btn {
    padding: 10px 24px;
    font-size: 16px;
    font-weight: 500;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 100px;
}

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

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

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a6fd6;
}

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

.btn-success:hover {
    background: #218838;
}

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

.btn-secondary:hover {
    background: #5a6268;
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-info:hover {
    background: #138496;
}

.main-content {
    min-height: 400px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.content-view {
    display: none;
    padding: 30px 40px;
}

.content-view.active {
    display: block;
}

.content-view h2 {
    font-size: 20px;
    color: #1a1a2e;
    margin-bottom: 25px;
    text-align: center;
    font-weight: 600;
}

.usage-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.usage-item {
    display: flex;
    gap: 15px;
    padding: 18px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.3s;
}

.usage-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.usage-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    font-size: 16px;
    font-weight: 600;
    flex-shrink: 0;
}

.usage-text {
    flex: 1;
}

.usage-text strong {
    display: block;
    color: #1a1a2e;
    margin-bottom: 6px;
    font-size: 15px;
}

.usage-text p {
    color: #64748b;
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
}

.ready-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 40px;
    text-align: center;
}

.ready-icon {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 50px;
    color: white;
    margin-bottom: 30px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 20px rgba(40, 167, 69, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(40, 167, 69, 0); }
}

.ready-content h3 {
    font-size: 24px;
    color: #1a1a2e;
    margin-bottom: 15px;
}

.ready-content p {
    font-size: 16px;
    color: #64748b;
    margin-bottom: 10px;
}

.ready-content p span {
    font-weight: 600;
    color: #667eea;
}

.btn-large {
    padding: 15px 40px;
    font-size: 20px;
    margin-top: 30px;
}

#resultTable {
    width: 100%;
    border-collapse: collapse;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    cursor: default;
}

#resultTable th,
#resultTable td {
    padding: 12px 8px;
    text-align: center;
    border: 1px solid #dee2e6;
    font-size: 14px;
}

#resultTable th {
    background: #DCE6FA;
    font-weight: 600;
    color: #212529;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
}

#resultTable th span {
    display: block;
    line-height: 1.4;
}

#resultTable tbody tr:hover {
    background: #f8f9fa;
}

#resultTable tbody tr.summary-row {
    background: #f0f0f0;
    font-weight: 600;
}

#resultTable td.selected {
    background-color: #cce5ff;
    border-color: #80bdff;
}

.table-note {
    text-align: center;
    padding: 15px 20px;
    font-size: 14px;
    color: #6c757d;
    background: #fff3cd;
    border-radius: 8px;
    margin-top: 15px;
    border: 1px solid #ffeeba;
}

.table-note strong {
    color: #856404;
}

.context-menu {
    position: fixed;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 2000;
    min-width: 120px;
    padding: 5px 0;
}

.context-menu-item {
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
}

.context-menu-item:hover {
    background-color: #f0f0f0;
}

footer {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    font-size: 14px;
    color: #6c757d;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.modal-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 22px;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 30px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.close-btn:hover {
    opacity: 1;
}

.modal-body {
    padding: 30px;
    max-height: calc(80vh - 80px);
    overflow-y: auto;
}

.modal-body ol {
    padding-left: 20px;
}

.modal-body li {
    margin-bottom: 15px;
    line-height: 1.8;
}

.modal-body ul {
    padding-left: 20px;
    margin-top: 8px;
}

.modal-body ul li {
    margin-bottom: 5px;
}

.modal-body p {
    font-size: 16px;
    line-height: 1.8;
    color: #495057;
    text-align: center;
}

.modal-footer {
    padding: 15px 30px;
    text-align: center;
    border-top: 1px solid #e9ecef;
}

.message-modal {
    max-width: 450px;
}

.message-modal .modal-body {
    padding: 30px;
}

.message-modal .modal-header h2 {
    font-size: 18px;
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    header h1 {
        font-size: 22px;
    }

    .settings-section {
        flex-wrap: wrap;
        padding: 15px 20px;
    }

    .button-section {
        padding: 15px 20px;
        gap: 10px;
    }

    .btn {
        padding: 8px 16px;
        font-size: 14px;
        min-width: 80px;
    }

    #resultTable th,
    #resultTable td {
        padding: 8px 4px;
        font-size: 12px;
    }
}