:root {
    --bg-color: #ffffff;
    --text-color: #333;
    --card-bg: #fff;
    --card-shadow: #e4e4e7;
    --hover-bg: #f4f4f5;
    --border-color: #eee;
    --price-color: #e44d26;
    --contact-bg: #f8f8f8;
    --footer-color: #666;
    --details-arrow: #000000;
    --details-border: #ddd;
}

[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --text-color: #e0e0e0;
    --card-bg: #2d2d2d;
    --card-shadow: #0000004d;
    --hover-bg: #3d3d3d;
    --border-color: #404040;
    --price-color: #ff6b52;
    --contact-bg: #2d2d2d;
    --footer-color: #888;
    --details-arrow: #ffffff;
    --details-border: #1b1b1b;
}

body {
    font-family: SF Pro Display,SF Pro Icons,Helvetica Neue,Helvetica,Arial,sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
    min-height: calc(100vh - 120px); 
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
}

.domain-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 2.5ch;
    flex-wrap: wrap;
    transition: all 0.875s;
    justify-content: center;
}

.domain-item {
    position: relative;
    background: var(--card-bg);
    border-radius: 50px;
    box-shadow: var(--card-shadow) 0px 0px 0px 1px inset;
}

.domain-name {
    cursor: pointer;
    padding: 10px 15px;
    margin: 0;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    word-break: break-all;
}

.domain-name:hover {
    background: var(--hover-bg);
    border-radius: 50px;
    box-shadow: var(--card-shadow) 0px 0px 0px 1px inset;
}

.domain-details {
    display: none;
    position: absolute;
    background: var(--card-bg);
    padding: 15px;
    border-radius: 10px;
    border: 1px solid var(--details-border); 
    z-index: 100;
    min-width: 200px;
    left: 50%;
    transform: translateX(-50%) scale(0.95); 
    margin-top: 5px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    transform-origin: top center;
    color: var(--text-color);
}

.domain-details::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid var(--details-arrow);
}

.has-details {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.has-details::after {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #2196F3;
    border-radius: 50%;
    margin-left: 8px;
}

.price {
    color: var(--price-color);
    font-weight: bold;
    margin: 5px 0;
}

.notes {
    margin: 5px 0;
    white-space: pre-wrap;
}

.contact-info {
    text-align: center;
    padding: 0 0 20px 0;
}

.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.overlay.active {
    opacity: 1;
}

.logo-container {
    text-align: center;
    padding: 20px 0 0 0;
}

.logo-container img {
    max-height: 35px;
    width: auto;
}

.footer {
    text-align: center;
    padding: 20px 0;
    margin-top: 0px;
    color: var(--footer-color);
    font-size: 14px;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .domain-list {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .domain-details {
        position: fixed;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        width: 90%;
        max-width: 320px;
        margin: 0;
        box-sizing: border-box;
    }
    
    .domain-details::before {
        display: none;
    }
    
    .contact-info {
        padding: 15px 10px;
        margin-bottom: 15px;
        font-size: 14px;
    }
    
    h1 {
        font-size: 24px;
        margin: 10px 0 20px;
    }
    
    .logo-container {
        padding: 15px 0;
    }
    
    .logo-container img {
        max-height: 30px;
    }
    
    .footer {
        margin-top: 20px;
        padding: 15px 0;
    }
}

.domain-details.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) scale(1);
}

.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    transform: scale(1.1);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    fill: var(--text-color);
}

/* 联系方式图标 */
.contact-icons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
}

.contact-icon {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    width: 24px;
    height: 24px;
    color: var(--text-color);
    transition: color 0.3s ease;
}

.contact-icon:hover {
    color: #4CAF50;
}

.contact-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

/* QR码弹窗 */
.qr-modal {
    max-width: 400px;
}

.qr-modal img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.qr-text {
    text-align: center;
    margin-top: 15px;
    font-size: 16px;
}

/* 设置页面的二维码预览 */
.qr-upload {
    margin-top: 10px;
}

.current-qr {
    margin: 10px 0;
}

.current-qr img {
    max-width: 200px;
    height: auto;
}

.contact-settings {
    display: grid;
    gap: 20px;
    margin: 20px 0;
}

@media (max-width: 768px) {
    .contact-icons {
        gap: 15px;
    }
    
    .qr-modal {
        width: 90%;
    }
}

.contact-item {
    position: relative;
}

.qr-details {
    display: none;
    position: absolute;
    background: var(--card-bg);
    padding: 15px;
    border-radius: 10px;
    border: 1px solid var(--details-border);
    z-index: 100;
    min-width: 200px;
    left: 50%;
    transform: translateX(-50%) scale(0.95);
    margin-top: 5px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    transform-origin: top center;
    color: var(--text-color);
    box-shadow: 0 2px 10px var(--card-shadow);
}

.qr-details::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid var(--details-border);
}

.qr-details.active {
    display: block;
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) scale(1);
}

.qr-details h3 {
    margin: 0 0 10px;
    text-align: center;
    font-size: 16px;
}

.qr-details img {
    max-width: 200px;
    height: auto;
    display: block;
    margin: 0 auto;
}

.qr-details p {
    margin: 10px 0 0;
    text-align: center;
    font-size: 14px;
}

/* search input */
.search-container {
    margin: 20px auto;
    max-width: 600px;
    padding: 0 20%;
}

.search-wrapper {
    position: relative;
    width: 100%;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    fill: var(--footer-color);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 12px 20px 12px 45px;  /* 增加左内边距给图标留空间 */
    border: 1px solid var(--border-color);
    border-radius: 50px;
    font-size: 16px;
    background: var(--card-bg);
    color: var(--text-color);
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.search-input:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

.search-input:focus + .search-icon {
    fill: #4CAF50;  /* 输入框获得焦点时图标变色 */
}

.search-input::placeholder {
    color: var(--footer-color);
}

.domain-item.hidden {
    display: none;
} 