/* 基础样式 */
body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
    color: #333;
    font-size: 16px;
}

header {
    background-color: #4285f4;
    color: white;
    padding: 1rem;
    text-align: center;
    position: relative;
}

h1 {
    margin: 0;
    font-size: 1.5rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

/* 按钮样式 */
.manage-btn, .back-btn {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    padding: 0.5rem;
    background-color: white;
    color: #4285f4;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.8rem;
    white-space: nowrap;
}

.back-btn {
    left: 1rem;
    right: auto;
}

/* 书签网格 */
.bookmarks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.8rem;
    margin-top: 0.6rem;
    margin-bottom: 0.6rem;
}

.bookmark {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.8rem;
    background-color: white;
    border-radius: 6px;
    text-decoration: none;
    color: #333;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    font-size: 0.9rem;
    text-align: center;
    word-break: break-word;
}

.bookmark:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.favicon {
    width: 28px;
    height: 28px;
    margin-bottom: 0.4rem;
}

/* 分类标题 */
.category-section h2 {
    border-bottom: 2px solid #4285f4;
    padding-bottom: 0.4rem;
    color: #4285f4;
    font-size: 1.2rem;
    margin: 0px;
    margin-bottom: 10px;
}

/* 管理页面样式 */
.bookmark-form {
    background-color: white;
    padding: 1.2rem;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

.bookmark-form input {
    display: block;
    width: 100%;
    padding: 0.5rem;
    margin-bottom: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.bookmark-form button {
    background-color: #4285f4;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    width: 100%;
}

.bookmark-list table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    font-size: 0.9rem;
}

.bookmark-list th, .bookmark-list td {
    padding: 0.5rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.bookmark-list th {
    background-color: #f2f2f2;
    font-size: 0.9rem;
}

.actions a {
    padding: 0.2rem 0.4rem;
    text-decoration: none;
    border-radius: 4px;
    margin-right: 0.3rem;
    font-size: 0.8rem;
    display: inline-block;
}

.edit-btn {
    background-color: #34a853;
    color: white;
}

.delete-btn {
    background-color: #ea4335;
    color: white;
}

/* 手机版特定样式 */
@media (max-width: 768px) {
    header {
        padding: 0.8rem;
    }
    
    h1 {
        font-size: 1.3rem;
        padding: 0 2.5rem;
    }
    
    .manage-btn, .back-btn {
        padding: 0.4rem;
        font-size: 0.7rem;
    }
    
    .container {
        padding: 0.8rem;
    }
    
    .bookmarks-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 0.6rem;
    }
    
    .bookmark {
        padding: 0.6rem;
        font-size: 0.8rem;
    }
    
    .favicon {
        width: 24px;
        height: 24px;
    }
    
    .category-section h2 {
        font-size: 1.1rem;
    }
    
    .bookmark-form {
        padding: 1rem;
    }
    
    .bookmark-list table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .bookmark-list th, .bookmark-list td {
        padding: 0.4rem;
    }
}

/* 超小屏幕手机 (如iPhone 5/SE) */
@media (max-width: 320px) {
    .bookmarks-grid {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    }
    
    .bookmark {
        font-size: 0.7rem;
        padding: 0.5rem;
    }
    
    h1 {
        font-size: 1.1rem;
    }
}
