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

/* ── 动态科技背景 ── */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", sans-serif;
    background: #0a0a0f;
    color: #e0e0e0;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(0, 150, 255, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(120, 50, 255, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(0, 200, 255, 0.04) 0%, transparent 50%);
    animation: bgShift 20s ease-in-out infinite alternate;
    z-index: -1;
    pointer-events: none;
}

@keyframes bgShift {
    0% { transform: translate(0%, 0%) rotate(0deg); }
    100% { transform: translate(2%, 2%) rotate(3deg); }
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* ── 标题 ── */
h1 {
    font-size: 32px;
    font-weight: 800;
    text-align: center;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #00d4ff, #7b68ee, #00d4ff);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientText 4s ease-in-out infinite alternate;
    letter-spacing: 2px;
}

@keyframes gradientText {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

.subtitle {
    text-align: center;
    color: #6b7280;
    margin-bottom: 32px;
    font-size: 14px;
    letter-spacing: 4px;
    text-transform: uppercase;
}

.subtitle::before,
.subtitle::after {
    content: ' • ';
    color: #00d4ff;
}

/* ── 搜索框 ── */
.search-box {
    background: rgba(255,255,255,0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.05);
    margin-bottom: 24px;
    transition: box-shadow 0.3s;
}

.search-box:focus-within {
    box-shadow: 0 8px 32px rgba(0,150,255,0.08), inset 0 1px 0 rgba(255,255,255,0.05);
    border-color: rgba(0, 180, 255, 0.2);
}

.search-box label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 6px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.search-box input[type="text"] {
    width: 100%;
    padding: 14px 18px;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    font-size: 16px;
    color: #e0e0e0;
    outline: none;
    transition: all 0.3s;
    font-family: "SF Mono", "Menlo", monospace;
}

.search-box input[type="text"]:focus {
    border-color: rgba(0, 180, 255, 0.4);
    background: rgba(0,0,0,0.5);
    box-shadow: 0 0 20px rgba(0, 150, 255, 0.05), inset 0 0 20px rgba(0, 150, 255, 0.02);
}

.search-box input[type="text"]::placeholder {
    color: #4b5563;
}

.search-box .field-group {
    margin-bottom: 18px;
}

/* ── 搜索模式切换 ── */
.match-mode {
    display: flex;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    overflow: hidden;
    width: fit-content;
}
.mode-option {
    padding: 6px 18px;
    font-size: 13px;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.2s;
    user-select: none;
    text-align: center;
    border-right: 1px solid rgba(255,255,255,0.04);
}
.mode-option:last-child { border-right: none; }
.mode-option:hover { color: #9ca3af; }
.mode-option.active {
    background: rgba(34, 197, 94, 0.12);
    color: #22c55e;
}

.code-expire {
    font-size: 12px;
    color: #22c55e;
    margin-top: 6px;
    min-height: 18px;
}

/* ── 按钮 ── */
.btn {
    display: inline-block;
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #0066ff, #7b68ee);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s;
}

.btn:hover::before { opacity: 1; }
.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(0, 102, 255, 0.3);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(0, 102, 255, 0.2);
}

.btn-half {
    display: inline-block;
    width: 50%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #0066ff, #7b68ee);
    color: #fff;
    border: none;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.3s;
    letter-spacing: 1px;
}

.btn-ghost {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.12);
    color: #9ca3af;
}
.btn-ghost:hover {
    border-color: rgba(34, 197, 94, 0.3);
    color: #22c55e;
    background: rgba(34, 197, 94, 0.03);
    transform: none;
    box-shadow: none;
}

.btn:disabled,
.btn-half:disabled {
    background: #1f2937;
    color: #4b5563;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ── 结果区域 ── */
#results-area {
    display: none;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 14px;
    color: #6b7280;
}

.domain-list {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    overflow: hidden;
}

.domain-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    font-family: "SF Mono", "Menlo", monospace;
    font-size: 18px;
    font-weight: 700;
    color: #22c55e;
}

.domain-item:last-child { border-bottom: none; }

.domain-item:hover {
    background: rgba(0, 150, 255, 0.04);
}

.copy-btn {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.2);
    color: #22c55e;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    font-family: inherit;
    flex-shrink: 0;
}

.copy-btn:hover {
    background: rgba(34, 197, 94, 0.2);
    border-color: #22c55e;
}

/* ── 注册状态 ── */
.reg-status {
    font-size: 11px;
    color: #f87171;
    font-weight: 600;
    white-space: nowrap;
}

.domain-item .copy-hint {
    font-size: 11px;
    color: #4b5563;
    opacity: 0;
    transition: opacity 0.2s;
}

.domain-item:hover .copy-hint { opacity: 1; }

/* ── 域名高亮渲染 ── */
.highlight {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    padding: 0 2px;
    border-radius: 3px;
}

.domain-item.copied {
    background: rgba(0, 200, 150, 0.06);
    color: #34d399;
}

.domain-item.copied .copy-hint {
    color: #34d399;
    opacity: 1;
}

/* ── 分页 ── */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
}

.pagination button {
    padding: 8px 16px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    background: rgba(255,255,255,0.03);
    color: #9ca3af;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.pagination button:hover:not(:disabled) {
    background: rgba(0, 150, 255, 0.08);
    border-color: rgba(0, 180, 255, 0.3);
    color: #00d4ff;
}

.pagination button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.pagination .page-info {
    font-size: 13px;
    color: #4b5563;
}

/* ── 错误提示 ── */
.alert {
    padding: 12px 18px;
    border-radius: 10px;
    margin-bottom: 18px;
    font-size: 14px;
    display: none;
    animation: fadeIn 0.2s ease;
}

.alert.error {
    display: block;
    background: rgba(220, 38, 38, 0.08);
    color: #f87171;
    border: 1px solid rgba(220, 38, 38, 0.15);
}

.alert.success {
    display: block;
    background: rgba(16, 185, 129, 0.08);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.15);
}

/* ── 加载中 ── */
.loading {
    text-align: center;
    color: #6b7280;
    padding: 40px;
    display: none;
}

.loading.show { display: block; }

.spinner {
    display: inline-block;
    width: 28px;
    height: 28px;
    border: 2px solid rgba(255,255,255,0.05);
    border-top-color: #00d4ff;
    border-right-color: #7b68ee;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── 管理后台 ── */
.admin-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 30px 20px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.admin-header h1 {
    font-size: 22px;
    -webkit-text-fill-color: #00d4ff;
    background: none;
    animation: none;
}

.admin-header a {
    color: #6b7280;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.admin-header a:hover { color: #00d4ff; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 30px;
}

.stat-card {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    transition: all 0.3s;
}

.stat-card:hover {
    border-color: rgba(0, 180, 255, 0.15);
    box-shadow: 0 8px 24px rgba(0, 150, 255, 0.04);
}

.stat-card .number {
    font-size: 36px;
    font-weight: 800;
    background: linear-gradient(135deg, #00d4ff, #7b68ee);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-card .label {
    font-size: 13px;
    color: #6b7280;
    margin-top: 4px;
}

.table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.table-toolbar h2 {
    font-size: 18px;
    color: #d1d5db;
}

.btn-sm {
    width: auto;
    padding: 8px 16px;
    font-size: 13px;
    background: linear-gradient(135deg, #0066ff, #5b5fe8);
}

.btn-ghost-sm {
    width: auto;
    padding: 8px 16px;
    font-size: 13px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.1);
    color: #9ca3af;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
}
.btn-ghost-sm:hover {
    border-color: rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

.form-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.form-inline input, .form-inline select {
    padding: 8px 12px;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    font-size: 13px;
    color: #e0e0e0;
    outline: none;
    transition: border-color 0.2s;
}

.form-inline input:focus, .form-inline select:focus {
    border-color: rgba(0, 180, 255, 0.3);
}

.form-inline select option {
    background: #1a1a2e;
    color: #e0e0e0;
}

table {
    width: 100%;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    border-collapse: collapse;
    overflow: hidden;
}

th, td {
    padding: 12px 16px;
    text-align: left;
    font-size: 13px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

th {
    background: rgba(255,255,255,0.02);
    font-weight: 600;
    color: #6b7280;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 11px;
}

td { color: #d1d5db; }
td code {
    color: #00d4ff;
    font-family: "SF Mono", "Menlo", monospace;
    font-size: 13px;
}

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.badge.active {
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.15);
}

.badge.inactive {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.15);
}

.badge.expired {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
    border: 1px solid rgba(107, 114, 128, 0.15);
}

.action-link {
    color: #6b7280;
    text-decoration: none;
    font-size: 13px;
    margin-right: 8px;
    cursor: pointer;
    background: none;
    border: none;
    font-family: inherit;
    transition: color 0.2s;
}

.action-link:hover { color: #00d4ff; }
.action-link.danger { color: #6b7280; }
.action-link.danger:hover { color: #f87171; }

.log-section {
    margin-top: 30px;
}

.log-section h2 {
    font-size: 18px;
    margin-bottom: 12px;
    color: #d1d5db;
}

/* ── 批量操作 ── */
.batch-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 16px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    margin-bottom: 12px;
}

input[type="checkbox"] {
    accent-color: #22c55e;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* ── 编辑弹窗 ── */
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: #1a1a2e;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 28px;
    min-width: 320px;
    max-width: 90vw;
    box-shadow: 0 16px 48px rgba(0,0,0,0.5);
}

.modal-content h3 {
    color: #e0e0e0;
    font-size: 18px;
}

.modal-content .form-inline label {
    color: #9ca3af;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.modal-content .form-inline input,
.modal-content .form-inline select {
    flex: 1;
}

/* ── 登录页 ── */
.login-box {
    max-width: 380px;
    margin: 100px auto;
    background: rgba(255,255,255,0.02);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px;
    padding: 36px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.login-box h1 {
    font-size: 22px;
    margin-bottom: 28px;
    -webkit-text-fill-color: #00d4ff;
    background: none;
    animation: none;
}

.login-box input[type="text"],
.login-box input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    font-size: 15px;
    color: #e0e0e0;
    margin-bottom: 16px;
    outline: none;
    transition: border-color 0.2s;
}

.login-box input:focus {
    border-color: rgba(0, 180, 255, 0.3);
}

.login-box .btn {
    margin-top: 8px;
}

.login-box .alert.error {
    margin-bottom: 16px;
}

/* ── Toast 提示 ── */
.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(12px);
    color: #e0e0e0;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-family: "SF Mono", "Menlo", monospace;
    border: 1px solid rgba(255,255,255,0.06);
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 999;
    white-space: nowrap;
    max-width: 90vw;
    overflow: hidden;
    text-overflow: ellipsis;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── 响应式 / H5 移动端 ── */
@media (max-width: 640px) {
    .container { padding: 16px; }
    h1 { font-size: 22px; }

    .search-box { padding: 20px; border-radius: 12px; }
    .search-box input[type="text"] {
        font-size: 16px; /* 防 iOS 缩放 */
        padding: 16px;   /* 更大的触摸区域 */
    }
    .field-group { margin-bottom: 14px; }

    .btn { padding: 16px; font-size: 16px; }
    .btn-half { padding: 16px; font-size: 15px; width: 50%; }

    /* 域名结果 — 全宽触摸 */
    .domain-item {
        padding: 16px;
        font-size: 16px;
    }
    .copy-btn { font-size: 12px; padding: 4px 10px; }
    .domain-item:hover {
        padding-left: 16px; /* 移动端取消 hover 位移 */
    }
    .domain-item .copy-hint { opacity: 1; font-size: 12px; } /* 移动端常显 */

    .stat-card .number { font-size: 28px; }

    .stats-grid { grid-template-columns: 1fr; }
    .form-inline { flex-direction: column; align-items: stretch; }

    /* 分页触摸友好 */
    .pagination { gap: 4px; }
    .pagination button {
        padding: 10px 14px;
        font-size: 13px;
        min-width: 44px;
        min-height: 44px;
    }

    /* 管理后台表格 → 卡片视图 */
    .table-toolbar h2 { font-size: 16px; }
    th, td { padding: 10px 12px; font-size: 12px; }

    .login-box {
        margin: 40px 16px;
        padding: 24px;
    }
    .login-box input[type="text"],
    .login-box input[type="password"] {
        font-size: 16px;
        padding: 14px;
    }

    /* 弹窗式 Toast */
    .toast { bottom: 40px; }
}

@media (max-width: 480px) {
    h1 { font-size: 20px; letter-spacing: 1px; }
    .subtitle { font-size: 12px; letter-spacing: 2px; }
    .subtitle::before,
    .subtitle::after { content: ''; }

    .result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    /* 管理员侧：小屏 table → 水平滚动 */
    .admin-container { padding: 16px; }
    table { font-size: 12px; display: block; overflow-x: auto; white-space: nowrap; }
    th, td { padding: 8px 10px; }

    .stat-card { padding: 16px; }
    .stat-card .number { font-size: 24px; }
}
