/* 悬浮导航栏 */
.floating-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.floating-nav-inner {
    max-width: 1440px;
    margin: 0 auto;
    padding: 8px 18px;
    display: flex;
    align-items: center;
    gap: 16px;
    height: 56px;
}

.floating-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    flex-shrink: 0;
}

.floating-brand .brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    color: #fff;
    background: linear-gradient(135deg, #0c7c7b, #2f6bd1);
    font-size: 16px;
    font-weight: 800;
    box-shadow: 0 4px 12px rgba(12, 124, 123, 0.2);
}

.floating-brand-text strong {
    font-size: 15px;
    line-height: 1.2;
}

.floating-nav-links {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.floating-nav-links a {
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 13px;
    text-decoration: none;
    color: #30535a;
    transition: all 0.2s;
    white-space: nowrap;
}

.floating-nav-links a:hover {
    background: rgba(12, 124, 123, 0.1);
    color: #0c7c7b;
}

.floating-nav-links a.active {
    background: rgba(12, 124, 123, 0.12);
    color: #0c7c7b;
    font-weight: 600;
}

.floating-nav-search {
    flex: 1;
    max-width: 380px;
    position: relative;
}

.floating-nav-search input {
    width: 100%;
    height: 36px;
    padding: 0 14px;
    border: 1px solid #dde7ea;
    border-radius: 999px;
    background: #f7fafb;
    font-size: 13px;
    outline: none;
    transition: all 0.2s;
}

.floating-nav-search input:focus {
    border-color: #0c7c7b;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(12, 124, 123, 0.1);
}

.floating-search-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #dde7ea;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    max-height: 340px;
    overflow-y: auto;
    display: none;
    z-index: 100;
}

.floating-search-dropdown.show {
    display: block;
}

.search-result-item {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid #f0f4f5;
    transition: background 0.15s;
}

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

.search-result-item:hover {
    background: #f0f9f8;
}

.search-result-item .result-name {
    font-weight: 600;
    font-size: 13px;
    color: #142026;
}

.search-result-item .result-type {
    font-size: 11px;
    color: #6b7280;
    margin-left: 6px;
}

.search-result-item .result-desc {
    font-size: 12px;
    color: #64727b;
    margin-top: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-highlight {
    background: #fff3cd;
    padding: 0 2px;
    border-radius: 2px;
}

.search-empty {
    padding: 14px;
    text-align: center;
    color: #6b7280;
    font-size: 13px;
}

.floating-nav-user {
    flex-shrink: 0;
    position: relative;
}

.nav-user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border: 1px solid #dde7ea;
    border-radius: 999px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.nav-user-btn:hover {
    border-color: #0c7c7b;
    background: #f0f9f8;
}

.nav-user-btn.login-btn {
    background: linear-gradient(135deg, #0c7c7b, #2f6bd1);
    color: #fff;
    border-color: transparent;
}

.nav-user-btn.login-btn:hover {
    opacity: 0.9;
}

.user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0c7c7b, #2f6bd1);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
}

.user-name {
    font-weight: 600;
}

.user-link-count {
    font-size: 11px;
    color: #6b7280;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 160px;
    background: #fff;
    border: 1px solid #dde7ea;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    display: none;
    z-index: 100;
    overflow: hidden;
}

.user-dropdown.show {
    display: block;
}

.user-dd-link,
.user-dd-btn {
    display: block;
    width: 100%;
    padding: 10px 14px;
    text-align: left;
    background: transparent;
    border: none;
    border-bottom: 1px solid #f0f4f5;
    cursor: pointer;
    font-size: 13px;
    text-decoration: none;
    color: #142026;
    transition: background 0.15s;
}

.user-dd-link:hover,
.user-dd-btn:hover {
    background: #f0f9f8;
}

.user-dd-btn:last-child {
    border-bottom: none;
}

.user-dd-btn.danger {
    color: #dc3545;
}

.user-dd-btn.danger:hover {
    background: #fff5f5;
}

/* 为悬浮栏留出空间 */
body {
    padding-top: 70px !important;
}

.main-content {
    padding-top: 12px !important;
}

/* 登录/注册弹窗 */
.user-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
}

.user-modal.show {
    display: flex;
}

.user-modal-box {
    background: #fff;
    padding: 28px;
    border-radius: 12px;
    width: 90%;
    max-width: 380px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
    position: relative;
}

.user-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    line-height: 1;
}

.user-modal-close:hover {
    color: #333;
}

.user-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.user-tab {
    flex: 1;
    padding: 10px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 14px;
    color: #6b7280;
    transition: all 0.2s;
}

.user-tab.active {
    color: #0c7c7b;
    border-bottom-color: #0c7c7b;
    font-weight: 600;
}

.user-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.user-form input {
    padding: 10px 14px;
    border: 1px solid #dde7ea;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.user-form input:focus {
    border-color: #0c7c7b;
    box-shadow: 0 0 0 3px rgba(12, 124, 123, 0.1);
}

.user-form button {
    padding: 12px;
    background: linear-gradient(135deg, #0c7c7b, #2f6bd1);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: opacity 0.2s;
}

.user-form button:hover {
    opacity: 0.9;
}

.username-check {
    font-size: 12px;
    min-height: 16px;
}

.username-check.available {
    color: #28a745;
}

.username-check.taken {
    color: #dc3545;
}

.ip-info {
    font-size: 12px;
    color: #6b7280;
    padding: 8px;
    background: #f7fafb;
    border-radius: 6px;
}

.user-form-message {
    margin-top: 12px;
    padding: 10px;
    border-radius: 6px;
    font-size: 13px;
    display: none;
}

.user-form-message.show {
    display: block;
}

.user-form-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.user-form-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 私密链接区域 */
.private-links-section {
    background: #fff;
    border-top: 1px solid #e5e7eb;
    padding: 30px 0;
    margin-top: 40px;
    position: relative;
    margin-bottom: 60px;
}

.private-links-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 18px;
}

.private-links-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.private-links-header h2 {
    font-size: 20px;
    color: #142026;
    margin: 0;
}

.private-links-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.link-counter {
    font-size: 13px;
    color: #6b7280;
}

.btn-add-link {
    padding: 8px 16px;
    background: linear-gradient(135deg, #0c7c7b, #2f6bd1);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: opacity 0.2s;
}

.btn-add-link:hover {
    opacity: 0.9;
}

.btn-collapse-links {
    width: 36px;
    height: 36px;
    padding: 0;
    background: #fff;
    border: 1px solid #dde7ea;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
}

.btn-collapse-links:hover {
    background: #f0f9f8;
    border-color: #0c7c7b;
}

.private-links-body {
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease;
    max-height: 3000px;
    opacity: 1;
}

.private-links-body.collapsed {
    max-height: 0;
    opacity: 0;
    margin: 0;
}

.private-links-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.private-link-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: #f7fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    transition: all 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.private-link-item:hover {
    background: #f0f9f8;
    border-color: #0c7c7b;
    box-shadow: 0 4px 12px rgba(12, 124, 123, 0.1);
}

.private-link-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    min-width: 28px;
    background: #e8f4ff;
    color: #0c7c7b;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.private-link-order {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.order-btn {
    width: 24px;
    height: 22px;
    padding: 0;
    background: #fff;
    border: 1px solid #dde7ea;
    border-radius: 4px;
    cursor: pointer;
    font-size: 10px;
    color: #6b7280;
    transition: all 0.15s;
}

.order-btn:hover {
    background: #0c7c7b;
    color: #fff;
    border-color: #0c7c7b;
}

.private-link-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.private-link-name {
    font-weight: 600;
    font-size: 14px;
    color: #142026;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.private-link-url {
    font-size: 12px;
    color: #6b7280;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.private-link-url:hover {
    color: #0c7c7b;
}

.private-link-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.action-btn {
    width: 30px;
    height: 30px;
    padding: 0;
    background: #fff;
    border: 1px solid #dde7ea;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.15s;
}

.action-btn:hover {
    background: #f0f9f8;
    border-color: #0c7c7b;
}

.action-btn.delete-link:hover {
    background: #fff5f5;
    border-color: #dc3545;
}

.no-links {
    padding: 40px;
    text-align: center;
    color: #6b7280;
    font-size: 14px;
    border: 2px dashed #e5e7eb;
    border-radius: 8px;
}

/* 响应式 */
@media (max-width: 1100px) {
    .floating-nav-links a:not(.active-nav) {
        display: none;
    }
}

@media (max-width: 768px) {
    .floating-nav-inner {
        padding: 6px 12px;
        gap: 8px;
        height: auto;
        flex-wrap: wrap;
    }

    body {
        padding-top: 120px !important;
    }

    .floating-nav-links {
        display: none;
    }

    .floating-nav-search {
        order: 10;
        max-width: 100%;
        flex: 1;
    }

    .floating-brand-text strong {
        font-size: 13px;
    }

    .user-name,
    .user-link-count {
        display: none;
    }

    .private-link-item {
        flex-wrap: wrap;
    }

    .private-link-order {
        flex-direction: row;
    }
}
