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

:root {
    --primary: #4f46e5;
    --primary-light: #818cf8;
    --primary-dark: #3730a3;
    --bg: #f8fafc;
    --bg-card: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --text-lighter: #94a3b8;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 6px -1px rgba(0,0,0,0.1);
    --radius: 8px;
    --radius-lg: 12px;
    --max-width: 1200px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-dark);
}

/* ===== Header ===== */
.site-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.header-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
}

.logo-icon {
    font-size: 1.6rem;
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 4px;
}

.nav-link {
    padding: 8px 16px;
    border-radius: var(--radius);
    color: var(--text);
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
}

.nav-link:hover {
    background: var(--bg);
    color: var(--primary);
}

.nav-dropdown {
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    padding: 8px 0;
    z-index: 100;
}

.nav-dropdown.open .dropdown-menu {
    display: block;
}

.dropdown-menu li a {
    display: block;
    padding: 8px 16px;
    color: var(--text);
}

.dropdown-menu li a:hover {
    background: var(--bg);
    color: var(--primary);
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.3s;
}

/* ===== Layout ===== */
.main-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 24px 20px;
}

.content-wrapper {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 24px;
}

.main-content {
    min-width: 0;
}

/* ===== Sidebar ===== */
.sidebar-widget {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

.widget-title {
    font-size: 1rem;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary);
}

.category-list {
    list-style: none;
}

.category-list li a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--radius);
    color: var(--text);
    transition: background 0.2s;
}

.category-list li a:hover {
    background: var(--bg);
    color: var(--primary);
}

.cat-icon {
    font-size: 1.1rem;
}

.tool-list {
    list-style: none;
}

.tool-list li a {
    display: block;
    padding: 10px 12px;
    border-radius: var(--radius);
    color: var(--text);
    transition: background 0.2s;
}

.tool-list li a:hover {
    background: var(--bg);
    color: var(--primary);
}

.random-names {
    list-style: none;
}

.random-names li a {
    display: inline-block;
    padding: 4px 12px;
    margin: 4px;
    background: var(--bg);
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--text);
    transition: background 0.2s;
}

.random-names li a:hover {
    background: var(--primary-light);
    color: #fff;
}

/* ===== Cards ===== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border);
    margin-bottom: 20px;
}

.card-title {
    font-size: 1.3rem;
    margin-bottom: 16px;
}

.section-title {
    font-size: 1.5rem;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary);
}

/* ===== Category Grid ===== */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.category-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.category-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.category-card a {
    color: var(--text);
}

.category-card .cat-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 8px;
}

.category-card h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.category-card p {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.5;
}

/* ===== Nickname List ===== */
.nickname-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.nickname-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: border-color 0.2s;
}

.nickname-item:hover {
    border-color: var(--primary-light);
}

.nickname-name {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text);
}

.nickname-name:hover {
    color: var(--primary);
}

.copy-btn {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 0.8rem;
    cursor: pointer;
    color: var(--text-light);
    transition: all 0.2s;
}

.copy-btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.copy-btn.copied {
    background: #10b981;
    color: #fff;
    border-color: #10b981;
}

/* ===== Nickname Detail ===== */
.nickname-detail {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    text-align: center;
    margin-bottom: 24px;
}

.nickname-detail .name {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 16px;
}

.nickname-detail .desc {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 24px;
}

.nickname-detail .copy-btn-lg {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    padding: 12px 32px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.nickname-detail .copy-btn-lg:hover {
    background: var(--primary-dark);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: var(--text-light);
}

.breadcrumb a {
    color: var(--text-light);
}

.breadcrumb a:hover {
    color: var(--primary);
}

.breadcrumb .separator {
    color: var(--text-lighter);
}

/* ===== Generator ===== */
.generator-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    margin-bottom: 24px;
}

.generator-controls {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.generator-controls select,
.generator-controls input {
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    background: var(--bg-card);
    color: var(--text);
}

.generator-controls select:focus,
.generator-controls input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.result-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.result-item {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.result-item .name {
    font-weight: 500;
}

/* ===== Couple ===== */
.couple-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    transition: box-shadow 0.2s;
}

.couple-card:hover {
    box-shadow: var(--shadow-lg);
}

.couple-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text);
    text-align: center;
    flex: 1;
}

.couple-heart {
    font-size: 1.5rem;
    color: #ef4444;
}

.couple-desc {
    font-size: 0.85rem;
    color: var(--text-light);
    text-align: center;
    margin-top: 8px;
}

.match-form {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    max-width: 500px;
}

.match-form input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
}

.match-form input:focus {
    outline: none;
    border-color: var(--primary);
}

/* ===== Game ===== */
.game-styles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.game-style-btn {
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}

.game-style-btn:hover,
.game-style-btn.active {
    border-color: var(--primary);
    background: rgba(79, 70, 229, 0.05);
}

.game-style-btn .style-name {
    font-weight: 600;
    margin-bottom: 4px;
}

.game-style-btn .style-desc {
    font-size: 0.8rem;
    color: var(--text-light);
}

/* ===== Clan Generator ===== */
.clan-config {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 24px;
}

.clan-config select,
.clan-config input {
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
}

.clan-result {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.clan-member {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.clan-member:last-child {
    border-bottom: none;
}

/* ===== Pagination ===== */
.pagination {
    margin-top: 24px;
    display: flex;
    justify-content: center;
}

.pagination ul {
    list-style: none;
    display: flex;
    gap: 4px;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.9rem;
    transition: all 0.2s;
}

.page-link:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.page-link.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.page-link.dots {
    border: none;
    color: var(--text-lighter);
}

/* ===== 404 ===== */
.error-page {
    text-align: center;
    padding: 80px 20px;
}

.error-page h1 {
    font-size: 6rem;
    color: var(--primary-light);
    margin-bottom: 16px;
}

.error-page p {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 24px;
}

/* ===== Footer ===== */
.site-footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    margin-top: 48px;
}

.footer-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 40px 20px;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 32px;
}

.footer-section h3 {
    font-size: 1rem;
    margin-bottom: 12px;
    color: var(--text);
}

.footer-section p {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.6;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 8px;
}

.footer-links li a {
    font-size: 0.9rem;
    color: var(--text-light);
    transition: color 0.2s;
}

.footer-links li a:hover {
    color: var(--primary);
}

.footer-bottom {
    border-top: 1px solid var(--border);
    text-align: center;
    padding: 16px 20px;
    font-size: 0.85rem;
    color: var(--text-lighter);
}

/* ===== Hero ===== */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-lg);
    padding: 48px 32px;
    color: #fff;
    text-align: center;
    margin-bottom: 32px;
}

.hero h1 {
    font-size: 2rem;
    margin-bottom: 12px;
}

.hero p {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto 24px;
}

.hero .btn {
    background: #fff;
    color: var(--primary);
}

.hero .btn:hover {
    background: rgba(255,255,255,0.9);
}

/* ===== 广告位 ===== */
.ad-slot {
    margin: 20px 0;
    padding: 12px;
    background: var(--bg-card);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    text-align: center;
    min-height: 60px;
    overflow: hidden;
}

.sidebar .ad-slot {
    padding: 10px;
    min-height: 100px;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .content-wrapper {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        order: 2;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    .main-nav {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--bg-card);
        border-bottom: 1px solid var(--border);
        padding: 16px;
    }
    
    .main-nav.active {
        display: block;
    }
    
    .main-nav ul {
        flex-direction: column;
    }
    
    .dropdown-menu {
        position: static;
        box-shadow: none;
        border: none;
        padding-left: 16px;
    }
    
    .nav-dropdown:hover .dropdown-menu,
    .nav-dropdown.open .dropdown-menu {
        display: block;
    }
    
    .footer-container {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .category-grid {
        grid-template-columns: 1fr;
    }
    
    .nickname-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .couple-card {
        flex-direction: column;
        gap: 12px;
    }
    
    .hero h1 {
        font-size: 1.5rem;
    }
    
    .nickname-detail .name {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    .nickname-grid {
        grid-template-columns: 1fr;
    }
    
    .result-list {
        grid-template-columns: 1fr;
    }
}
