/* ============================================
   CenterPHP 公共样式
   包含：导航栏、页脚、按钮、搜索模态框、用户胶囊、移动端菜单、基础重置
   ============================================ */

/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
    background-color: #f8fafc;
    color: #1e2b3c;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: #1e2b3c;
}

[x-cloak] {
    display: none !important;
}

.mr-2 {
    margin-right: 8px
}
.hidden {
    display: none;
}
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 固定宽度的容器 - 用于与工具列表对齐 */
.container-fixed {
    width: 1200px;
    margin: 0 auto;
}

/* 大屏优化 - 增加主体宽度 */
@media (min-width: 1440px) {
    .container {
        max-width: 1400px;
    }

    .container-fixed {
        width: 1400px;
    }
}

/* 导航栏 */
.navbar {
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-content {
    display: flex;
    align-items: center;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    width: 200px;
    flex-shrink: 0;
}

.logo-image {
    height: 32px;
    width: auto;
}

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

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
    margin-left: 24px;
    margin-right: auto;
}

.nav-link {
    text-decoration: none;
    color: #6b7280;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-link:hover {
    color: #23a894;
}

.nav-link.active {
    color: #23a894;
    border-bottom: 2px solid #23a894;
    padding-bottom: 2px;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    margin-left: auto;
    margin-right: 0;
}

.nav-search-box{
    position: relative;
}

.nav-search-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #e8f7f5;
    border: 1px solid #d1f0eb;
    border-radius: 3px;
    color: #23a894;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-search-btn:hover {
    background: #d1f0eb;
    color: #1a8677;
}

.nav-search-btn i {
    font-size: 14px;
}

.nav-search-btn span {
    font-weight: 500;
}

/* 导航栏搜索框 */
.nav-search-form {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    align-items: center;
    z-index: 100;
}

.nav-search-input {
    width: 280px;
    padding: 10px 45px 10px 16px;
    border-radius: 3px;
    border: 1px solid #d1f0eb;
    background: white;
    font-size: 16px;
    color: #1e2b3c;
    outline: none;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.nav-search-input:focus {
    border-color: #23a894;
    box-shadow: 0 0 0 3px rgba(35, 168, 148, 0.1);
}

.nav-search-input::placeholder {
    color: #9ca3af;
}

.nav-search-submit {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #23a894;
    font-size: 14px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.nav-search-submit:hover {
    background: #e8f7f5;
    color: #1a8677;
}

.search-shortcut {
    padding: 2px 6px;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 12px;
    color: #9ca3af;
    font-family: monospace;
}

.auth-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn {
    padding: 8px 16px;
    border-radius: 3px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
}

.btn-outline {
    color: #6b7280;
    border: 1px solid #e5e7eb;
    background: white;
}

.btn-outline:hover {
    border-color: #23a894;
    color: #23a894;
}

.btn-primary {
    background: #23a894;
    color: white;
}

.btn-primary:hover {
    background: #1a8677;
}

/* 用户胶囊 */
.user-capsule {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px 6px 6px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.user-capsule:hover {
    background: #e5e7eb;
}

.user-capsule-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex: 1;
    min-width: 0;
}

.user-capsule-logo {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.user-capsule-name {
    font-size: 14px;
    font-weight: 500;
    color: #1e2b3c;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-capsule-divider {
    width: 1px;
    height: 16px;
    background: #d1d5db;
}

.user-capsule-logout {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 14px;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.user-capsule-logout:hover {
    color: #ef4444;
}

.logout-tooltip {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #1e2b3c;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    white-space: nowrap;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

.user-capsule-logout:hover + .logout-tooltip,
.logout-tooltip:hover {
    opacity: 1;
    visibility: visible;
}

.logout-tooltip::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 16px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid #1e2b3c;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    color: #6b7280;
    cursor: pointer;
    padding: 8px;
}

/* 移动端菜单 */
.mobile-menu {
    background: white;
    border-top: 1px solid #e5e7eb;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.mobile-menu-content {
    padding: 16px 0;
    max-height: calc(100vh - 64px);
    overflow-y: auto;
}

.mobile-nav-link {
    display: block;
    padding: 12px 20px;
    color: #6b7280;
    text-decoration: none;
    font-weight: 500;
}

.mobile-nav-link:hover {
    background: #f9fafb;
    color: #23a894;
}

.mobile-nav-link.active {
    color: #23a894;
}

.mobile-nav-link-default {
    text-align: center;
    margin: 0 20px 0;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.mobile-nav-link-primary {
    background: #23a894;
    color: white;
    text-align: center;
    margin: 8px 20px 0;
    border-radius: 6px;
}

.mobile-nav-link-primary:hover {
    background: #1a8677;
}

.mobile-menu-divider {
    border-top: 1px solid #e5e7eb;
    margin: 8px 0;
}

/* 移动端用户信息 */
.mobile-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: #f9fafb;
    margin-bottom: 8px;
}

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

.mobile-user-info span {
    font-size: 14px;
    font-weight: 500;
    color: #1e2b3c;
}

/* 搜索模态框 */
.search-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
}

.search-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.search-modal-content {
    position: relative;
    width: 90%;
    max-width: 600px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    z-index: 1;
}

.search-modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid #f3f4f6;
}

.search-modal-header i {
    color: #9ca3af;
    font-size: 18px;
    flex-shrink: 0;
}

.search-modal-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    color: #1e2b3c;
    background: transparent;
}

.search-modal-input::placeholder {
    color: #9ca3af;
}

.search-modal-clear {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
    font-size: 16px;
    transition: color 0.2s;
}

.search-modal-clear:hover {
    color: #6b7280;
}

.search-modal-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 12px 20px;
    background: #f9fafb;
    border-top: 1px solid #f3f4f6;
}

.search-modal-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #9ca3af;
}

.hint-key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    padding: 2px 6px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    font-size: 12px;
    font-family: monospace;
    color: #6b7280;
}

.hint-text {
    color: #9ca3af;
}

/* 搜索结果 */
.search-results {
    max-height: 400px;
    overflow-y: auto;
    border-bottom: 1px solid #f3f4f6;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    text-decoration: none;
    transition: background 0.15s;
}

.search-result-item:hover,
.search-result-item.active {
    background: #f9fafb;
}

.search-result-icon {
    width: 36px;
    height: 36px;
    background: #e8f7f5;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #23a894;
    font-size: 14px;
    flex-shrink: 0;
}

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

.search-result-name {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #1e2b3c;
    margin-bottom: 2px;
}

.search-result-desc {
    display: block;
    font-size: 12px;
    color: #9ca3af;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-result-arrow {
    color: #d1d5db;
    font-size: 12px;
    flex-shrink: 0;
}

.search-result-item:hover .search-result-arrow {
    color: #23a894;
}

.search-empty {
    text-align: center;
    padding: 40px 20px;
    color: #9ca3af;
}

.search-empty i {
    font-size: 32px;
    margin-bottom: 12px;
}

.search-empty p {
    font-size: 14px;
}

/* 页脚 */
.footer {
    background: #1a8677;
    padding: 48px 0 24px;
    color: white;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 32px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.footer-logo-image {
    height: 32px;
    width: auto;
}

.footer-logo-text {
    font-size: 20px;
    font-weight: 700;
}

.footer-description {
    font-size: 14px;
    line-height: 1.8;
    opacity: 0.9;
}

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

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

.footer-list li {
    margin-bottom: 12px;
}

.footer-link {
    color: white;
    text-decoration: none;
    font-size: 14px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.footer-link:hover {
    opacity: 1;
}

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

.footer-contact-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 14px;
    opacity: 0.8;
}

.footer-contact-item i {
    width: 16px;
    color: #d1f0eb;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 12px;
    text-align: center;
}

.footer-copyright p {
    font-size: 14px;
    opacity: 0.7;
}

.footer-icp {
    font-size: 14px;
    opacity: 0.7;
    text-decoration: none;
    color: white;
}

/* ============================================
   公共响应式
   ============================================ */

/* 桌面端隐藏移动端菜单按钮 */
@media (min-width: 769px) {
    .mobile-menu-btn {
        display: none !important;
    }
}

/* 响应式 - 移动设备 */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .nav-search-btn span,
    .search-shortcut {
        display: none;
    }

    .user-capsule{
        display: none;
    }

    .nav-search-btn {
        padding: 8px;
        min-width: auto;
    }

    .nav-search-input {
        width: 240px;
    }

    .auth-buttons {
        display: none;
    }

    .mobile-menu-btn {
        display: block !important;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
    }

    .footer-brand{
        grid-column: 1 / -1;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
}
