: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: 20px;
    -webkit-font-smoothing: antialiased;
}

/* Layout */
.app-container {
    max-width: 1400px;
    margin: 0 auto;
}

/* 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;
    }
}

.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);
}

/* 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.upvoted {
    color: #22c55e;
}

.interaction-item.downvoted {
    color: #ef4444;
}

.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;
    }

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

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

/* 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);
}