:root {
    --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    --primary: #3b82f6;
    /* Clean Blue */
    --primary-hover: #2563eb;

    --bg-body: #f8fafc;
    /* Very light slate/gray */
    --bg-card: #ffffff;

    --text-main: #334155;
    /* Slate 700 */
    --text-heading: #0f172a;
    /* Slate 900 */
    --text-muted: #64748b;
    /* Slate 500 */
    --border-color: #e2e8f0;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.5;
    padding: 12px;
    -webkit-font-smoothing: antialiased;
}

body.homepage {
    font-size: 17px;
}

/* Layout */
.app-container {
    width: 100%;
    max-width: none;
    margin: 0;
}

/* Navigation - Minimal */
.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.user-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-login-x {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #000;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    font-family: var(--font-family);
    white-space: nowrap;
    font-size: 0.9rem;
}

.btn-login-x:hover {
    background: #333;
    transform: translateY(-2px);
}

.icon-x {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

/* 按钮样式优化 */
.btn-nav-submit {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--primary);
    color: white;
    font-weight: 500;
    text-decoration: none;
    font-size: 0.9rem;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}

.btn-nav-submit:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    padding: 4px 12px 4px 4px;
    border-radius: 30px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

/* 移动端特定适配 */
@media (max-width: 480px) {
    .main-nav {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    .user-section {
        width: 100%;
        justify-content: center;
        gap: 0.5rem;
    }

    .btn-login-x span {
        display: none;
        /* 在极小屏幕下只显示 X 图标，节省空间 */
    }

    .btn-login-x {
        padding: 8px 12px;
    }

    .global-messages-link {
        padding: 4px 6px;
    }
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.user-name {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-heading);
}

.btn-logout {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0;
    margin-left: 4px;
}

.btn-logout:hover {
    color: #ef4444;
}

.brand-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-image {
    height: 64px;
    width: auto;
    display: block;
}

.social-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: color 0.2s;
}

.social-link:hover {
    color: var(--text-heading);
}

.social-link .icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* Site Description */
.site-description {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 24px;
    padding-left: 4px;
}

/* Dashboard Card (The Table Container) */
.dashboard-card {
    background: var(--bg-card);
    border-radius: 8px;
    /* Slightly rounded */
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

/* Toolbar */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    gap: 16px;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.search-wrapper {
    position: relative;
    flex: 1;
    min-width: 240px;
    max-width: 400px;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.toolbar input {
    width: 100%;
    padding: 8px 12px 8px 36px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
    color: var(--text-heading);
    transition: all 0.2s;
    font-family: var(--font-family);
}

.toolbar input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.filters-group {
    display: flex;
    gap: 10px;
}

.select-wrapper select {
    appearance: none;
    padding: 8px 32px 8px 12px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-main);
    font-size: 0.85rem;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.25em 1.25em;
    font-family: var(--font-family);
}

.select-wrapper select:focus {
    outline: none;
    border-color: var(--primary);
}

.filter-reset {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: #fff;
    color: var(--text-muted);
    font: 500 0.85rem var(--font-family);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.filter-reset:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: #f8fbff;
}

.advanced-filters {
    border-bottom: 1px solid var(--border-color);
    background: #fbfdff;
}

.advanced-filters summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-heading);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.advanced-filters summary::-webkit-details-marker {
    display: none;
}

.advanced-filters summary::before {
    content: '＋';
    color: var(--primary);
    font-size: 1rem;
    margin-right: -4px;
}

.advanced-filters[open] summary::before {
    content: '−';
}

.active-filter-count {
    margin-left: auto;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 500;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    padding: 0 16px 14px;
}

.filter-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
}

.filter-field select,
.filter-control {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    min-height: 36px;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: #fff;
    color: var(--text-main);
    font: 400 0.82rem var(--font-family);
}

.filter-field select:focus,
.filter-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.filter-range {
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-range > span {
    flex: 0 0 auto;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 400;
}

.filter-summary {
    padding: 0 16px 13px;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.tld-filter-field {
    position: relative;
}

.common-tlds {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 3px;
}

.common-tlds button,
.selected-tld-chip {
    min-height: 30px;
    padding: 5px 9px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: #fff;
    color: var(--text-main);
    font: 600 0.78rem var(--font-family);
    cursor: pointer;
}

.pattern-multiselect {
    position: relative;
    min-width: 0;
}

.pattern-picker-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
    width: 100%;
    min-height: 36px;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: #fff;
    color: var(--text-main);
    font: 400 0.82rem var(--font-family);
    cursor: pointer;
}

.pattern-picker-button:focus-visible {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.pattern-picker-panel {
    position: absolute;
    z-index: 85;
    top: calc(100% + 5px);
    left: 0;
    box-sizing: border-box;
    width: 100%;
    min-width: 220px;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.16);
}

.pattern-picker-panel[hidden] {
    display: none;
}

.pattern-picker-help {
    margin: 0 0 7px;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 400;
}

.pattern-options {
    max-height: 280px;
    overflow-y: auto;
    border-top: 1px solid var(--border-color);
}

.pattern-option {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 6px 3px;
    border-bottom: 1px solid #edf1f5;
    color: var(--text-main);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
}

.pattern-option input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--primary);
}

.common-tlds button:hover,
.common-tlds button.is-selected,
.selected-tld-chip:hover {
    border-color: var(--primary);
    background: #eff6ff;
    color: var(--primary);
}

.tld-multiselect {
    position: relative;
    min-width: 0;
}

.tld-picker-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 40px;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: #fff;
    color: var(--text-main);
    font: 400 0.86rem var(--font-family);
    cursor: pointer;
}

.tld-picker-button:focus-visible {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.tld-picker-panel {
    position: absolute;
    z-index: 80;
    top: calc(100% + 5px);
    left: 0;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 16px 35px rgba(15, 23, 42, 0.16);
}

.tld-picker-panel[hidden] {
    display: none;
}

.tld-picker-panel > label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-muted);
    font-size: 0.76rem;
}

.toolbar .tld-picker-panel input {
    box-sizing: border-box;
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    border-radius: 5px;
    font-size: 0.86rem;
}

.tld-options {
    max-height: 250px;
    margin-top: 8px;
    overflow-y: auto;
    border-top: 1px solid var(--border-color);
}

.tld-option {
    display: grid;
    grid-template-columns: 18px 1fr auto;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 7px 3px;
    border-bottom: 1px solid #edf1f5;
    color: var(--text-main);
    cursor: pointer;
}

.toolbar .tld-option input {
    width: 16px;
    min-height: 16px;
    padding: 0;
    accent-color: var(--primary);
}

.tld-option small {
    color: var(--text-muted);
    font-weight: 400;
}

.tld-options-empty {
    padding: 16px 4px 8px;
    color: var(--text-muted);
    font-weight: 400;
    text-align: center;
}

.selected-tlds {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.selected-tld-chip {
    min-height: 26px;
    padding: 3px 8px;
    font-size: 0.72rem;
}

.domain-pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 18px;
    border-top: 1px solid var(--border-color);
    background: #fff;
    color: var(--text-muted);
    font-size: 0.84rem;
}

.domain-pagination button,
.domain-pagination select {
    min-height: 34px;
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background: #fff;
    color: var(--text-main);
    font: inherit;
}

.domain-pagination button {
    cursor: pointer;
}

.domain-pagination button:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
}

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

.domain-pagination label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Table */
.table-responsive {
    overflow-x: auto;
}

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

th {
    padding: 14px 18px;
    text-align: left;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    font-weight: 600;
    background: #f8fafc;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    user-select: none;
}

th:hover {
    color: var(--text-heading);
    background: #f1f5f9;
}

td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
    font-size: 0.95rem;
    vertical-align: middle;
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr:hover td {
    background: #f8fafc;
}

/* 推荐者样式 */
.submitter-link {
    text-decoration: none;
    display: inline-block;
    color: inherit;
    transition: opacity 0.2s;
}

.submitter-link:hover {
    opacity: 0.8;
}

.submitter-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
}

.submitter-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #e2e8f0;
}

.submitter-info {
    display: flex;
    flex-direction: column;
}

.submitter-name {
    font-weight: 500;
    color: var(--text-heading);
}

.submitter-handle {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* 互动样式 */
.interaction-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.interaction-item {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    background: none;
    border: none;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
}

.interaction-item:hover {
    background: #f1f5f9;
    color: var(--text-heading);
}

.interaction-item.watching {
    color: #f59e0b;
}

.interaction-icon {
    width: 16px;
    height: 16px;
}

/* Typography in Table */
.domain-name {
    font-weight: 500;
    color: var(--primary);
    text-decoration: none;
    font-size: 1rem;
}

.domain-name:hover {
    text-decoration: underline;
}

.price {
    font-weight: 600;
    color: var(--text-heading);
    font-size: 1rem;
    font-feature-settings: 'tnum';
}

.dotdb-number {
    font-family: monospace;
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* Badges */
.status-badge {
    padding: 4px 10px;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 500;
    display: inline-block;
    text-decoration: none;
    border: 1px solid transparent;
}

.status-available {
    background: #f0fdf4;
    /* Green 50 */
    color: #166534;
    /* Green 800 */
    border-color: #bbf7d0;
}



.status-unavailable {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}

.buy-button {
    padding: 6px 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.buy-button:hover {
    background: var(--primary-hover);
}

/* Footer */
.main-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 40px;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

.footer-links {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 4px;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-links .divider {
    color: var(--border-color);
    font-size: 0.7rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .filters-group {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .filter-reset {
        width: 100%;
    }

    .select-wrapper {
        min-width: 0;
    }

    .select-wrapper select {
        width: 100%;
    }

    .filter-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .filter-grid {
        grid-template-columns: 1fr;
    }

    .filter-date-range {
        grid-column: auto;
    }
}

/* Loading */
.loading-spinner {
    border: 2px solid #e2e8f0;
    border-top: 2px solid var(--primary);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 0.8s linear infinite;
    margin: 20px auto;
}

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

/* Domain Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: #fff;
    width: 90%;
    max-width: 450px;
    border-radius: 16px;
    padding: 32px 24px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    position: relative;
    transform: translateY(10px);
    transition: transform 0.2s;
    text-align: center;
}

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

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--text-heading);
    background: #f1f5f9;
    border-radius: 50%;
}

.modal-domain-name {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 8px;
    line-height: 1.2;
}

.modal-price {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 24px;
}

.modal-btn-buy {
    background: var(--primary);
    color: white;
    width: 100%;
    padding: 16px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1.1rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s, transform 0.1s;
    margin-bottom: 20px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.4);
}

.modal-btn-buy:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 8px -1px rgba(59, 130, 246, 0.5);
}

.modal-btn-feedback {
    background: #f8fafc;
    border: 1px solid transparent;
    color: #64748b;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    opacity: 1;
    font-weight: 500;
    transition: all 0.2s;
}

.modal-btn-feedback:hover {
    color: #ef4444;
    background: #fef2f2;
    border-color: #fee2e2;
    text-decoration: none;
}

.modal-feedback-form {
    margin-top: 16px;
    text-align: left;
    background: #f8fafc;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.hidden {
    display: none !important;
}

.feedback-option {
    padding: 8px;
    border-radius: 6px;
    transition: background 0.1s;
}

.feedback-option:hover {
    background: #e2e8f0;
}

.feedback-option input[type="radio"] {
    accent-color: var(--primary);
    transform: scale(1.1);
}

.modal-btn-submit {
    background: #0f172a;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
}

/* New Table Column */
.col-clicks {
    width: 90px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 5000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    background: #fff;
    border-radius: 8px;
    padding: 12px 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border-left: 4px solid var(--primary);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease-out;
    min-width: 250px;
    max-width: 400px;
    font-size: 0.95rem;
    color: var(--text-heading);
}

.toast-error {
    border-left-color: #ef4444;
}

.toast-success {
    border-left-color: #22c55e;
}

.toast-info {
    border-left-color: #3b82f6;
}

/* Login Prompt Modal */
.login-modal-content {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    width: 90%;
    max-width: 400px;
    border-radius: 20px;
    padding: 40px 32px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative;
    text-align: center;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .login-modal-content {
    transform: scale(1) translateY(0);
}

.login-modal-icon {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    box-shadow: 0 8px 16px -4px rgba(59, 130, 246, 0.4);
}

.login-modal-icon svg {
    width: 36px;
    height: 36px;
    color: white;
}

.login-modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 12px;
}

.login-modal-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 24px;
    line-height: 1.6;
}

.login-modal-features {
    background: #f1f5f9;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 28px;
    text-align: left;
}

.login-modal-features ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.login-modal-features li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    color: var(--text-main);
    font-size: 0.9rem;
}

.login-modal-features li:not(:last-child) {
    border-bottom: 1px solid #e2e8f0;
}

.login-modal-features .feature-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: #22c55e;
}

.btn-login-x-large {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #000;
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-family);
    font-size: 1rem;
    width: 100%;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

.btn-login-x-large:hover {
    background: #1a1a1a;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px -2px rgba(0, 0, 0, 0.3);
}

.btn-login-x-large .icon-x {
    width: 18px;
    height: 18px;
}

.login-modal-skip {
    display: inline-block;
    margin-top: 16px;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s;
    background: none;
    border: none;
    font-family: var(--font-family);
}

.login-modal-skip:hover {
    color: var(--text-heading);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Generic Modal (Alert/Confirm/Prompt) */
.g-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    backdrop-filter: blur(2px);
}

.g-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.g-modal-box {
    background: white;
    width: 90%;
    max-width: 400px;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    transform: scale(0.95);
    transition: transform 0.2s;
}

.g-modal-overlay.active .g-modal-box {
    transform: scale(1);
}

.g-modal-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 24px;
    line-height: title;
}

.g-modal-body {
    margin-bottom: 24px;
    color: var(--text-main);
}

.g-modal-input {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-top: 8px;
    font-family: inherit;
    font-size: 1rem;
}

.g-modal-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.g-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.g-btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.g-btn-cancel {
    background: #f1f5f9;
    color: var(--text-muted);
}

.g-btn-cancel:hover {
    background: #e2e8f0;
    color: var(--text-heading);
}

.g-btn-confirm {
    background: #0f172a;
    color: white;
}

.g-btn-confirm:hover {
    background: #334155;
    transform: translateY(-1px);
}

/* Wholesale marketplace */
.marketplace-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.75fr);
    gap: 32px;
    align-items: stretch;
    margin-bottom: 24px;
    padding: 38px;
    border: 1px solid #dbeafe;
    border-radius: 18px;
    background:
        radial-gradient(circle at 92% 10%, rgba(96, 165, 250, 0.22), transparent 34%),
        linear-gradient(135deg, #eff6ff 0%, #ffffff 56%, #f8fafc 100%);
    box-shadow: var(--shadow-sm);
}

.global-messages-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 32px;
    padding: 4px 6px;
    border: 0;
    border-radius: 8px;
    color: var(--text-muted);
    background: transparent;
    box-shadow: none;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s;
}

.global-messages-link:hover,
.global-messages-link.has-unread {
    color: #1d4ed8;
    background: #eff6ff;
}

.global-messages-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.global-messages-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 12px;
    padding: 0;
    color: var(--text-muted);
    background: transparent;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1;
}

.global-messages-link.has-unread .global-messages-badge {
    color: #ef4444;
}

.marketplace-hero-copy {
    max-width: 760px;
}

.marketplace-eyebrow {
    display: inline-block;
    margin-bottom: 12px;
    color: #1d4ed8;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
}

.marketplace-hero h1 {
    max-width: 720px;
    color: var(--text-heading);
    font-size: clamp(2rem, 4vw, 3.45rem);
    line-height: 1.04;
    letter-spacing: -0.045em;
}

.marketplace-hero p {
    max-width: 680px;
    margin-top: 16px;
    color: var(--text-muted);
    font-size: 1.05rem;
}

.marketplace-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.marketplace-primary-action,
.marketplace-secondary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 18px;
    border-radius: 9px;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s, background 0.2s, border-color 0.2s;
}

.marketplace-primary-action {
    color: #fff;
    background: var(--primary);
}

.marketplace-primary-action:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.marketplace-secondary-action {
    color: var(--text-heading);
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.8);
}

.marketplace-secondary-action:hover {
    border-color: #93c5fd;
    background: #fff;
}

.marketplace-stats {
    display: grid;
    gap: 10px;
}

.marketplace-stats div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 20px;
    border: 1px solid rgba(147, 197, 253, 0.55);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.78);
}

.marketplace-stats strong {
    color: var(--text-heading);
    font-size: 1.55rem;
}

.marketplace-stats span {
    color: var(--text-muted);
    font-size: 0.82rem;
    text-align: right;
}

.verified-listing-label {
    color: #047857;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.unverified-listing-label {
    color: #64748b;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.synthetic-listing-label {
    color: #b45309;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.modal-seller-card {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: -6px 0 18px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: #f8fafc;
    text-align: left;
}

.modal-seller-avatar {
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    border-radius: 50%;
    object-fit: cover;
    background: #e2e8f0;
}

.modal-seller-card strong,
.modal-seller-card span {
    display: block;
}

.modal-seller-card strong {
    color: var(--text-heading);
}

.modal-seller-card span {
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.marketplace-empty-state {
    padding: 56px 24px !important;
    color: var(--text-muted);
    text-align: center;
}

.marketplace-empty-state strong {
    display: block;
    max-width: 560px;
    margin: 0 auto 16px;
    color: var(--text-heading);
    font-size: 1.05rem;
}

.marketplace-empty-state button {
    padding: 10px 16px;
    color: #fff;
    border: 0;
    border-radius: 8px;
    background: var(--primary);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

@media (max-width: 850px) {
    .marketplace-hero {
        grid-template-columns: 1fr;
        padding: 28px 24px;
    }

    .marketplace-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .marketplace-stats div {
        display: block;
        padding: 14px;
    }

    .marketplace-stats span {
        display: block;
        margin-top: 3px;
        text-align: left;
    }
}

@media (max-width: 560px) {
    .marketplace-hero {
        padding: 24px 18px;
    }

    .marketplace-hero h1 {
        font-size: 2.1rem;
    }

    .marketplace-stats {
        grid-template-columns: 1fr;
    }

    .marketplace-stats div {
        display: flex;
    }

    .marketplace-stats span {
        display: inline;
        margin-top: 0;
        text-align: right;
    }
}

/* Flat homepage layout */
.homepage {
    --bg-body: #f3f6fa;
    --border-color: #d9e1eb;
    --text-main: #334155;
    --text-muted: #64748b;
}

.homepage .app-container {
    max-width: none;
}

.homepage .main-nav {
    padding: 2px 0 16px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--border-color);
}

.homepage .logo-image {
    height: 56px;
}

.homepage .marketplace-hero {
    margin-bottom: 18px;
    padding: 30px 32px;
    border: 1px solid var(--border-color);
    border-radius: 0;
    background: #fff;
    box-shadow: none;
}

.homepage .marketplace-hero h1 {
    font-size: clamp(2.1rem, 4vw, 3.6rem);
}

.homepage .marketplace-hero p {
    font-size: 1.1rem;
}

.homepage .marketplace-primary-action,
.homepage .marketplace-secondary-action {
    min-height: 46px;
    border-radius: 4px;
    font-size: 1rem;
}

.homepage .marketplace-stats {
    gap: 0;
    border-left: 1px solid var(--border-color);
}

.homepage .marketplace-stats div {
    padding: 17px 20px;
    border: 0;
    border-bottom: 1px solid var(--border-color);
    border-radius: 0;
    background: transparent;
}

.homepage .marketplace-stats div:last-child {
    border-bottom: 0;
}

.homepage .marketplace-stats strong {
    font-size: 1.7rem;
}

.homepage .marketplace-stats span {
    font-size: 0.9rem;
}

.homepage .marketplace-workspace {
    display: grid;
    grid-template-columns: minmax(250px, 292px) minmax(0, 1fr);
    gap: 0;
    align-items: start;
}

.homepage .filter-sidebar,
.homepage .inventory-panel {
    min-width: 0;
    border: 1px solid var(--border-color);
    border-radius: 0;
    background: #fff;
    box-shadow: none;
}

.homepage .filter-sidebar {
    position: sticky;
    top: 18px;
    overflow: clip;
}

@media (min-width: 761px) {
    .homepage .filter-sidebar {
        border-right: 0;
    }
}

.homepage .filter-sidebar-heading,
.homepage .inventory-panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.homepage .filter-sidebar-heading h2,
.homepage .inventory-panel-heading h2 {
    margin-top: 4px;
    color: var(--text-heading);
    font-size: 1.35rem;
    line-height: 1.2;
}

.homepage .filter-sidebar-kicker,
.homepage .inventory-panel-kicker {
    color: var(--primary);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
}

.homepage .filter-reset {
    min-height: auto;
    padding: 4px 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--primary);
    font-size: 0.9rem;
}

.homepage .filter-reset:hover {
    border-color: transparent;
    background: transparent;
    color: var(--primary-hover);
    text-decoration: underline;
}

.homepage .toolbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border-color);
}

.homepage .search-label {
    color: var(--text-muted);
    font-size: 0.84rem;
    font-weight: 600;
}

.homepage .search-wrapper {
    width: 100%;
    min-width: 0;
    max-width: none;
}

.homepage .search-icon {
    width: 18px;
    height: 18px;
}

.homepage .toolbar input {
    min-height: 44px;
    padding: 9px 12px 9px 40px;
    border-radius: 0;
    background: #f7f9fc;
    font-size: 0.98rem;
}

.homepage .toolbar .tld-picker-panel input {
    min-height: 38px;
    padding: 8px 10px;
    border-radius: 5px;
    font-size: 0.86rem;
}

.homepage .toolbar .tld-option input {
    width: 16px;
    min-height: 16px;
    padding: 0;
}

.homepage .filters-group {
    display: block;
}

.homepage .select-wrapper select {
    width: 100%;
    min-height: 44px;
    border-radius: 0;
    background-color: #f7f9fc;
    font-size: 0.95rem;
}

.homepage .advanced-filters {
    border-bottom: 0;
    background: #fff;
}

.homepage .advanced-filters summary {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
}

.homepage .active-filter-count {
    font-size: 0.84rem;
}

.homepage .filter-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 16px 20px 18px;
}

.homepage .filter-field {
    gap: 6px;
    font-size: 0.84rem;
}

.homepage .filter-field select,
.homepage .filter-control {
    min-height: 40px;
    padding: 8px 10px;
    border-radius: 0;
    background: #f7f9fc;
    font-size: 0.9rem;
}

.homepage .pattern-picker-button {
    min-height: 40px;
    border-radius: 0;
    background: #f7f9fc;
    font-size: 0.9rem;
}

.homepage .pattern-picker-panel {
    border-radius: 0;
}

.homepage .filter-summary {
    padding: 0 20px 20px;
    font-size: 0.86rem;
}

.homepage .inventory-panel {
    overflow: hidden;
}

.homepage .inventory-panel-heading {
    align-items: center;
    padding: 20px 24px;
}

.homepage .inventory-panel-note {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: right;
}

.homepage table {
    min-width: 860px;
}

.homepage th {
    padding: 15px 18px;
    background: #f7f9fc;
    font-size: 0.84rem;
}

.homepage td {
    padding: 16px 18px;
    font-size: 1rem;
}

.homepage tbody tr:hover td {
    background: #f7f9fc;
}

.homepage .domain-name,
.homepage .price {
    font-size: 1.06rem;
}

.homepage .submitter-cell {
    font-size: 0.92rem;
}

.homepage .submitter-handle,
.homepage .dotdb-number {
    font-size: 0.84rem;
}

.homepage .main-footer {
    margin-top: 30px;
    padding-top: 18px;
    font-size: 0.88rem;
}

@media (max-width: 980px) {
    .homepage .marketplace-workspace {
        grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
    }

    .homepage .marketplace-hero {
        grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
    }
}

@media (max-width: 760px) {
    .homepage .marketplace-workspace {
        grid-template-columns: 1fr;
    }

    .homepage .marketplace-hero {
        grid-template-columns: 1fr;
    }

    .homepage .filter-sidebar {
        position: static;
    }

    .homepage .inventory-panel-heading {
        padding: 18px 20px;
    }
}

@media (max-width: 560px) {
    body.homepage {
        padding: 12px;
        font-size: 16px;
    }

    .homepage .main-nav {
        margin-bottom: 14px;
    }

    .homepage .marketplace-hero {
        padding: 24px 20px;
    }

    .homepage .marketplace-hero p {
        font-size: 1rem;
    }

    .homepage .inventory-panel-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }

    .homepage .inventory-panel-note {
        text-align: left;
    }
}

/* Private member inventory navigation and auth gate */
.member-gate-pending body {
    visibility: hidden;
}

.homepage .marketplace-main-nav {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 32px;
}

.primary-nav-links {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(16px, 2.4vw, 34px);
}

.primary-nav-links a {
    color: var(--text-main);
    font-size: 0.83rem;
    font-weight: 600;
    letter-spacing: 0.025em;
    text-decoration: none;
    text-transform: uppercase;
    white-space: nowrap;
}

.primary-nav-links a:hover,
.primary-nav-links a[aria-current="page"] {
    color: var(--primary);
}

@media (max-width: 980px) {
    .homepage .marketplace-main-nav {
        grid-template-columns: auto 1fr;
    }

    .homepage .marketplace-main-nav .primary-nav-links {
        grid-column: 1 / -1;
        grid-row: 2;
        justify-content: flex-start;
        overflow-x: auto;
        padding-top: 14px;
        border-top: 1px solid var(--border-color);
    }
}

@media (max-width: 560px) {
    .homepage .marketplace-main-nav {
        display: grid;
        grid-template-columns: 1fr;
        align-items: center;
    }

    .homepage .marketplace-main-nav .primary-nav-links {
        width: 100%;
        grid-column: auto;
        grid-row: auto;
    }
}
