* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    color: #fff;
    font-size: 2rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

section {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.query-section {
    padding: 25px;
}

.input-group {
    margin-bottom: 10px;
}

.input-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
    min-height: 120px;
    line-height: 1.5;
    transition: border-color 0.3s;
}

.input-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.btn-full {
    width: 100%;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-danger {
    background: #ff6b6b;
    color: #fff;
    padding: 8px 16px;
    font-size: 14px;
}

.btn-danger:hover {
    background: #ee5a5a;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.btn-small:hover {
    opacity: 0.9;
}

.btn-setting {
    background: #6c757d;
    color: #fff;
}

.btn-setting:hover {
    background: #5a6268;
}

.btn-export {
    background: #17a2b8;
    color: #fff;
}

.btn-export:hover {
    background: #138496;
}

.btn-danger.btn-small {
    background: #ff6b6b;
}

.btn-mini {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 4px;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-query {
    background: #28a745;
    color: #fff;
}

.btn-query:hover {
    background: #218838;
}

.btn-delete {
    background: #ff6b6b;
    color: #fff;
}

.btn-delete:hover {
    background: #ee5a5a;
}

.btn-detail {
    background: #17a2b8;
    color: #fff;
}

.btn-detail:hover {
    background: #138496;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-header h2 {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.version-select {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
    outline: none;
}

.version-select:focus {
    border-color: #667eea;
}

h2 {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.placeholder-text {
    color: #999;
    text-align: center;
    padding: 20px;
}

.table-wrapper {
    overflow-x: auto;
}

.account-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    display: none;
}

.account-table.show {
    display: table;
}

.account-table th,
.account-table td {
    padding: 12px 10px;
    text-align: center;
    border-bottom: 1px solid #eee;
    white-space: nowrap;
}

.account-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
    position: sticky;
    top: 0;
}

.account-table tbody tr:hover {
    background: #f8f9fa;
}

.account-table td:nth-child(2) {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.status-pending {
    color: #999;
}

.status-success {
    color: #28a745;
}

.status-error {
    color: #ff6b6b;
}

.profit-value {
    color: #28a745;
    font-weight: 600;
}

.cookie-preview {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    color: #666;
}

.action-btns {
    display: flex;
    gap: 5px;
    justify-content: center;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
    background: #fff;
    border-radius: 12px 12px 0 0;
}

.modal-header h3 {
    font-size: 18px;
    color: #333;
}

.modal-close {
    font-size: 24px;
    cursor: pointer;
    color: #999;
    line-height: 1;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px dashed #eee;
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-label {
    color: #666;
    font-size: 14px;
}

.detail-value {
    color: #333;
    font-weight: 500;
    text-align: right;
    word-break: break-all;
    max-width: 60%;
}

.detail-value.profit {
    color: #28a745;
}

.cookie-detail {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 6px;
    font-size: 12px;
    word-break: break-all;
    color: #666;
    margin-top: 10px;
    max-height: 100px;
    overflow-y: auto;
}

.modal-small {
    max-width: 320px;
}

.commission-item {
    margin-bottom: 20px;
}

.commission-item label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.commission-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.commission-input-group input {
    flex: 1;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.commission-input-group input:focus {
    outline: none;
    border-color: #667eea;
}

.commission-unit {
    color: #666;
    font-size: 16px;
}

.export-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.export-option {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    color: #333;
    font-size: 14px;
    transition: all 0.2s;
    border-radius: 8px;
    width: auto;
    margin: 0 auto;
    min-width: 180px;
}

.export-option:hover {
    background: #e9ecef;
    border-color: #667eea;
}

.export-icon {
    font-size: 16px;
}

@media (max-width: 768px) {
    .container {
        max-width: 100%;
    }

    .account-table th,
    .account-table td {
        padding: 8px 6px;
        font-size: 12px;
    }

    .btn-mini {
        padding: 3px 6px;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .input-group textarea {
        min-height: 150px;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .section-header .btn-small {
        font-size: 12px;
        padding: 6px 12px;
    }
}
