/* 全局重置与基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
    background-color: #fff;
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: #333;
    font-size: 13px;
    transition: color 0.2s;
}

a:hover {
    color: #315efb;
}

/* 顶部导航栏 */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 24px;
    height: 60px;
}

.nav-left {
    display: flex;
    gap: 20px;
}

.nav-right {
    display: flex;
    gap: 20px;
    align-items: center;
}

.login-btn {
    background-color: #4e6ef2;
    color: white !important;
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
}

/* 暗色模式切换按钮 */
.theme-toggle {
    background: none;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    padding: 5px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: all 0.2s;
}

.theme-toggle:hover {
    border-color: #4e6ef2;
    color: #4e6ef2;
}

.theme-toggle .icon-moon {
    display: none;
}

body.dark .theme-toggle .icon-sun {
    display: none;
}

body.dark .theme-toggle .icon-moon {
    display: block;
}

/* 暗色模式样式 */
body.dark {
    background-color: #1e2030;
    color: #d0d2e0;
}

body.dark .top-nav {
    background: #252840;
    border-bottom-color: #32365a;
}

body.dark .nav-left a {
    color: #a0a4c0;
}

body.dark .nav-left a:hover {
    color: #7b93f5;
}

body.dark .login-btn {
    background-color: #5a78f5;
}

body.dark .theme-toggle {
    border-color: #3a3e60;
    color: #a0a4c0;
}

body.dark .theme-toggle:hover {
    border-color: #7b93f5;
    color: #7b93f5;
}

body.dark .logo-text {
    color: #d0d2e0;
}

body.dark .search-wrapper {
    border-color: #3a3e60;
    background: #252840;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

body.dark .search-wrapper:hover,
body.dark .search-wrapper:focus-within {
    border-color: #5a78f5;
    box-shadow: 0 4px 16px rgba(90, 120, 245, 0.15);
}

body.dark .search-input {
    color: #d0d2e0;
}

body.dark .search-input::placeholder {
    color: #7a7e9a;
}

body.dark .search-disabled {
    opacity: 0.6;
}

body.dark .search-disabled .search-input {
    color: #7a7e9a;
}

body.dark #autocomplete-results {
    background: #252840;
    border-color: #3a3e60;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

body.dark .suggest-item {
    color: #a0a4c0;
}

body.dark .suggest-item:hover {
    background: #2d3050;
    color: #7b93f5;
}

body.dark .hot-search-section {
    color: #d0d2e0;
}

body.dark .hot-card {
    background: #252840;
    border-color: #32365a;
}

body.dark .hot-card:hover {
    border-color: #3a3e60;
}

body.dark .hot-card-title {
    color: #d0d2e0;
    border-bottom-color: #32365a;
}

body.dark .hot-item-link {
    color: #8a8eaa;
}

body.dark .hot-item-link:hover {
    color: #7b93f5;
    background: rgba(90, 120, 245, 0.08);
}

body.dark .rank {
    color: #7a7e9a;
}

body.dark .rank-1 {
    color: #ff7b7b;
}

body.dark .rank-2 {
    color: #ffb36b;
}

body.dark .rank-3 {
    color: #ffe066;
}

body.dark .tag-hot {
    background: rgba(255, 100, 100, 0.12);
    color: #ff7b7b;
}

body.dark .tag-new {
    background: rgba(90, 120, 245, 0.12);
    color: #7b93f5;
}

body.dark .friend-links-section {
    border-top-color: #32365a;
}

body.dark .friend-title {
    color: #7a7e9a;
}

body.dark .friend-list a {
    color: #8a8eaa;
    background: #252840;
}

body.dark .friend-list a:hover {
    background: rgba(90, 120, 245, 0.1);
    color: #7b93f5;
}

body.dark .blog-footer {
    border-top-color: #32365a;
    color: #7a7e9a;
}

/* 验证码弹窗暗色 */
body.dark #captcha-modal {
    background: rgba(0, 0, 0, 0.5);
}

body.dark #captcha-content {
    background: #252840;
    border-color: #3a3e60;
    color: #d0d2e0;
}

body.dark #captcha-content label {
    color: #a0a4c0;
}

body.dark #captcha-content input {
    background: #1e2030;
    border-color: #3a3e60;
    color: #d0d2e0;
}

body.dark #captcha-content button {
    background: #5a78f5;
}

/* 错误弹窗暗色 */
body.dark #error-modal .modal-content {
    background: #252840;
    border-color: #3a3e60;
    color: #d0d2e0;
}

body.dark #error-modal h2 {
    color: #d0d2e0;
}

body.dark #error-modal p {
    color: #a0a4c0;
}

/* 加载动画暗色 */
body.dark #loading-overlay {
    background: rgba(30, 32, 48, 0.98);
}

body.dark .orb-ring {
    border-color: #32365a;
    border-top-color: #5a78f5;
    border-right-color: #7b93f5;
}

body.dark .orb-core {
    background: linear-gradient(135deg, #252840, #2d3050);
}

body.dark #loading-text {
    color: #d0d2e0;
}

body.dark .step-icon {
    background: #32365a;
}

body.dark .step-text {
    color: #7a7e9a;
}

body.dark .loading-step.step-active .step-text {
    color: #d0d2e0;
}

body.dark .loading-step.step-done .step-text {
    color: #7b93f5;
}

.search-disabled {
    opacity: 0.75;
    cursor: pointer;
}

.search-disabled .search-input {
    color: #999;
    cursor: pointer;
}

.search-btn-login {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #4e6ef2, #637bff);
    border: none;
    border-radius: 10px;
    color: white !important;
    font-size: 15px;
    cursor: pointer;
    font-weight: 500;
    letter-spacing: 1px;
    transition: all 0.25s;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(78, 110, 242, 0.3);
}

.search-btn-login:hover {
    background: linear-gradient(135deg, #3d5de0, #5268e6);
    color: white !important;
    box-shadow: 0 4px 12px rgba(78, 110, 242, 0.4);
    transform: translateY(-1px);
}

.login-btn:hover {
    background-color: #4662d9;
    color: white !important;
}

/* 主体内容 */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 60px;
}

/* Logo */
.logo {
    width: 270px;
    height: 129px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-text {
    font-size: 48px;
    font-weight: bold;
    color: #4e6ef2;
    letter-spacing: 2px;
}

.logo-img {
    max-height: 129px;
    width: auto;
}

/* 搜索框样式 */
.search-wrapper {
    width: 680px;
    height: 90px;
    border: 1px solid #c4cfe0;
    border-radius: 16px;
    background: #fff;
    padding: 12px 16px;
    position: relative;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.search-wrapper:hover, .search-wrapper:focus-within {
    border-color: #4e6ef2;
    box-shadow: 0 4px 16px rgba(78, 110, 242, 0.12);
}

.search-input {
    width: 100%;
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    background: transparent;
    color: #333;
    resize: none;
    line-height: 1.6;
    padding: 4px 0;
    font-family: inherit;
    padding-right: 110px;
    padding-bottom: 30px;
}

.search-input::placeholder {
    color: #999;
}

.search-btn {
    position: absolute;
    right: 16px;
    bottom: 16px;
    width: 44px;
    height: 40px;
    background: linear-gradient(135deg, #4e6ef2, #637bff);
    border: none;
    border-radius: 10px;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(78, 110, 242, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-btn:hover {
    background: linear-gradient(90deg, #4662d9, #566ef0);
    box-shadow: 0 4px 8px rgba(78, 110, 242, 0.4);
    transform: translateY(-1px);
}

.search-btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 3px rgba(78, 110, 242, 0.3);
}

/* 底部热搜区域 */
.hot-search-section {
    width: 680px;
    margin-top: 24px;
}

.hot-cards {
    display: flex;
    gap: 12px;
    width: 100%;
}

.hot-card {
    flex: 1;
    min-width: 0;
    background: #fff;
    border-radius: 10px;
    padding: 14px 16px;
    border: 1px solid #f0f2f5;
    transition: border-color 0.2s;
    overflow: hidden;
}

.hot-card:hover {
    border-color: #dce3f0;
}

.hot-card-title {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f5f5f5;
    display: flex;
    align-items: center;
    gap: 6px;
}

.hot-column {
    width: 100%;
    list-style: none;
}

.hot-item {
    list-style: none;
}

.hot-item-link {
    display: flex;
    align-items: center;
    height: 32px;
    color: #555;
    cursor: pointer;
    font-size: 13px;
    border-radius: 6px;
    padding: 0 6px;
    margin: 0 -6px;
    transition: background-color 0.15s, color 0.15s;
    text-decoration: none;
}

.hot-item-link:hover {
    color: #315efb;
    background-color: #f5f7fa;
}

.rank {
    width: 18px;
    margin-right: 8px;
    font-style: normal;
    font-weight: bold;
    color: #999;
    font-size: 14px;
    text-align: center;
}

.rank-1 { color: #f54545; }
.rank-2 { color: #ff8547; }
.rank-3 { color: #ffac38; }

.top-icon {
    color: #f54545;
    font-weight: bold;
    margin-right: 8px;
    font-size: 12px;
    width: 18px;
    text-align: center;
}

.tag {
    font-size: 10px;
    padding: 1px 4px;
    border-radius: 3px;
    margin-left: 8px;
    color: white;
    font-weight: normal;
    line-height: 1.2;
    transform: scale(0.9);
    transform-origin: left center;
}

.tag-hot {
    background-color: #ff6600;
}

.tag-new {
    background-color: #ff4d4f;
}

.hot-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

/* 友情链接 */
.friend-links-section {
    width: 680px;
    margin-top: 20px;
    margin-bottom: 40px;
    padding-top: 24px;
    border-top: 1px solid #f0f0f0;
}

.friend-title {
    font-size: 14px;
    color: #999;
    margin-bottom: 16px;
    font-weight: normal;
}

.friend-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.friend-list a {
    font-size: 13px;
    color: #666;
    padding: 6px 12px;
    border-radius: 6px;
    background: #f5f7fa;
    transition: all 0.2s;
}

.friend-list a:hover {
    background: #eef2ff;
    color: #315efb;
}

/* 页脚 */
.blog-footer {
    width: 100%;
    padding: 20px 0;
    text-align: center;
    font-size: 12px;
    color: #999;
    border-top: 1px solid #f0f0f0;
    margin-top: auto;
}

.footer-bottom {
    max-width: 680px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 加载动画 */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.5s ease;
}

#loading-overlay.show {
    opacity: 1;
}

/* 旋转球体 */
.loading-visual {
    margin-bottom: 48px;
}

.loading-orb {
    width: 100px;
    height: 100px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.orb-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid #eef0f8;
    border-top-color: #4e6ef2;
    border-right-color: #637bff;
    animation: orb-spin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

@keyframes orb-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.orb-core {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f0f4ff 0%, #e0e8ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: core-breathe 2.5s ease-in-out infinite;
}

@keyframes core-breathe {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(78, 110, 242, 0.1); }
    50% { transform: scale(1.05); box-shadow: 0 0 20px 4px rgba(78, 110, 242, 0.08); }
}

/* 文字和步骤区域 */
.loading-info {
    text-align: center;
    max-width: 280px;
}

#loading-text {
    color: #1a1a2e;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 36px;
    letter-spacing: 1px;
    min-height: 28px;
}

#loading-text::after {
    content: '';
    animation: text-dots 1.5s steps(4, end) infinite;
}

@keyframes text-dots {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
    100% { content: ''; }
}

#loading-steps {
    display: flex;
    flex-direction: column;
    gap: 16px;
    text-align: left;
}

.loading-step {
    display: flex;
    align-items: center;
    gap: 14px;
    opacity: 0;
    transform: translateY(8px);
    transition: all 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.loading-step.step-visible {
    opacity: 0.3;
    transform: translateY(0);
}

.loading-step.step-active {
    opacity: 1;
    transform: translateY(0);
}

.loading-step.step-done {
    opacity: 0.55;
    transform: translateY(0);
}

.step-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
    transition: all 0.5s cubic-bezier(0.22, 1, 0.36, 1);
    background: #eef0f5;
}

.loading-step.step-active .step-icon {
    background: #4e6ef2;
    box-shadow: 0 0 0 4px rgba(78, 110, 242, 0.15);
    animation: active-glow 2s ease-in-out infinite;
}

@keyframes active-glow {
    0%, 100% { box-shadow: 0 0 0 4px rgba(78, 110, 242, 0.15); }
    50% { box-shadow: 0 0 0 8px rgba(78, 110, 242, 0.08); }
}

.loading-step.step-active .step-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: dot-breathe 1.2s ease-in-out infinite;
}

@keyframes dot-breathe {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    50% { transform: translate(-50%, -50%) scale(0.6); opacity: 0.6; }
}

.loading-step.step-done .step-icon {
    background: #4e6ef2;
    box-shadow: none;
    animation: none;
}

.loading-step.step-done .step-icon::after {
    content: '';
    position: absolute;
    top: 5px;
    left: 8px;
    width: 6px;
    height: 10px;
    border: 2.5px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
    animation: check-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes check-pop {
    0% { transform: rotate(45deg) scale(0); opacity: 0; }
    100% { transform: rotate(45deg) scale(1); opacity: 1; }
}

.step-text {
    font-size: 14px;
    color: #aaa;
    transition: all 0.5s ease;
    letter-spacing: 0.5px;
}

.loading-step.step-active .step-text {
    color: #1a1a2e;
    font-weight: 500;
    font-size: 15px;
}

.loading-step.step-done .step-text {
    color: #4e6ef2;
}

/* 验证码弹窗 */
#captcha-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.2s ease;
}

#captcha-modal.modal-show {
    opacity: 1;
}

#captcha-content {
    background: white;
    padding: 36px 32px 32px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    text-align: center;
    max-width: 340px;
    width: 90%;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

#captcha-modal.modal-show #captcha-content {
    transform: scale(1) translateY(0);
}

#captcha-content label {
    display: block;
    font-size: 17px;
    font-weight: 600;
    color: #333;
    margin-bottom: 24px;
}

.captcha-input-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

#verifyCodeInput {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e8e8e8;
    border-radius: 10px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fafafa;
    box-sizing: border-box;
}

#verifyCodeInput:focus {
    border-color: #4e6ef2;
    box-shadow: 0 0 0 3px rgba(78, 110, 242, 0.1);
    background: #fff;
}

#captcha-content img {
    height: 50px;
    max-width: 100%;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid #f0f0f0;
    transition: border-color 0.2s;
    object-fit: contain;
}

#captcha-content img:hover {
    border-color: #4e6ef2;
}

#captcha-content button {
    width: 100%;
    padding: 13px;
    background: #4e6ef2;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    letter-spacing: 1px;
}

#captcha-content button:hover {
    background: #4662d9;
}

#captcha-content button:active {
    transform: scale(0.98);
}

#captcha-content button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 错误弹窗 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.modal.modal-show {
    opacity: 1;
}

.modal-content {
    background: white;
    padding: 36px 32px 32px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    text-align: center;
    max-width: 360px;
    width: 90%;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal.modal-show .modal-content {
    transform: scale(1) translateY(0);
}

#error-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

#error-modal-message {
    font-size: 14px;
    color: #666;
    margin-bottom: 28px;
    line-height: 1.6;
}

#close-error-modal {
    padding: 12px 32px;
    background: #4e6ef2;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    letter-spacing: 1px;
}

#close-error-modal:hover {
    background: #4662d9;
}

#close-error-modal:active {
    transform: scale(0.98);
}

/* 搜索建议下拉 */
#autocomplete-results {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e8edf5;
    border-top: none;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    z-index: 100;
    max-height: 320px;
    overflow-y: auto;
}

#autocomplete-results.show {
    display: block;
}

#suggest-scroll {
    padding: 4px 0;
}

.suggest-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: background 0.15s;
}

.suggest-item:hover {
    background: #f5f7fa;
    color: #315efb;
}

.suggest-item::before {
    content: '';
    width: 14px;
    height: 14px;
    margin-right: 10px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") no-repeat center;
    flex-shrink: 0;
}

/* 搜索框有建议时圆角调整 */
.search-wrapper.has-suggestions {
    border-radius: 16px 16px 0 0;
}

/* 响应式 */
@media (max-width: 768px) {
    .top-nav {
        padding: 0 12px;
        height: 44px;
    }
    .nav-left {
        display: none;
    }
    .logo {
        width: 180px;
        height: 86px;
        margin-top: 16px;
    }
    .logo-text {
        font-size: 32px;
    }
    .search-wrapper {
        width: 94%;
        height: 80px;
        padding: 10px 12px;
    }
    .search-input {
        font-size: 15px;
        padding-right: 50px;
    }
    .search-btn {
        right: 10px;
        bottom: 10px;
        width: 36px;
        height: 34px;
        border-radius: 8px;
    }
    .search-btn svg {
        width: 16px;
        height: 16px;
    }
    .search-btn-login {
        width: auto;
        height: 34px;
        padding: 0 14px;
        font-size: 13px;
    }
    .hot-search-section {
        width: 94%;
        margin-top: 20px;
    }
    .hot-cards {
        flex-direction: column;
        gap: 10px;
    }
    .hot-card {
        padding: 12px 14px;
    }
    .hot-item-link {
        height: 30px;
        font-size: 12px;
    }
    .friend-links-section {
        width: 94%;
        margin-top: 20px;
        margin-bottom: 40px;
        padding-top: 16px;
    }
    .friend-title {
        font-size: 13px;
        margin-bottom: 12px;
    }
    .friend-list {
        gap: 6px;
    }
    .friend-list a {
        font-size: 12px;
        padding: 5px 10px;
        border-radius: 4px;
    }
}
