:root {
    --primary-color: #552392; /* 默认主题主色（紫色） */
    --secondary-color: #E4405F; /* 强调色 */
    --background-color: #f8f9fa; /* 默认背景色 */
}

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

body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: var(--background-color); /* 使用变量控制背景色 */
    transition: background 0.3s ease, color 0.3s ease; /* 背景和文字切换动画 */
}

/* 顶部标题栏 */
.top-bar {
    background: var(--primary-color);
    color: white;
    padding: 1rem;
    text-align: center;
    font-size: 1.2rem;
    font-weight: bold;
}

/* 主题切换按钮 */
.theme-toggle {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s;
}

.theme-toggle:hover {
    opacity: 0.9;
}

.container {
    max-width: 1170px; /* 增加30%的宽度（900px * 1.3 = 1170px） */
    margin: 2rem auto;
    padding: 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

h1 {
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2.2rem;
}

.search-box {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 1rem;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

input, select, button {
    padding: 0.8rem 1.2rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
}

#domain-input {
    width: 100%;
    max-width: 340px;
    border-color: var(--primary-color);
}

#domain-suffix {
    min-width: 120px;
    background: white;
}

#check-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    transition: background 0.3s;
}

#check-btn:hover {
    opacity: 0.9;
}

.result-card {
    padding: 1.5rem;
    border-radius: 8px;
    margin: 0 auto 2rem;
    text-align: center;
    font-size: 1.1rem;
    width: calc(100% - 4rem);
    max-width: 600px;
}

.available {
    background: #f0ebff;
    color: var(--primary-color);
}

.unavailable {
    background: #ffebee;
    color: var(--secondary-color);
}

#register-btn {
    width: 32%; /* 缩小20%后的宽度 */
    padding: 1rem;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.3s;
    margin: 0 auto;
    display: block;
}

#register-btn:hover {
    opacity: 0.9;
}

.domain-cards-container {
    margin: 2rem 0;
}

.domain-cards-container h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    text-align: center;
}

.domain-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 每行固定显示3个卡片 */
    gap: 1.5rem; /* 增加间距提升可读性 */
    justify-content: center;
    align-items: center;
    max-width: 1000px; /* 新增容器最大宽度限制 */
    margin: 0 auto; /* 居中显示 */
}

.domain-card {
    padding: 1.2rem;
    border-radius: 8px;
    border: 2px solid var(--primary-color);
    background: #f0ebff;
    text-align: center;
    transition: transform 0.2s;
    cursor: pointer;
}

.domain-card:hover {
    transform: translateY(-3px);
}

.domain-suffix {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--primary-color);
}

.domain-status {
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: inherit;
}

.status-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.status-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #4CAF50;
    animation: pulse 1.5s infinite;
    flex-shrink: 0;
    transform: translateZ(0);
    will-change: transform, opacity;
}

.alert-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #F44336;
    animation: alert-pulse 1.2s infinite;
    flex-shrink: 0;
    transform: translateZ(0);
    will-change: transform, opacity;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(76,175,80,0.4); }
    70% { box-shadow: 0 0 0 10px rgba(76,175,80,0); }
    100% { box-shadow: 0 0 0 0 rgba(76,175,80,0); }
}

@keyframes alert-pulse {
    0% { transform: scale(0.9); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0.8; }
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    position: relative;
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
}

.status-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--primary-color);
    color: white;
    text-align: center;
    padding: 0.5rem;
    font-size: 0.9rem;
    z-index: 1000;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .search-box {
        grid-template-columns: 1fr;
        max-width: 90%;
    }
    
    #domain-input {
        max-width: 100%;
    }
    
    .result-card {
        width: calc(100% - 2rem); /* 缩小15%后的宽度 */
    }

    #register-btn {
        width: 50%;
    }

    h1 {
        font-size: 1.8rem;
    }

    .domain-cards {
        grid-template-columns: 1fr; /* 移动端改为单列 */
        max-width: 400px; /* 缩小容器宽度 */
    }
}