/* 域名查询相关样式 */

/* 查询按钮 */
.btn-query-domain {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 4px;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    line-height: 1.5;
    vertical-align: middle;
    transition: all 0.2s;
    font-weight: normal;
    pointer-events: auto; /* 确保可点击 */
}

.btn-query-domain:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: #fff;
    text-decoration: none;
}

/* 弹窗样式 */
.domain-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999; /* 极大值，确保最顶层 */
    display: none; /* 默认隐藏 */
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none; /* 默认不接收事件，避免遮挡 */
}

/* 激活状态 */
.domain-modal-overlay.active {
    display: flex !important; /* 强制显示 */
    opacity: 1;
    pointer-events: auto; /* 激活时接收事件 */
}

/* 国家选择弹窗 overlay 需要更高的 z-index */
#countrySelectModal.domain-modal-overlay {
    z-index: 10000 !important; /* 强制覆盖 */
}

.domain-modal {
    background: #fff;
    width: 800px;
    max-width: 90%;
    max-height: 85vh;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.domain-modal-overlay.active .domain-modal {
    transform: translateY(0);
}

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

.domain-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.domain-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

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

.domain-modal-body {
    padding: 24px;
    overflow: hidden; /* 防止外层滚动 */
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0; /* 确保 Flex 压缩生效 */
}

/* 查询表单 */
.domain-query-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto; /* 表单内容过长时可滚动 */
    flex: 1;
    min-height: 0; /* 确保 Flex 压缩生效 */
    padding-right: 4px; /* 防止滚动条遮挡 */
}

/* 简易结果展示区域 */
.simple-results-view {
    display: flex;
    flex-direction: column;
    flex: 1; /* 占据 body 的所有空间 */
    min-height: 0; /* 确保 Flex 压缩生效 */
    overflow: hidden;
}

.results-summary {
    margin-bottom: 15px;
    font-weight: 500;
    flex-shrink: 0; /* 防止被压缩 */
}

.results-list-container {
    flex: 1; /* 占据中间剩余空间 */
    overflow-y: auto; /* 这里滚动 */
    margin-bottom: 15px;
    border: 1px solid #eee;
    border-radius: 8px;
    min-height: 0; /* Flex 布局中确保滚动生效 */
}

.modal-actions {
    flex-shrink: 0; /* 防止被压缩 */
    /* ... existing styles ... */
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.keywords-input {
    width: 100%;
    height: 120px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    resize: vertical;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
}

.keywords-input:focus {
    outline: none;
    border-color: #000;
}

/* 国家选择区域 */
.country-select-trigger {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    background: #f9f9f9;
    min-height: 46px;
}

.selected-countries {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.country-tag {
    background: #e0e0e0;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: #333;
}

.no-selection {
    color: #999;
    font-size: 14px;
}

/* 结果展示区域 */
.query-results {
    display: none;
    height: 100%;
    display: flex;
    flex-direction: column;
}

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

.results-stats {
    font-size: 14px;
    color: #666;
}

.status-available {
    color: #10b981;
    font-weight: 600;
}

.status-unavailable {
    color: #ef4444;
}

.status-error {
    color: #f59e0b;
}

.results-table-container {
    flex: 1;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 8px;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
}

.results-table th,
.results-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.results-table th {
    background: #f9f9f9;
    font-weight: 600;
    font-size: 13px;
    color: #666;
    position: sticky;
    top: 0;
}

.results-table td {
    font-size: 14px;
}

/* 按钮样式 */
.btn-primary {
    background: #000;
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: #333;
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
    border: 1px solid #ddd;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.modal-actions {
    padding: 20px 24px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* 加载动画 */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.progress-container {
    width: 300px;
    margin-top: 20px;
}

.progress-bar {
    height: 6px;
    background: #eee;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: #000;
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    font-size: 12px;
    color: #666;
}

/* 国家选择弹窗 */
.country-modal {
    width: 600px;
}

.countries-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
}

.country-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid #eee;
    border-radius: 6px;
    transition: background 0.2s;
    width: 100%;
}

.country-item:hover {
    background: #f9f9f9;
}

.country-item input[type="checkbox"] {
    margin-right: 12px;
    width: 16px;
    height: 16px;
}

.country-info {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.country-info label {
    margin-bottom: 0;
    font-size: 14px;
    font-weight: 500;
}

.country-domains-container {
    display: flex;
    gap: 6px;
}

.country-domains {
    font-size: 11px;
    color: #888;
    background: #f0f0f0;
    padding: 2px 4px;
    border-radius: 3px;
}

/* 自定义域名后缀相关 */
.custom-domains-separator {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    margin: 16px 0;
    color: #999;
    font-size: 12px;
}

.custom-domains-separator hr {
    flex: 1;
    border: none;
    border-top: 1px solid #eee;
    margin: 0 10px;
}

.custom-domains-section {
    grid-column: 1 / -1;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 8px;
}

.custom-input-container {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.custom-domain-input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}

.add-custom-domain-btn {
    padding: 8px 16px;
    background: #333;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.custom-domains-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.custom-domain-item {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 2px 2px 2px 8px;
}

.custom-domain-text {
    font-size: 12px;
    color: #333;
    margin-right: 6px;
}

.remove-custom-domain-btn {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 16px;
    padding: 0 6px;
    line-height: 1;
}

.remove-custom-domain-btn:hover {
    color: #ff4444;
}

.no-custom-domains {
    color: #999;
    font-size: 12px;
    font-style: italic;
}
