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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow-y: auto;
}

.app-container {
    min-height: auto;
    padding: 15px;
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 40px;
    width: 100%;
    max-width: 400px;
}

.login-card h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 28px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
}

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

.alert {
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-danger {
    background-color: #fee;
    color: #c33;
    border: 1px solid #fcc;
}

.alert-success {
    background-color: #efe;
    color: #3c3;
    border: 1px solid #cfc;
}

/* 主页面样式 */
.app-container {
    min-height: 100vh;
    padding: 20px;
}

.header {
    background: white;
    border-radius: 8px;
    padding: 12px 20px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    color: #333;
    font-size: 20px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-change-pwd {
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.3s;
}

.btn-change-pwd:hover {
    background: #5568d3;
}

.btn-logout {
    padding: 10px 20px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.3s;
}

.btn-logout:hover {
    background: #c82333;
}

.input-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.input-group input {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
}

.btn-add {
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.btn-add:hover {
    opacity: 0.9;
}

.btn-add:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 结果展示容器 - 4行x3列 */
.results-container {
    background: white;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.global-actions {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    color: white;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
}

.btn-global-action {
    padding: 14px 28px;
    background: white;
    color: #667eea;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

.btn-global-action::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.2), transparent);
    transition: left 0.5s;
}

.btn-global-action:hover::before {
    left: 100%;
}

.btn-global-action:hover {
    background: #ffffff;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-global-action:active {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.btn-global-action:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-global-action:disabled:hover {
    transform: none;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
}

.weight-filter-select {
    margin-left: 10px;
    padding: 6px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    background: linear-gradient(to bottom, #ffffff, #f8f9fa);
    font-size: 12px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 6px center;
    background-size: 16px;
    padding-right: 28px;
}

.weight-filter-select:hover {
    border-color: #667eea;
    background: linear-gradient(to bottom, #ffffff, #f0f2ff);
    box-shadow: 0 3px 8px rgba(102, 126, 234, 0.15);
}

.weight-filter-select:focus {
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.weight-filter-select option {
    padding: 8px;
    background: white;
    color: #333;
}

.result-row {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 10px;
}

.result-row:last-child {
    margin-bottom: 0;
}

.row-title {
    color: #667eea;
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 8px 0;
    padding-bottom: 6px;
    border-bottom: 2px solid #667eea;
}

.row-cols {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
}

.col-item {
    background: white;
    border-radius: 4px;
    padding: 8px;
}

.col-header-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid #e0e0e0;
}

.col-header {
    font-size: 12px;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.col-actions {
    display: flex;
    gap: 6px;
}

.btn-action {
    padding: 6px 12px;
    background: #409eff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-action:hover {
    background: #66b1ff;
    transform: scale(1.05);
}

.btn-action:active {
    transform: scale(0.95);
}

.btn-clear-all {
    transition: all 0.2s;
}

.btn-clear-all:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

.col-list {
    max-height: 120px;
    overflow-y: auto;
}

.col-empty {
    text-align: center;
    color: #999;
    font-size: 11px;
    padding: 15px 0;
}

.col-domain {
    background: #f8f9fa;
    border-radius: 3px;
    padding: 5px 8px;
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    transition: all 0.2s;
}

.col-domain:hover {
    background: #e9ecef;
}

.col-domain.col-failed {
    background: #fff5f5;
    border-left: 2px solid #dc3545;
    flex-direction: column;
    align-items: flex-start;
}

.error-reason {
    font-size: 11px;
    color: #dc3545;
    margin-top: 2px;
    font-style: italic;
}

.domain-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #333;
}

.domain-del {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}

.domain-del:hover {
    background: #c82333;
}

.domain-retry {
    background: #ffc107;
    color: #333;
    border: none;
    border-radius: 3px;
    padding: 2px 6px;
    cursor: pointer;
    font-size: 10px;
    font-weight: 500;
    transition: background 0.2s;
    flex-shrink: 0;
}

.domain-retry:hover {
    background: #e0a800;
}

/* 滚动条样式 */
.col-list::-webkit-scrollbar {
    width: 4px;
}

.col-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}

.col-list::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 2px;
}

.col-list::-webkit-scrollbar-thumb:hover {
    background: #555;
}


.domain-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 12px;
    transition: transform 0.2s;
}

.domain-item:hover {
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

.domain-name {
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

.btn-delete {
    padding: 6px 12px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.btn-delete:hover {
    background: #c82333;
}

.domain-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    font-size: 14px;
    color: #666;
}

.domain-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 13px;
}

.domain-time {
    color: #999;
    font-size: 11px;
}

.failed-reason {
    color: #c33;
    font-size: 12px;
    word-break: break-word;
}

.weight-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 500;
    font-size: 12px;
}

.weight-zero-badge {
    background: #fee;
    color: #c33;
}

.weight-plus-badge {
    background: #efe;
    color: #3c3;
}

.loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #999;
}

/* 批量查询样式 */
.mode-switch {
    display: flex;
    gap: 10px;
}

.mode-btn {
    padding: 8px 20px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.mode-btn:hover {
    background: #f0f4ff;
}

.mode-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.batch-input-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.batch-input-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
}

.url-count {
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

.btn-upload {
    padding: 8px 16px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

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

.btn-upload:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 输入统计预览样式 */
.input-stats-preview {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border: 1px solid #a5d6a7;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 10px;
}

.input-stats-preview.stats-error {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    border-color: #ef9a9a;
}

.stats-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.stats-label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.stats-value {
    color: #555;
    font-size: 14px;
}

.stats-value strong {
    color: #2e7d32;
    font-size: 16px;
}

.stats-error .stats-value strong {
    color: #c62828;
}

.stats-arrow {
    color: #667eea;
    font-weight: bold;
    font-size: 16px;
}

.stats-status {
    font-size: 13px;
}

.stats-ok {
    color: #2e7d32;
    font-weight: 500;
}

.stats-exceed {
    color: #c62828;
    font-weight: 500;
}

.batch-textarea {
    width: 100%;
    min-height: 120px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    font-family: 'Courier New', monospace;
    resize: vertical;
}

.batch-textarea:focus {
    outline: none;
    border-color: #667eea;
}

.batch-textarea:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
}

.batch-options {
    padding: 10px 0;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"]:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.checkbox-label span {
    color: #555;
    font-size: 14px;
}

.batch-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn-clear {
    padding: 12px 24px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}

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

.btn-clear:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-batch-submit {
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}

.btn-batch-submit:hover {
    opacity: 0.9;
}

.btn-batch-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-copy-all,
.btn-download-all {
    padding: 12px 24px;
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-copy-all:hover,
.btn-download-all:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-copy-all:active,
.btn-download-all:active {
    transform: translateY(0);
}

.btn-copy-all:disabled,
.btn-download-all:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.btn-copy-all:disabled:hover,
.btn-download-all:disabled:hover {
    background: white;
    color: #667eea;
    transform: none;
    box-shadow: none;
}

.global-action-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.global-weight-filter {
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    background: linear-gradient(to bottom, #ffffff, #f8f9fa);
    font-size: 13px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
    padding-right: 32px;
}

.global-weight-filter:hover {
    border-color: #667eea;
    background: linear-gradient(to bottom, #ffffff, #f0f2ff);
    box-shadow: 0 3px 8px rgba(102, 126, 234, 0.15);
}

.global-weight-filter:focus {
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.global-weight-filter option {
    padding: 8px;
    background: white;
    color: #333;
}

/* 权重筛选组合 */
.weight-filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.weight-mode-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
}

.weight-mode-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #667eea;
    cursor: pointer;
}

.weight-mode-toggle .toggle-label {
    font-size: 13px;
    font-weight: 500;
    color: #555;
    padding: 6px 10px;
    background: #f0f0f0;
    border-radius: 4px;
    min-width: 50px;
    text-align: center;
    transition: all 0.2s;
}

.weight-mode-toggle input:checked + .toggle-label {
    background: #667eea;
    color: white;
}

.batch-progress {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 14px;
    color: #333;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
}

/* 失败域名样式 */
.domain-category.weight-failed h2 {
    color: #dc3545;
}

.domain-item.failed-item {
    background: #fff5f5;
    border: 1px solid #fcc;
}

.btn-retry {
    padding: 6px 12px;
    background: #ffc107;
    color: #333;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
}

.btn-retry:hover {
    background: #e0a800;
}

/* 模态框样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

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

.modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 20px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 30px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    line-height: 30px;
    transition: color 0.3s;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px 25px;
    border-top: 1px solid #e0e0e0;
}

.btn-cancel {
    padding: 10px 20px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.3s;
}

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

.btn-cancel:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-confirm {
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: opacity 0.3s;
}

.btn-confirm:hover {
    opacity: 0.9;
}

.btn-confirm:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 滚动条样式 */
.compact-list::-webkit-scrollbar {
    width: 6px;
}

.compact-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.compact-list::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.compact-list::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .compact-grid {
        grid-template-columns: 1fr;
    }
    
    .header-actions {
        flex-direction: column;
        align-items: flex-end;
        gap: 5px;
    }
}

@media (max-width: 768px) {
    .modal-content {
        width: 95%;
    }
}

@media (max-width: 768px) {
    .input-group {
        flex-direction: column;
    }
    
    .btn-add {
        width: 100%;
    }
    
    .domain-info {
        grid-template-columns: 1fr;
    }
}

