/* Global Vars */
:root {
    --primary-color: #3b82f6; /* Blue based on images */
    --bg-color: #f7f8fa;
    --text-color: #333;
    --card-bg: #fff;
    --max-width: 560px;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
}

.app-container {
    max-width: var(--max-width);
    margin: 0 auto;
    background: #fff;
    min-height: 100vh;
    padding-bottom: 50px;
    box-shadow: 0 0 20px rgba(0,0,0,0.02);
}

/* Helper Class */
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }

/* 1. Top Bar */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 100;
}
.site-avatar {
    width: 36px;
    height: 36px;
    border-radius: 4px; /* Image 1: Square avatar */
    object-fit: cover;
}
.site-title {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}
.top-invite-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 10px;
    color: #333;
    cursor: pointer;
}
.invite-icon {
    width: 24px;
    height: 24px;
    margin-bottom: 2px;
}

/* 2. Hero Carousel */
.carousel-wrapper {
    padding: 10px 15px;
}
.layui-carousel { background: none; }
.layui-carousel > [carousel-item] > * { background: none; }
.carousel-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

/* 3. Notice Bar */
.notice-bar {
    background: #f0f4ff; /* Light blue tint */
    margin: 0 15px 15px;
    padding: 10px;
    border-radius: 20px; /* Rounded pill shape */
    display: flex;
    align-items: center;
    gap: 8px;
    color: #555;
    font-size: 13px;
}
.notice-icon-img {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}
.notice-marquee {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
}
.notice-content {
    display: inline-block;
    animation: marquee 15s linear infinite;
    padding-left: 100%;
}
@keyframes marquee { 0% { transform: translateX(0); } 100% { transform: translateX(-100%); } }

/* 4. My Website Info */
.my-site-section {
    padding: 0 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.site-info-left {
    display: flex;
    flex-direction: column;
}
.site-label { font-size: 14px; color: #666; margin-bottom: 4px; }
.site-domain { font-size: 18px; font-weight: 700; color: #1e3a8a; /* Dark blue */ }

.invite-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
}
.invite-action-icon { width: 32px; height: 32px; margin-bottom: 2px; }
.invite-text { font-size: 12px; color: #333; }

/* 5. Category Section */
.category-section {
    padding: 0 15px 20px;
}
.category-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 700;
}
.cat-icon {
    width: 20px;
    height: 20px;
    margin-right: 8px;
}

/* 6. Grid Cards */
.links-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 改为4列布局 */
    gap: 6px; /* 进一步缩小间距 */
}
.link-card {
    background: #f5f7fa;
    border-radius: 8px;
    padding: 8px 6px; /* 左右内边距更小 */
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    overflow: hidden;
    cursor: pointer;
}
.official-badge-corner {
    position: absolute;
    top: 0;
    right: 0;
    width: 32px; /* 进一步缩小徽章 */
    height: 32px;
}

.card-top {
    display: flex;
    flex-direction: column; /* 改为垂直布局 */
    align-items: center;
    width: 100%;
    margin-bottom: 8px; /* 增加底部间距 */
    gap: 4px;
}
.link-icon-img {
    width: 32px; /* 图标稍大以便识别 */
    height: 32px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}
.link-name {
    font-size: 12px; /* 增大字体使标题清晰可见 */
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    line-height: 1.3;
    margin-top: 2px;
}

.link-desc {
    font-size: 12px; /* 标题字体 */
    color: #333;
    margin-bottom: 6px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
    text-align: center;
}

.link-btn {
    background: #40a9ff;
    color: #fff;
    font-size: 10px; /* 缩小字体 */
    padding: 4px 8px; /* 缩小内边距 */
    border-radius: 10px;
    width: 90%;
    text-align: center;
    font-weight: 500;
    cursor: pointer;
}

/* Adjustments */
@media screen and (max-width: 360px) {
    .links-grid { grid-template-columns: 1fr; } 
}
