/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #ffffff;
    min-height: 100vh;
}

/* 登录页面样式 */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 400px;
}

.login-card {
    background: white;
    border-radius: 20px;
    padding: 40px 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.login-header {
    margin-bottom: 30px;
}

.rocket-icon {
    font-size: 48px;
    margin-bottom: 20px;
    display: block;
}

.login-header h1 {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.login-header p {
    color: #666;
    font-size: 14px;
}

.login-form {
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group input {
    width: 100%;
    padding: 15px 20px;
    border: 1px solid #e1e5e9;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.login-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.login-btn:hover {
    transform: translateY(-2px);
}

.admin-link {
    margin-top: 20px;
}

.admin-link a {
    color: #667eea;
    text-decoration: none;
    font-size: 14px;
}

.admin-link a:hover {
    text-decoration: underline;
}

.error-message {
    background: #fee;
    color: #c33;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 15px;
    font-size: 14px;
}

/* 主页样式 */
.home-page {
    background: #ffffff;
    min-height: 100vh;
}

.header {
    background: white;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 8px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 16px;
    font-weight: 500;
    color: #495057;
}

.logo .rocket-icon {
    margin-right: 10px;
    font-size: 24px;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.admin-btn {
    padding: 6px 12px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.admin-btn {
    background: #007bff;
    color: white;
    border: 1px solid #007bff;
}



.admin-btn:hover {
    background: #0056b3;
    border-color: #0056b3;
}

.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.search-section {
    margin-bottom: 16px;
}

.search-form {
    display: flex;
    max-width: 300px;
    margin: 0 auto;
    background: #f8f9fa;
    border-radius: 4px;
    overflow: hidden;
}

.search-form input {
    flex: 1;
    border: none;
    padding: 8px 12px;
    font-size: 14px;
    outline: none;
    background: transparent;
}

.search-form input::placeholder {
    color: #6c757d;
}

.search-btn {
    background: transparent;
    color: #6c757d;
    border: none;
    padding: 8px 10px;
    cursor: pointer;
    font-size: 14px;
}

.search-btn:hover {
    color: #495057;
}

.category-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    justify-content: center;
}

.tab-btn {
    padding: 6px 12px;
    background: transparent;
    color: #6c757d;
    text-decoration: none;
    border-radius: 3px;
    font-size: 13px;
    font-weight: 400;
    transition: all 0.2s;
}

.tab-btn:hover {
    background: #f8f9fa;
    color: #495057;
}

.tab-btn.active {
    background: #f8f9fa;
    color: #212529;
    font-weight: 500;
}

.category-section {
    margin-bottom: 40px;
}

.category-title {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 12px;
    color: #6c757d;
}

.websites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
    margin-bottom: 16px;
}

.website-card-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
}

.website-card {
    background: #f8f9fa;
    border-radius: 4px;
    padding: 10px;
    transition: all 0.2s;
    display: block;
    text-decoration: none;
    color: inherit;
    min-height: 48px;
    flex: 1;
}

.website-card:hover {
    background: #e9ecef;
    text-decoration: none;
    color: inherit;
}

.website-info {
    display: flex;
    align-items: center;
    flex: 1;
}

.website-name {
    font-weight: 400;
    color: #495057;
    font-size: 14px;
    line-height: 1.3;
    word-wrap: break-word;
    word-break: break-all;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.website-actions {
    display: flex;
    gap: 4px;
    align-items: center;
    margin-top: 4px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 0 0 4px 4px;
    justify-content: flex-end;
}

.credential-btn {
    background: none;
    border: none;
    font-size: 12px;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 3px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    color: #6c757d;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

.credential-btn:hover {
    background: #e9ecef;
    color: #495057;
    transform: scale(1.1);
}

.username-btn:hover {
    background: #e8f5e8;
    color: #28a745;
}

.password-btn:hover {
    background: #fff3cd;
    color: #856404;
}

.credential-btn.copied {
    background: #d4edda;
    color: #155724;
    transform: scale(1.2);
}







    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}




.no-results, .no-websites {
    text-align: center;
    color: #666;
    font-style: italic;
    grid-column: 1 / -1;
    padding: 40px;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .main-content {
        max-width: 100%;
        padding: 20px 15px;
    }

    .websites-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 12px;
    }
}

@media (max-width: 768px) {
    .header-content {
        padding: 6px 12px;
        flex-direction: row;
    }

    .logo {
        font-size: 14px;
    }

    .main-content {
        padding: 12px 8px;
    }

    .search-form {
        max-width: 250px;
    }

    .category-tabs {
        gap: 2px;
        margin-bottom: 12px;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .category-tabs::-webkit-scrollbar {
        display: none;
    }

    .tab-btn {
        white-space: nowrap;
        padding: 4px 8px;
        font-size: 12px;
    }

    .websites-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 6px;
    }

    .website-card {
        padding: 8px;
        min-height: 40px;
    }

    .website-name {
        font-size: 12px;
        line-height: 1.2;
        -webkit-line-clamp: 2;
    }

    .back-to-top {
        width: 40px;
        height: 40px;
        bottom: 16px;
        right: 16px;
        font-size: 14px;
    }

    .category-title {
        font-size: 14px;
        margin-bottom: 8px;
    }

    .website-actions {
        gap: 4px;
        padding: 6px 8px;
    }

    .credential-btn {
        min-width: 32px;
        height: 32px;
        font-size: 14px;
        padding: 6px 8px;
        background: rgba(255, 255, 255, 0.9);
        border: 1px solid #e9ecef;
    }

    .credential-btn:active {
        background: #e9ecef;
        transform: scale(0.95);
    }

    .website-name {
        font-size: 14px;
        line-height: 1.4;
    }

    .website-actions {
        gap: 6px;
        flex-shrink: 0;
    }



    .category-title {
        font-size: 18px;
        margin-bottom: 15px;
        padding: 0 5px;
    }
}

@media (max-width: 480px) {
    .login-card {
        margin: 10px;
        padding: 30px 20px;
    }

    .login-header h1 {
        font-size: 20px;
    }

    .rocket-icon {
        font-size: 40px !important;
    }

    .header-content {
        padding: 10px 12px;
    }

    .logo {
        font-size: 18px;
    }

    .main-content {
        padding: 12px 8px;
    }

    .search-section {
        margin-bottom: 20px;
    }

    .search-form {
        margin: 0 5px;
    }

    .category-tabs {
        padding: 0 8px 12px 8px;
        margin: 0 -8px 15px -8px;
    }

    .tab-btn {
        padding: 6px 12px;
        font-size: 13px;
    }

    .websites-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        padding: 0 2px;
        gap: 8px;
    }

    .website-card {
        padding: 10px;
        min-height: 50px;
    }

    .website-name {
        font-size: 14px;
    }





    .category-title {
        font-size: 16px;
        margin-bottom: 12px;
        padding: 0 2px;
    }
}

/* 横屏手机优化 */
@media (max-width: 768px) and (orientation: landscape) {
    .header-content {
        flex-direction: row;
        padding: 8px 15px;
    }

    .logo {
        order: 1;
    }

    .header-actions {
        order: 2;
        width: auto;
    }

    .main-content {
        padding: 10px;
    }

    .websites-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
    gap: 2px;
}

.pagination-btn {
    padding: 4px 8px;
    background: transparent;
    color: #6c757d;
    text-decoration: none;
    border-radius: 3px;
    transition: all 0.2s;
    font-size: 12px;
    min-width: 28px;
    text-align: center;
}

.pagination-btn:hover {
    background: #f8f9fa;
    color: #495057;
}

.pagination-btn.active {
    background: #f8f9fa;
    color: #212529;
    font-weight: 500;
}

.pagination-btn.disabled {
    color: #adb5bd;
    cursor: not-allowed;
}

.pagination-btn.disabled:hover {
    background: transparent;
    color: #adb5bd;
}

.pagination-info {
    color: #666;
    font-size: 14px;
    margin: 0 15px;
}

.items-per-page {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 12px 0;
    justify-content: center;
    font-size: 12px;
    color: #adb5bd;
}

.items-per-page select {
    padding: 2px 6px;
    border: none;
    border-radius: 3px;
    background: #f8f9fa;
    font-size: 12px;
    color: #6c757d;
}

/* 返回顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
    display: none;
    box-shadow: 0 2px 12px rgba(0, 123, 255, 0.3);
}

.back-to-top:hover {
    background: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 123, 255, 0.4);
}

.back-to-top.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 移动端分页优化 */
@media (max-width: 768px) {
    .pagination {
        gap: 5px;
        margin: 20px 0;
    }

    .pagination-btn {
        padding: 6px 8px;
        font-size: 12px;
        min-width: 32px;
    }

    .pagination-info {
        font-size: 12px;
        margin: 0 8px;
    }

    .items-per-page {
        margin: 15px 0;
    }

    .back-to-top {
        width: 45px;
        height: 45px;
        bottom: 15px;
        right: 15px;
        font-size: 18px;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .website-card {
        transition: transform 0.1s ease;
    }

    .website-card:active {
        transform: scale(0.98);
    }



    .tab-btn:hover {
        transform: none;
    }
}

/* 高DPI屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .website-logo {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* 减少动画以提升性能 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 暗色模式支持 */
@media (prefers-color-scheme: dark) {
    .website-card {
        background: #2d3748;
        color: #e2e8f0;
    }

    .website-name {
        color: #e2e8f0;
    }



    .username-btn:hover {
        background: #2563eb;
        color: white;
    }

    .password-btn:hover {
        background: #ea580c;
        color: white;
    }
}

/* 默认图片样式 */
.website-logo[src="assets/images/default-logo.png"] {
    background: #f0f2f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.website-logo[src="assets/images/default-logo.png"]:before {
    content: "🌐";
    font-size: 18px;
}

/* 复制成功提示 */
.copy-success {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #4caf50;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
