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

html, body {
    width: 100%;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    font-size: 14px;
    color: #333;
    background: #f5f5f5;
    -webkit-font-smoothing: antialiased;
}

img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

input, textarea, button, select {
    font-family: inherit;
    font-size: inherit;
    border: none;
    outline: none;
    background: none;
}

button {
    cursor: pointer;
}

.hidden {
    display: none !important;
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid rgba(0,0,0,0.1);
    border-top-color: #333;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.7);
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 9999;
    animation: fadeIn 0.3s;
}

.top-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #fff;
    border-bottom: 1px solid #eee;
    z-index: 100;
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    flex-shrink: 0;
}

.logo-icon {
    font-size: 28px;
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    color: #333;
}

.header-nav {
    display: flex;
    gap: 24px;
    flex-shrink: 0;
}

.nav-link {
    font-size: 15px;
    color: #666;
    padding: 4px 0;
    cursor: pointer;
    transition: color 0.2s;
}

.nav-link:hover, .nav-link.active {
    color: #333;
    font-weight: 600;
}

.header-search {
    flex: 1;
    max-width: 480px;
}

.search-box {
    display: flex;
    align-items: center;
    background: #f5f5f5;
    border-radius: 24px;
    padding: 0 16px;
    height: 40px;
    gap: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.search-box:hover {
    background: #eee;
}

.search-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.search-input {
    flex: 1;
    height: 100%;
    font-size: 14px;
    background: transparent;
    cursor: pointer;
}

.search-ai-tag {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    flex-shrink: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.user-guest {
    display: flex;
    gap: 8px;
}

.btn-login {
    padding: 8px 20px;
    border-radius: 20px;
    border: 1px solid #ddd;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-login:hover {
    border-color: #333;
}

.btn-register {
    padding: 8px 20px;
    border-radius: 20px;
    background: #333;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: opacity 0.2s;
}

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

.user-logged {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    cursor: pointer;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-publish {
    padding: 8px 20px;
    border-radius: 20px;
    background: #333;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-publish:hover {
    opacity: 0.9;
}

.main-layout {
    max-width: 1400px;
    margin: 60px auto 0;
    display: flex;
    gap: 20px;
    padding: 20px 24px;
    min-height: calc(100vh - 60px - 50px);
}

.sidebar-left {
    width: 200px;
    flex-shrink: 0;
    position: sticky;
    top: 80px;
    height: fit-content;
}

.sidebar-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    padding: 12px 16px;
    background: #fff;
    border-radius: 8px 8px 0 0;
    border-bottom: 1px solid #f0f0f0;
}

.category-list {
    background: #fff;
    border-radius: 0 0 8px 8px;
    overflow: hidden;
}

.category-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    color: #666;
}

.category-item:hover {
    background: #f5f5f5;
    color: #333;
}

.category-item.active {
    background: #f0f0f0;
    color: #333;
    font-weight: 600;
}

.category-icon {
    margin-right: 8px;
    font-size: 16px;
}

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

.sidebar-right {
    width: 280px;
    flex-shrink: 0;
    position: sticky;
    top: 80px;
    height: fit-content;
}

.rank-card {
    background: #fff;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.rank-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}

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

.rank-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
}

.rank-item:last-child {
    border-bottom: none;
}

.rank-num {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    background: #f0f0f0;
    color: #999;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.rank-item:nth-child(1) .rank-num { background: #FFD700; color: #fff; }
.rank-item:nth-child(2) .rank-num { background: #C0C0C0; color: #fff; }
.rank-item:nth-child(3) .rank-num { background: #CD7F32; color: #fff; }

.rank-info {
    flex: 1;
    min-width: 0;
}

.rank-title-text {
    font-size: 13px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rank-meta {
    font-size: 11px;
    color: #999;
}

.ai-card {
    background: linear-gradient(135deg, #EDE7F6, #D1C4E9);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: transform 0.2s;
}

.ai-card:hover {
    transform: translateY(-2px);
}

.ai-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.ai-badge {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
}

.ai-card-title {
    font-size: 16px;
    font-weight: 600;
}

.ai-card-desc {
    font-size: 13px;
    color: #666;
    margin-bottom: 12px;
}

.ai-card-btn {
    display: inline-block;
    background: #333;
    color: #fff;
    border-radius: 16px;
    padding: 6px 16px;
    font-size: 13px;
}

.site-footer {
    background: #fff;
    border-top: 1px solid #eee;
    padding: 16px 24px;
}

.footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    font-size: 13px;
    color: #999;
}

.footer-inner a {
    color: #999;
    transition: color 0.2s;
}

.footer-inner a:hover {
    color: #333;
}

.login-modal-mask {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

.login-modal-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 16px;
    padding: 36px 32px;
    width: 400px;
    z-index: 1000;
}

.login-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 22px;
    color: #999;
    cursor: pointer;
}

.login-modal-body {
    text-align: center;
}

.login-logo {
    font-size: 40px;
    margin-bottom: 12px;
}

.login-welcome {
    display: block;
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 6px;
}

.login-subtitle {
    display: block;
    font-size: 14px;
    color: #999;
    margin-bottom: 24px;
}

.login-agreement-row {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 6px;
    margin-bottom: 16px;
    text-align: left;
}

.login-checkbox {
    width: 16px;
    height: 16px;
    border: 1px solid #ddd;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
    cursor: pointer;
}

.login-checkbox.checked {
    background: #333;
    border-color: #333;
}

.login-check-mark {
    color: #fff;
    font-size: 10px;
}

.login-agreement-text {
    font-size: 12px;
    color: #999;
}

.login-agreement-link {
    font-size: 12px;
    color: #333;
    cursor: pointer;
}

.form-input {
    width: 100%;
    height: 44px;
    background: #f5f5f5;
    border-radius: 22px;
    padding: 0 16px;
    font-size: 14px;
    margin-bottom: 12px;
}

.login-code-row {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.login-code-input {
    flex: 1;
    height: 44px;
    background: #f5f5f5;
    border-radius: 22px;
    padding: 0 16px;
    font-size: 14px;
}

.login-send-code {
    height: 44px;
    background: #333;
    color: #fff;
    border-radius: 22px;
    padding: 0 16px;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
}

.login-submit-btn {
    width: 100%;
    height: 44px;
    background: #333;
    color: #fff;
    border-radius: 22px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 12px;
}

.login-submit-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.login-guest-hint {
    font-size: 13px;
    color: #999;
    cursor: pointer;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #999;
}

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

.empty-text {
    font-size: 14px;
}
