﻿:root {
    --background-color: #ffffff;
    --text-color: #000000;
    --box-color: #e0e0e0;
    --cc-color: #cf1818;
    --hover-color: #f5f5f5;
    --nav-hover: #f0f0f0;
    --icon-color: #333333;
}

@media (prefers-color-scheme: dark) {
    :root {
        --background-color: #1a1a1a;
        --text-color: #ffffff;
        --box-color: #444444;
        --cc-color: #cccccc;
        --hover-color: #2a2a2a;
        --nav-hover: #333333;
        --icon-color: #cccccc;
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont,"Microsoft YaHei", "微软雅黑","Microsoft JhengHei", "微軟正黑體","Segoe UI", Roboto,"Helvetica Neue", Arial,sans-serif;
    font-size: 16px;
    background-color: var(--background-color);
    color: var(--text-color);
    min-height: 100vh;
    position: relative;
    transition: background-color 0.3s, color 0.3s;
}
::selection {color: var(--nav-hover); background: var(--cc-color);}
::-moz-selection {color: var(--nav-hover); background: var(--cc-color);}
img{border:none;}
/* 导航面板样式 */
.nav-panel {
    width: 100%;
    background-color: var(--background-color);
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    z-index: 999;
    overflow-y: auto;
}

.panel-header {
    background-color: var(--nav-hover);
    color: var(--cc-color);
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-title {
    width: 90%;
    font-size: 1.5rem;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.panel-title a {
    background-color: var(--nav-hover);
    color: var(--cc-color);
    text-decoration: none;
}

/* 导航菜单样式 */
.nav-container {
    position: relative;
    display: flex;
    align-items: center;
}

/* 深色/浅色模式切换按钮 */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    width: 24px;
    height: 24px;
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--icon-color);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
}

/* 导航菜单按钮 */
.nav-toggle {
    background: none;
    border: none;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background-color: var(--text-color);
    margin: 2px 0;
    transition: all 0.3s ease;
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* 导航菜单 */
.nav-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--background-color);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.nav-menu.active {
    transform: translateX(0);
}

.nav-menu-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-color);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-menu-list {
    list-style: none;
    padding: 50px;
    margin: 0;
    width: 100%;
    text-align: center;
    overflow-y: auto;
    overflow-x: hidden;
}

.nav-menu-list li {
    padding: 15px 0;
    border-bottom: 1px solid var(--box-color);
}

.nav-menu-list a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.5rem;
    transition: color 0.3s;
}

.nav-menu-list a:hover {
    color: var(--text-color);
    opacity: 0.9;
    transform: scale(1.1);
    font-weight: bold;
}

.nav-menu-list a.current::before {
      content: "▸";
      color: var(--text-color);
      margin-right: 1px;
    }

/* 网址链接网格 */
.links-grid {
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
}

.link-item {
    position: relative;
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    background-color: var(--hover-color);
}

.link-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    background-color: var(--box-color);
}

.link-favicon {
    width: 55px;
    height: 55px;
    margin-bottom: 8px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    background-color: var(--box-color);
}

.link-title {
    display: -webkit-box;
    font-size: 1rem;
    color: var(--icon-color);
    word-break: break-word;
    line-height: 1.5;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: bold;
}

.delete-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: #999;
    color: white;
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.75rem;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.link-item:hover .delete-btn {
    display: flex;
}

.delete-btn:hover {
    background-color: #555;
    transform: scale(1.1);
}

/* 操作按钮区域 */
.actions {
    padding: 5px;
    border-top: 1px solid var(--box-color);
    display: flex;
    gap: 10px;
    position: relative;
    bottom: 0;
    background-color: var(--background-color);
}

.btn {
    background-color: var(--icon-color);
    color: var(--nav-hover);
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.25rem;
    transition: background-color 0.3s;
    flex: 1;
    text-align: center;
    text-decoration: none;
    font-weight: bold;
}

.btn:hover {
    opacity: 0.9;
}

/* 提示信息 */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--icon-color);
    color: var(--background-color);
    padding: 12px 24px;
    border-radius: 5px;
    display: none;
    z-index: 1001;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateX(-50%) translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* 导入导出模态框 */
.modal {
    position: fixed;
    top: 0; left: 0;right: 0;bottom: 0;
    width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    z-index: 1002;
    -webkit-overflow-scrolling: touch;
    overflow: hidden;
    min-width: 100%;
    min-height: 100%;
    transition: opacity 0.3s ease, transform 0.3s ease;
    -webkit-transition: opacity 0.3s ease, transform 0.3s ease;
    -moz-transition: opacity 0.3s ease, transform 0.3s ease;
    -o-transition: opacity 0.3s ease, transform 0.3s ease;
}

.modal.active {
    opacity: 1;
    pointer-events: auto;
}

/* 内容层 */
.modal-content {
    background-color: var(--background-color);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 500px;
    border: 1px solid var(--box-color);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal.active .modal-content {
    transform: scale(1);
    -webkit-transform: scale(1);
    -moz-transform: scale(1);
    -o-transform: scale(1);
}

.modal-header {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 10px;
    color: var(--icon-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--icon-color);
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.modal-close:hover {
    background-color: var(--box-color);
}

.form-group {
    display: block;
}
.form-group p{
    margin-bottom: 10px;
    color: var(--icon-color);
}
.form-group a{
    color: var(--icon-color);
}
.modal textarea {
    width: 100%;
    height: 200px;
    padding: 10px;
    border: 1px solid var(--box-color);
    border-radius: 5px;
    font-family: monospace;
    font-size: 1rem;
    resize: vertical;
    background-color: var(--background-color);
    color: var(--icon-color);
}

.modal-actions {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.modal-actions .btn {
    width: 100%;
}

.file-input-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
    width: 100%;
}

.file-input-wrapper input[type=file] {
    position: absolute;
    left: -9999px;
}

.file-input-label {
    display: block;
    padding: 10px 20px;
    background-color: var(--box-color);
    color: var(--icon-color);
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.25rem;
    text-align: center;
    transition: background-color 0.3s;
}

.file-input-label:hover {
    background-color: var(--icon-color);
    color: var(--background-color);
}

.empty-state {
    grid-column: 1 / -1;
    grid-row: 1 / -1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 40px 20px;
    color: var(--icon-color);
    min-height: 100px;
}

.empty-state svg {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-state p {
    margin: 0;
    font-size: 1.2rem;
    line-height: 2;
}

.empty-state a {
    color: var(--cc-color);
}

.so {
    width: auto;
    height: auto;
    padding: 0 20px;
}

.so input {
    margin: 20px 0 10px 0;
    width: 100%;
    color: var(--cc-color);
    padding: 5px;
    font-size: 2.2rem;
    font-weight: bold;
    text-align: center;
    transform: none;
    -webkit-appearance: none;
    border: 0;
    max-height: none;
    outline: none;
    background-image: none;
    background-color: transparent;
    border-radius: 0;
    border-bottom: 0.5px solid var(--box-color);
    cursor: pointer;
}

.footer {
    width: 100%;
    height: auto;
    margin-top: 1px;
    padding: 20px 0;
    -webkit-font-smoothing: antialiased;
    font-size: 1rem;
    font-weight: 400;
    color: var(--icon-color);
    line-height: 20px;
    text-align: center;
    position: relative;
}

.footer p {
    width: 98%;
    height: auto;
    padding: 10px 10px;
}

.footer a, .footer a:active, .footer a:focus {
    text-decoration: none;
    color: var(--icon-color);
}

.footer a:hover {
    color: var(--text-color);
}

    /* 返回顶部按钮样式 */
    #backToTop {
      position: fixed;
      bottom: 30px;
      right: 10px;
      width:2.75rem;
      height: 2.75rem;
      line-height: 2.75rem;
      background-color: var(--cc-color);
      color: var(--nav-hover);
      border: none;
      border-radius: 50%;
      box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1rem;
      cursor: pointer;
      opacity: 0;
      visibility: hidden;
      overflow: hidden;
      transition: opacity 0.3s ease, visibility 0.3s ease;
     -webkit-transform: opacity 0.3s ease, visibility 0.3s ease;
      transform: rotate(0deg);
      -webkit-transform: rotate(0deg);
      z-index: 9999;
    }
    #backToTop.show {
      opacity: 1;
      visibility: visible;
    }
    @media (max-width: 600px) {
      #backToTop {
        font-size: 1.25rem;
      }
    }
    /* 可选：按钮 hover 效果 */
    #backToTop:hover {
      background-color: var(--cc-color);
    }

.search-info {
    margin-top:-10px;
    display: flex;
    align-items: center; 
}

.dark-mode .search-info ,.light-mode .search-info {
    background-color: var(--nav-hover);
    font-size: 1rem;
    font-weight: bold;
    padding: 5px 5px;
    color: var(--icon-color);
    min-height: 30px;
    border-bottom: 0.5px solid var(--box-color);
}

.batch-delete-btn {
    background-color: var(--icon-color);
    color: var(--nav-hover);
    border: none;
    padding: 5px 5px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s;
    text-decoration: none;
    margin-left: auto;
}

.batch-delete-btn:hover {
        opacity: 0.9;
}

.dark-mode .batch-delete-btn,.light-mode .batch-delete-btn {
    color: var(--nav-hover);
}

.dark-mode .batch-delete-btn:hover,.light-mode .batch-delete-btn:hover {
    opacity: 0.9;
}

.invalid-url {
    opacity: 0.75;
    background-color: #cf1818;
}
.status-badge {
     color: var(--text-hover);
     font-size: 0.9rem;
}
.invalid-url .link-title {
    filter: grayscale(100%);
    -webkit-filter: grayscale(100%);
    -moz-filter: grayscale(100%);
    -ms-filter: grayscale(100%);
    -o-filter: grayscale(100%);
}


/* 响应式设计 */
@media (max-width: 850px) {
    .links-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
        padding: 15px;
    }
    
    .link-favicon {
        width: 55px;
        height: 55px;
    }
    .modal {
        width: 95%;
        padding: 20px;
    }
}
@media (max-width: 600px) {
    .links-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
        padding: 15px;
    }
    
    .link-favicon {
        width: 55px;
        height: 55px;
    }
    .link-title {
    font-size: 0.9rem;
    }
.panel-title {
    font-size: 1.25rem;
}

.so input {
    font-size: 1.5rem;
}
}


//搜索页
        .hot-keywords {
            margin-top: 10px;
        }
        
        .hot-keywords h3 {
            font-size: 0.9rem;
            margin-bottom: 8px;
            color: var(--text-color);
        }
        
        .keywords-list {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
        }
        .keywords-list a {
            background-color: var(--hover-color);
            color: var(--icon-color);
            padding: 5px 10px;
            border-radius: 15px;
            text-decoration: none;
            font-size: 0.9rem;
            border: 1px solid var(--hover-color);
        }
        
        .keywords-list a:hover {
            background-color: var(--hover-color);
            color: var(--icon-color);
        }
        
        /* 搜索结果样式 */
        .results-container {
        width: auto;
        height: auto;
        padding: 10px 20px;
        margin-bottom: 10px;
        }
        .result-item {
            padding: 20px 10px;
            //transition: transform 0.3s ease, box-shadow 0.3s ease;
        }
        
        .result-item:hover {
    position: relative;
    transition: all 0.3s ease;
    background-color: var(--hover-color);
        }
        .result-title {
            display: flex;
            align-items: center;
            margin-bottom: 5px;

    display: -webkit-box;
    font-size: 1rem;
    color: var(--icon-color);
    word-break: break-word;
    line-height: 1.5;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;

        }
        
        .favicon {
            width: 16px;
            height: 16px;
            margin-right: 8px;
        }
        
        .result-title a {
            color: var(--cc-color);
            text-decoration: none;
            font-size: 1.1rem;
            font-weight: 500;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            max-width: 90%;
            display: inline-block;
        }
        
        .result-title a:hover {
            color: var(--cc-color);
            text-decoration: underline;
        }
        
        .result-url{
            color: var(--icon-color);
            font-size: 0.9rem;
            word-break: break-all;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
        }
        .result-url a{
            color: var(--icon-color);
           text-decoration: none;
        }
        .result-url a:hover{
            color: var(--icon-color);
           text-decoration: underline;
        }
        
        /* 加载更多按钮样式 */
        .load-more-container {
            text-align: center;
            margin: 20px 0;
        }
        
        .load-more-btn {
            background-color: var(--icon-color);
            color: var(--nav-hover);
            border: none;
            padding: 10px 20px;
            border-radius: 5px;
            cursor: pointer;
            font-size: 1.25rem;
            transition: all 0.3s ease;
            position: relative;
            overflow: hidden;
            flex: 1;
            text-align: center;
            text-decoration: none;
            font-weight: bold;
        }
        
        .load-more-btn:hover {
            opacity: 0.9;
        }
        
        .load-more-btn:disabled {
            background-color: #cccccc;
            cursor: not-allowed;
        }
        
        .load-more-btn.loading {
            color: transparent;
        }
        
        .load-more-btn.loading::after {
            content: "";
            position: absolute;
            width: 16px;
            height: 16px;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            margin: auto;
            border: 2px solid transparent;
            border-top-color: #ffffff;
            border-radius: 50%;
            animation: loading-spinner 0.8s linear infinite;
        }
        
        @keyframes loading-spinner {
            0% {
                transform: rotate(0deg);
            }
            100% {
                transform: rotate(360deg);
            }
        }
         

        
        /* 响应式设计 */
        @media (max-width: 768px) {  
            .result-title a {
                font-size: 1rem;
            }
       
        }

.submit-options {
    display: flex;
    margin-bottom: 15px;
    gap: 20px;
}

.submit-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 16px;
    user-select: none;
}

.submit-option input {
    display: none;
}

.checkmark {
    display: inline-block;
    width: 20px;
    height: 20px;
    background-color: #eee;
    border-radius: 4px;
    margin-left: 8px;
    position: relative;
}

.submit-option input:checked + .checkmark {
    background-color: #3498db;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.submit-option input:checked + .checkmark:after {
    display: block;
}
.search-info-open {
    margin-top:-10px;
    display: flex;
    align-items: center; 
}
.search-info-open {
    background-color: var(--nav-hover);
    font-size: 1rem;
    font-weight: bold;
    padding: 5px 5px;
    color: var(--icon-color);
    min-height: 30px;
    border-bottom: 0.5px solid var(--box-color);
}

.search-tip {
    text-align: center;
    font-size: 0.9rem;
    font-weight: bold;
    padding: 5px 5px;
    color: var(--icon-color);
    min-height: 30px;
}

/* URL状态指示器样式 - 移动端优化 */
.url-status-indicator {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 10px;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 4px;
    /* 确保在移动端也能正确显示 */
    max-width: 80px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.url-status-indicator.checking {
    background-color: #f0f0f0;
    color: #666;
}

.url-status-indicator.success {
    background-color: #d4edda;
    color: #155724;
}

.url-status-indicator.error {
    background-color: #f8d7da;
    color: #721c24;
}

/* 点击后显示的按钮容器（替代原文本） */
.url-status-indicator .btn-container {
    display: inline;
    gap: 2px;
    align-items: center;
}
/* 删除按钮 */
.url-status-indicator .btn-delete {
    padding: 1px 4px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 0px;
    cursor: pointer;
    white-space: nowrap;
}

/* 取消按钮 */
.url-status-indicator .btn-cancel {
    padding: 1px 4px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 0px;
    cursor: pointer;
    white-space: nowrap;
}

/* 隐藏原始文本（点击后） */
.url-status-indicator.active .status-text {
    opacity: 0;
    visibility: hidden;
    height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

/* CORS链接样式 - 移动端优化 */
.cors-link {
    font-size: 10px;
    padding: 1px 4px;
    border-radius: 4px;
    background-color: rgba(0, 123, 255, 0.1);
    color: #007bff;
    text-decoration: none;
    transition: all 0.2s ease;
    /* 确保在移动端也能正确点击 */
    display: inline-block;
    min-width: 30px;
    text-align: center;
}

.cors-link:hover {
    background-color: rgba(0, 123, 255, 0.2);
    color: #0056b3;
    text-decoration: underline;
}

/* 状态文本样式 */
.status-text {
    font-weight: bold;
    cursor: pointer;
}

/* 我的最爱标题修改 */
.btn-secondary {
            display: none;
        }
        .edit-icon {
            display: none;
            margin-left: 8px;
            color: var(--icon-color);
            cursor: pointer;
            font-size: 1.1rem;
        }
        .panel-header:hover .edit-icon {
            display: inline-block;
        }
        .form-group .modal-input {
            font-size: 1.75rem !important;
}

/* 移动端特定样式 */
@media (max-width: 768px) {
    .url-status-indicator {
        font-size: 10px;
        padding: 1px 4px;
        max-width: 60px;
    }
    
    .cors-link {
        font-size: 8px;
        padding: 1px 2px;
        min-width: 24px;
    }
}

/* 深色模式样式 */
body.dark-mode {
    --background-color: #1a1a1a;
    --text-color: #ffffff;
    --box-color: #444444;
    --cc-color: #cccccc;
    --hover-color: #2a2a2a;
    --nav-hover: #333333;
    --icon-color: #cccccc;
}

/* 浅色模式样式 */
body.light-mode {
    --background-color: #ffffff;
    --text-color: #000000;
    --box-color: #e0e0e0;
    --cc-color: #cf1818;
    --hover-color: #f5f5f5;
    --nav-hover: #f0f0f0;
    --icon-color: #333333;
}