/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f0f0f0;
    color: #333;
    line-height: 1.5;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* ===== Top Header ===== */
.top-header {
    background: #49bc85;
    border-bottom: none;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    gap: 20px;
}

.header-left .logo {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
}

.header-center {
    flex: 1;
    max-width: 500px;
}

.search-box {
    display: flex;
    border: 2px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.search-box:focus-within {
    border-color: #4caf50;
}

.search-box input {
    flex: 1;
    border: none;
    padding: 8px 12px;
    font-size: 14px;
    outline: none;
}

.search-btn {
    background: #3aa574;
    color: #fff;
    border: none;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.search-btn:hover {
    background: #2d8a61;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
}

.btn-login, .btn-register {
    padding: 6px 16px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-login {
    color: #fff;
    border: 1px solid #fff;
}

.btn-login:hover {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

.btn-register {
    background: rgba(255,255,255,0.2);
    color: #fff;
    border: 1px solid #fff;
}

.btn-register:hover {
    background: rgba(255,255,255,0.3);
}

/* ===== Top Nav ===== */
.top-nav {
    background: #f3f7f7;
    border-top: 1px solid #e0e8e8;
}

.top-nav-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 0;
    overflow-x: auto;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 500;
    color: #555;
    white-space: nowrap;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
}

.nav-link i {
    font-size: 12px;
}

.nav-link:hover {
    color: #49bc85;
    background: rgba(73,188,133,0.08);
    border-bottom-color: #49bc85;
}

.nav-link.active {
    color: #49bc85;
    background: rgba(73,188,133,0.12);
    border-bottom-color: #49bc85;
    font-weight: 600;
}

/* ===== Top Notice ===== */
.top-notice {
    background: #f7f7f7;
    color: #49bc85;
    font-size: 12px;
    padding: 6px 20px;
    text-align: center;
    border-top: 1px solid #e8e8e8;
}

.top-notice i {
    color: #25d366;
    margin-right: 4px;
}

.lang-selector {
    position: relative;
    cursor: pointer;
    font-size: 13px;
    color: #666;
}

.lang-selector > span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.lang-selector > span i {
    font-size: 10px;
}

.lang-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: none;
    min-width: 140px;
    z-index: 200;
}

.lang-selector.open .lang-dropdown {
    display: block;
}

.lang-dropdown li a {
    display: block;
    padding: 8px 14px;
    font-size: 13px;
    color: #333;
    transition: background 0.15s;
}

.lang-dropdown li a:hover {
    background: #f5f5f5;
}

/* ===== Main Layout ===== */
.main-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    min-height: calc(100vh - 100px - 120px);
}

.content {
    padding: 20px;
}

/* ===== Album Section ===== */
.album-section {
    margin-bottom: 24px;
    background: #ffffff;
    border-radius: 6px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
}

.total-items {
    font-size: 12px;
    color: #999;
}

/* ===== Album Grid: 8 per row ===== */
.album-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 10px;
}

.album-card {
    border: 1px solid #eee;
    border-radius: 4px;
    overflow: hidden;
    transition: all 0.2s;
    background: #fff;
}

.album-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
    border-color: #ddd;
}

.album-card a {
    display: block;
}

.album-thumb {
    position: relative;
    padding-top: 100%;
    background: #f5f5f5;
    overflow: hidden;
}

.album-thumb img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.album-card:hover .album-thumb img {
    transform: scale(1.05);
}

.thumb-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #ccc;
    gap: 4px;
}

.thumb-placeholder i {
    font-size: 28px;
}

/* ===== More Card ===== */
.card-more .album-thumb {
    background: #fafafa;
}

.more-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #4caf50;
    gap: 6px;
}

.more-placeholder i {
    font-size: 24px;
}

.more-placeholder span {
    font-size: 13px;
    font-weight: 500;
}

.card-more:hover .more-placeholder {
    color: #66bb6a;
}

.album-info {
    padding: 6px 8px;
}

.album-title {
    font-size: 11px;
    color: #333;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.album-count {
    font-size: 10px;
    color: #999;
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 20px 0;
    background: #fff;
    border-radius: 6px;
    margin-top: 20px;
}

.page-info {
    font-size: 13px;
    color: #999;
}

.page-controls {
    display: flex;
    gap: 4px;
}

.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    color: #333;
    transition: all 0.15s;
}

.page-btn:hover {
    border-color: #49bc85;
    color: #49bc85;
}

.page-btn.active {
    background: #49bc85;
    color: #fff;
    border-color: #49bc85;
}

.page-btn.next {
    font-size: 12px;
}

.page-jump {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #666;
}

.page-jump input {
    width: 50px;
    height: 32px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    font-size: 13px;
    outline: none;
    -moz-appearance: textfield;
}

.page-jump input::-webkit-outer-spin-button,
.page-jump input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.page-jump input:focus {
    border-color: #4caf50;
}

.page-jump .page-btn {
    cursor: pointer;
}

/* ===== Categories Layout ===== */
.categories-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.cat-sidebar {
    width: 220px;
    min-width: 220px;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    position: sticky;
    top: 110px;
    max-height: calc(100vh - 130px);
    overflow-y: auto;
}

.cat-sidebar-title {
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    border-bottom: 1px solid #eee;
}

.cat-sidebar-list {
    padding: 6px 0;
}

.cat-sidebar-list .category-item > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 16px;
    font-size: 13px;
    color: #333;
    transition: all 0.15s;
    border-left: 3px solid transparent;
}

.cat-sidebar-list .category-item > a:hover {
    background: #f1f8e9;
    color: #4caf50;
    border-left-color: #4caf50;
}

.cat-sidebar-list .category-item.active > a {
    background: #e8f5e9;
    color: #2e7d32;
    border-left-color: #4caf50;
    font-weight: 500;
}

.cat-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 130px;
}

.cat-count {
    font-size: 11px;
    color: #999;
    background: #f0f0f0;
    padding: 1px 6px;
    border-radius: 8px;
    flex-shrink: 0;
}

.category-item.active .cat-count {
    background: #c8e6c9;
    color: #2e7d32;
}

.cat-main {
    flex: 1;
    min-width: 0;
}

/* ===== Search Empty ===== */
.search-empty {
    text-align: center;
    padding: 60px 20px;
    color: #ccc;
}

.search-empty i {
    font-size: 48px;
    margin-bottom: 16px;
}

.search-empty p {
    font-size: 16px;
    color: #999;
    margin-top: 8px;
}

.search-empty .search-hint {
    font-size: 13px;
    color: #bbb;
}

/* ===== Footer ===== */
.site-footer {
    background: #49bc85;
    color: #fff;
    padding: 30px 0 20px;
    border-top: 1px solid #3aa574;
}

.footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.footer-contact {
    margin-bottom: 12px;
    font-size: 13px;
    color: #999;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.3);
    padding-top: 12px;
    font-size: 12px;
    color: rgba(255,255,255,0.85);
}

/* ===== Responsive ===== */
@media (max-width: 1200px) {
    .album-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media (max-width: 900px) {
    .album-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .header-inner {
        flex-wrap: wrap;
    }

    .header-center {
        order: 3;
        max-width: 100%;
        width: 100%;
    }

    .categories-layout {
        flex-direction: column;
    }

    .cat-sidebar {
        width: 100%;
        min-width: 100%;
        position: static;
        max-height: none;
    }

    .cat-sidebar-list {
        display: flex;
        flex-wrap: wrap;
        gap: 0;
        padding: 4px;
    }

    .cat-sidebar-list .category-item {
        flex: 0 0 auto;
    }

    .cat-sidebar-list .category-item > a {
        border-left: none;
        border-bottom: 2px solid transparent;
        padding: 6px 12px;
        border-radius: 4px;
    }

    .cat-sidebar-list .category-item.active > a {
        border-left: none;
        border-bottom-color: #4caf50;
        background: #e8f5e9;
        border-radius: 4px;
    }
}

@media (max-width: 600px) {
    .album-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }

    .album-info {
        padding: 4px 6px;
    }

    .album-title {
        font-size: 10px;
    }

    .header-right {
        gap: 8px;
    }

    .btn-login, .btn-register {
        padding: 4px 10px;
        font-size: 12px;
    }
}

@media (max-width: 400px) {
    .album-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
