:root {
    --primary-color: #4a6cf7;
    --secondary-color: #f5f7ff;
    --text-color: #333;
    --background-color: #f9f9f9;
    --card-background: #ffffff;
    --card-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    --header-bg: #ffffff;
    --footer-bg: #f5f5f5;
    --border-color: #eaeaea;
    --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    --hover-color: #e5eaff;
    --category-active: #4a6cf7;
    --transition: all 0.3s ease;
    --sidebar-width: 240px;
    --sidebar-collapsed-width: 70px;
    --sidebar-bg: #ffffff;
    --sidebar-hover: #f5f7ff;
}

.dark-theme {
    --primary-color: #6d8bff;
    --secondary-color: #2a2f3b;
    --text-color: #e5e5e5;
    --background-color: #1a1d23;
    --card-background: #2a2f3b;
    --card-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    --header-bg: #21252e;
    --footer-bg: #21252e;
    --border-color: #3a3f4b;
    --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    --hover-color: #363c4d;
    --category-active: #6d8bff;
    --sidebar-bg: #21252e;
    --sidebar-hover: #2a2f3b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    transition: var(--transition);
    height: 100vh;
    overflow: hidden;
}

/* App Layout */
.app-container {
    display: flex;
    height: 100vh;
    width: 100%;
}

/* Sidebar Styles */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    z-index: 1000;
    position: fixed;
    left: 0;
    top: 0;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header .logo h1 {
    color: var(--primary-color);
    font-size: 1.8rem;
    font-weight: 700;
    transition: var(--transition);
}

.sidebar.collapsed .sidebar-header .logo h1 {
    display: none;
}

.toggle-sidebar {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
}

.toggle-sidebar:hover {
    background-color: var(--hover-color);
}

.sidebar.collapsed .toggle-sidebar {
    transform: rotate(180deg);
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

#categories {
    display: flex;
    flex-direction: column;
    list-style: none;
    padding: 0;
    margin-bottom: 20px;
}

#categories li {
    padding: 12px 20px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    border-radius: 0;
    margin: 0;
    font-size: 15px;
    border-left: 3px solid transparent;
}

#categories li i {
    margin-right: 15px;
    font-size: 18px;
    width: 20px;
    text-align: center;
    transition: var(--transition);
}

.sidebar.collapsed #categories li {
    padding: 15px 0;
    justify-content: center;
}

.sidebar.collapsed #categories li i {
    margin-right: 0;
    font-size: 22px;
}

.sidebar.collapsed #categories li span {
    display: none;
}

#categories li:hover {
    background-color: var(--sidebar-hover);
}

#categories li.active {
    color: var(--primary-color);
    font-weight: 500;
    border-left: 3px solid var(--primary-color);
    background-color: var(--hover-color);
}

.sidebar.collapsed #categories li.active {
    border-left: none;
    border-right: 3px solid var(--primary-color);
}

.sidebar-actions {
    padding: 0 20px;
}

.sidebar.collapsed .sidebar-actions {
    padding: 0 10px;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    transition: var(--transition);
}

.sidebar.collapsed .sidebar-footer {
    padding: 15px 10px;
    display: flex;
    justify-content: center;
}

.sidebar.collapsed .theme-switch {
    justify-content: center;
}

.sidebar.collapsed #theme-icon {
    margin-left: 0;
}

.sidebar.collapsed .btn-text {
    display: none;
}

/* Main Container Styles */
.main-container {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    max-height: 100vh;
    margin-left: var(--sidebar-width);
    transition: var(--transition);
}

.main-container.expanded {
    margin-left: var(--sidebar-collapsed-width);
}

header {
    display: flex;
    align-items: center;
    padding: 20px;
    background-color: var(--header-bg);
    box-shadow: var(--box-shadow);
    z-index: 10;
}

.header-content {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tagline {
    color: var(--text-color);
    font-size: 0.9rem;
    font-weight: 600;
    opacity: 1;
    max-width: 50%;
    background-color: rgba(74, 108, 247, 0.1);
    padding: 8px 15px;
    border-radius: 5px;
    border-left: 3px solid var(--primary-color);
}

.dark-theme .tagline {
    background-color: rgba(109, 139, 255, 0.15);
    border-left: 3px solid var(--primary-color-dark);
}

.search-box {
    display: flex;
    position: relative;
    width: 40%;
    min-width: 250px;
}

.search-box input {
    width: 100%;
    padding: 12px 45px 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 30px;
    font-size: 16px;
    background-color: var(--background-color);
    color: var(--text-color);
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.15);
}

.search-box button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-color);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

.search-box button:hover {
    background: #3a54d6;
}

/* Main Content */
main {
    flex: 1;
    padding: 25px;
    overflow-y: auto;
}

/* 分类标题和卡片布局 */
.category-section {
    margin-bottom: 30px;
    width: 100%;
}

.category-section h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-color);
    color: var(--text-color);
    display: flex;
    align-items: center;
}

.category-section h2::before {
    content: "";
    display: inline-block;
    width: 18px;
    height: 18px;
    background-color: var(--primary-color);
    margin-right: 10px;
    border-radius: 50%;
}

.dark-theme .category-section h2::before {
    background-color: var(--primary-color-dark);
}

.dark-theme .category-section h2 {
    border-bottom-color: var(--primary-color-dark);
}

.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .cards-container {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 480px) {
    .cards-container {
        grid-template-columns: 1fr;
    }
}

/* Theme Switch Styles */
.theme-switch {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    margin-right: 10px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

#theme-icon {
    color: var(--text-color);
    font-size: 1.2rem;
}

/* Add Button */
.add-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 30px;
    padding: 12px 24px;
    font-size: 15px;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
    margin-top: 10px;
}

.add-btn i {
    margin-right: 8px;
}

.sidebar.collapsed .add-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    margin: 15px auto;
}

.sidebar.collapsed .add-btn i {
    margin-right: 0;
}

.add-btn:hover {
    background-color: var(--primary-hover-color);
    transform: translateY(-2px);
}

/* Footer */
footer {
    margin-top: auto;
    padding: 15px 25px;
    background-color: var(--footer-bg);
    text-align: center;
    font-size: 14px;
    color: var(--text-color);
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 992px) {
    .sidebar {
        width: var(--sidebar-collapsed-width);
    }
    
    .main-container {
        margin-left: var(--sidebar-collapsed-width);
    }
    
    .sidebar-header .logo h1 {
        display: none;
    }
    
    .sidebar-header {
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    .sidebar-header::before {
        content: "N";
        font-size: 24px;
        font-weight: bold;
        color: var(--primary-color);
    }
    
    .toggle-sidebar {
        display: none;
    }
    
    #categories li span,
    .btn-text,
    .sidebar .theme-switch {
        display: none;
    }
    
    #categories li {
        display: flex;
        justify-content: center;
        padding: 15px 0;
    }
    
    #categories li i {
        margin-right: 0;
        font-size: 22px;
    }
    
    .add-btn {
        width: 40px;
        height: 40px;
        padding: 0;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 15px auto;
    }
    
    .add-btn i {
        margin-right: 0;
    }
    
    .tagline {
        display: none;
    }
    
    .header-content {
        justify-content: center;
    }
    
    .search-box {
        width: 100%;
    }
}

@media (max-width: 768px) {
    body {
        overflow: auto;
    }
    
    .app-container {
        flex-direction: column;
        height: auto;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .main-container {
        margin-left: 0;
        max-height: none;
    }
    
    .sidebar-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 15px;
    }
    
    .sidebar-header::before {
        display: none;
    }
    
    .sidebar-header .logo h1 {
        display: block;
        font-size: 1.5rem;
    }
    
    .sidebar-nav {
        display: none;
    }
    
    .sidebar-footer {
        display: none;
    }
    
    /* Mobile Navigation */
    .mobile-nav {
        display: flex;
        overflow-x: auto;
        white-space: nowrap;
        padding: 10px;
        background-color: var(--sidebar-bg);
        border-bottom: 1px solid var(--border-color);
        position: sticky;
        top: 0;
        z-index: 100;
    }
    
    #categories.mobile {
        display: flex;
        flex-direction: row;
        padding: 0;
        margin: 0;
    }
    
    #categories.mobile li {
        padding: 8px 16px;
        border-radius: 20px;
        margin: 0 5px;
        border-left: none;
    }
    
    #categories.mobile li.active {
        background-color: var(--primary-color);
        color: white;
    }
    
    #categories.mobile li i {
        margin-right: 5px;
    }
    
    #categories.mobile li span {
        display: inline;
    }
    
    .main-container {
        max-height: none;
    }
    
    main {
        padding: 15px;
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 15px;
    }
    
    header {
        padding: 15px;
    }
    
    .theme-switch {
        position: absolute;
        top: 15px;
        right: 15px;
    }
    
    .add-btn {
        position: fixed;
        bottom: 20px;
        right: 20px;
        z-index: 1000;
        width: 50px;
        height: 50px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
    
    footer {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .card-actions {
        flex-direction: column;
    }
    
    .btn-details {
        margin-top: 10px;
        width: 100%;
    }
    
    main {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

/* Keep the existing card styles */
.card {
    background-color: var(--card-background);
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    padding: 20px;
    transition: var(--transition);
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.card-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.card-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background-color: var(--secondary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    color: var(--primary-color);
    font-size: 20px;
}

.card-icon img {
    max-width: 24px;
    max-height: 24px;
    object-fit: contain;
}

.card-title {
    font-weight: 500;
    font-size: 1.1rem;
}

.card-description {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 15px;
    flex-grow: 1;
}

.card-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
}

.card-link i {
    margin-left: 5px;
    font-size: 0.8rem;
}

/* Card actions and buttons */
.card-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
}

.btn {
    padding: 8px 12px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: center;
}

.btn-details {
    background-color: var(--secondary-color);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    flex: 1;
    margin-right: 10px;
}

.btn-details:hover {
    background-color: var(--primary-color);
    color: white;
}

.btn-visit {
    background-color: var(--primary-color);
    color: white;
    flex: 1;
}

.btn-visit:hover {
    background-color: var(--primary-hover-color);
}

.btn i {
    margin-left: 5px;
    font-size: 12px;
}

/* Dark theme styles for buttons */
.dark-theme .btn-details {
    background-color: var(--secondary-color-dark);
    color: var(--primary-color-dark);
    border-color: var(--primary-color-dark);
}

.dark-theme .btn-details:hover {
    background-color: var(--primary-color-dark);
    color: var(--text-color-dark);
}

.dark-theme .btn-visit {
    background-color: var(--primary-color-dark);
    color: var(--text-color-dark);
}

.dark-theme .btn-visit:hover {
    background-color: var(--primary-hover-color-dark);
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow: auto;
}

.modal-content {
    background-color: var(--card-background);
    margin: 15% auto;
    padding: 30px;
    border-radius: 15px;
    box-shadow: var(--card-shadow);
    width: 80%;
    max-width: 600px;
    position: relative;
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: var(--text-color);
}

.modal-content h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
}

.modal-content p {
    margin-bottom: 15px;
    line-height: 1.6;
}

/* 模态框表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

.submit-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.submit-btn:hover {
    background-color: var(--primary-hover-color);
}

/* 消息提示样式 */
.message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 5px;
    font-size: 16px;
    z-index: 9999;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    transition: opacity 0.5s, transform 0.3s;
}

.message.info {
    background-color: #e7f5fe;
    color: #0c5d93;
    border-left: 4px solid #0c5d93;
}

.message.success {
    background-color: #e7fee7;
    color: #0c930c;
    border-left: 4px solid #0c930c;
}

.message.error {
    background-color: #fee7e7;
    color: #930c0c;
    border-left: 4px solid #930c0c;
}

.message.fade-out {
    opacity: 0;
    transform: translateY(-20px);
}

/* 加载提示样式 */
.loading-message {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    z-index: 9999;
}

.loading-message i {
    margin-right: 10px;
}

/* 暗色模式适配 */
.dark-theme .add-btn {
    background-color: var(--primary-color-dark);
}

.dark-theme .add-btn:hover {
    background-color: var(--primary-hover-color-dark);
}

.dark-theme .form-group input {
    background-color: var(--card-bg-dark);
    border-color: var(--border-color-dark);
    color: var(--text-color-dark);
}

.dark-theme .submit-btn {
    background-color: var(--primary-color-dark);
}

.dark-theme .submit-btn:hover {
    background-color: var(--primary-hover-color-dark);
}

/* 响应式设计 */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .logo {
        margin-bottom: 15px;
        text-align: center;
    }
    
    .search-box {
        width: 100%;
        margin-bottom: 15px;
    }
    
    .theme-switch {
        justify-content: center;
    }
    
    main {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
    
    .modal-content {
        width: 90%;
        margin: 20% auto;
    }
    
    nav {
        flex-direction: column;
    }
    
    .add-btn {
        margin-left: 0;
        margin-top: 10px;
        justify-content: center;
    }
    
    .message {
        width: calc(100% - 40px);
        top: 10px;
        right: 10px;
        padding: 10px 15px;
    }
}

/* Responsive adjustments for card actions */
@media (max-width: 480px) {
    .card-actions {
        flex-direction: column;
    }
    
    .btn-details {
        margin-right: 0;
        margin-bottom: 8px;
    }
}

/* 返回顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: var(--primary-hover-color);
    transform: translateY(-3px);
}

.dark-theme .back-to-top {
    background-color: var(--primary-color-dark);
}

.dark-theme .back-to-top:hover {
    background-color: var(--primary-hover-color-dark);
}

@media (max-width: 768px) {
    .back-to-top {
        width: 40px;
        height: 40px;
        font-size: 16px;
        right: 15px;
        bottom: 15px;
    }
}

/* 搜索结果信息 */
.search-result-info {
    display: flex;
    align-items: center;
    padding: 15px;
    margin-bottom: 20px;
    background-color: var(--card-background);
    border-left: 4px solid var(--primary-color);
    border-radius: 5px;
    box-shadow: var(--box-shadow);
}

.search-result-info i {
    font-size: 20px;
    color: var(--primary-color);
    margin-right: 10px;
}

.search-result-info p {
    font-size: 15px;
    color: var(--text-color);
}

/* 暗色模式适配 */
.dark-theme .search-result-info {
    border-left-color: var(--primary-color-dark);
}

.dark-theme .search-result-info i {
    color: var(--primary-color-dark);
} 