:root {
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --header-height: 64px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { 
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; 
    background: var(--bg-color); 
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 通用按钮 */
.btn { 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    padding: 0.625rem 1.25rem; 
    border-radius: var(--radius-sm); 
    font-size: 0.875rem; 
    font-weight: 500; 
    cursor: pointer; 
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); 
    border: 1px solid transparent; 
    text-decoration: none;
    gap: 0.5rem;
}
.btn-primary { 
    background: var(--primary); 
    color: white; 
    border-color: var(--primary);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}
.btn-primary:hover { 
    background: var(--primary-hover); 
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}
.btn-outline { 
    background: white; 
    color: var(--text-main); 
    border-color: var(--border); 
}
.btn-outline:hover { 
    background: var(--bg-color); 
    border-color: #cbd5e1; 
}
.btn-danger { 
    background: #fff1f2; 
    color: #e11d48; 
    border-color: #ffe4e6; 
}
.btn-danger:hover { 
    background: #ffe4e6; 
}
.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.75rem; }
.btn-text { background: transparent; color: var(--text-muted); padding: 4px; }
.btn-text:hover { color: var(--primary); }

/* 表单元素 */
.form-group { margin-bottom: 1.25rem; }
.form-group label { 
    display: block; 
    font-size: 0.875rem; 
    font-weight: 500; 
    margin-bottom: 0.5rem; 
    color: #374151; 
}
.form-input { 
    width: 100%; 
    padding: 0.625rem 0.875rem; 
    border: 1px solid var(--border); 
    border-radius: var(--radius-sm); 
    font-size: 0.875rem; 
    outline: none; 
    transition: all 0.2s; 
    background: white;
    color: var(--text-main);
}
.form-input:focus { 
    border-color: var(--primary); 
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); 
}
.form-input::placeholder { color: #9ca3af; }
.form-input:read-only { background: #f9fafb; color: var(--text-muted); cursor: not-allowed; }

/* 导航栏 */
.navbar { 
    height: var(--header-height); 
    background: rgba(255, 255, 255, 0.8); 
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border); 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    padding: 0 1.5rem; 
    position: sticky; 
    top: 0; 
    z-index: 40; 
}
.brand { 
    font-weight: 700; 
    font-size: 1.25rem; 
    color: var(--text-main); 
    text-decoration: none; 
    display: flex; 
    align-items: center; 
    gap: 0.75rem; 
}
.brand i { color: var(--primary); }
.nav-links { display: flex; gap: 1.5rem; }
.nav-links a { color: var(--text-muted); text-decoration: none; font-size: 0.95rem; display: flex; align-items: center; gap: 0.4rem; transition: color 0.2s; }
.nav-links a:hover, .nav-links a.active { color: var(--primary); }

/* 下拉菜单 */
.nav-dropdown { position: relative; display: inline-block; }
.dropdown-trigger { cursor: pointer; }
.dropdown-content {
    display: none;
    position: absolute;
    background-color: white;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.1);
    z-index: 100;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 10px;
}
.dropdown-content a {
    color: var(--text-muted);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 0.9rem;
    white-space: nowrap;
}
.dropdown-content a:hover { background-color: #f8fafc; color: var(--primary); }
.nav-dropdown:hover .dropdown-content { display: block; }
.nav-dropdown:hover .dropdown-trigger { color: var(--primary); }
.dropdown-content::before {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: transparent transparent white transparent;
}

/* Hero Module */
.hero { background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%); color: white; padding: 5rem 2rem; text-align: center; }
.hero-content { max-width: 800px; margin: 0 auto; }
.hero h1 { font-size: 2.5rem; margin-bottom: 1rem; letter-spacing: -0.025em; }
.hero p { color: #94a3b8; font-size: 1.1rem; margin-bottom: 2rem; }
.hero .search-box { max-width: 500px; margin: 0 auto; }
.hero .search-input { background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); color: white; padding: 0.8rem 1rem 0.8rem 3rem; font-size: 1rem; backdrop-filter: blur(10px); }
.hero .search-input::placeholder { color: #64748b; }
.hero .search-input:focus { background: rgba(255,255,255,0.2); border-color: var(--primary); }
.hero .stats { display: flex; justify-content: center; gap: 2rem; margin-top: 1.5rem; font-size: 0.9rem; color: #94a3b8; }
.hero .stat-item { display: flex; align-items: center; gap: 0.5rem; }

/* 筛选器样式 */
.category-filters { display: flex; }
.cat-btn {
    background: white;
    border: 1px solid var(--border);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}
.cat-btn:hover { border-color: var(--primary); color: var(--primary); }
.cat-btn.active { background: var(--primary); color: white; border-color: var(--primary); box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2); }

/* 容器与网格 */
.container { max-width: 1200px; margin: 0 auto; padding: 2rem; min-height: calc(100vh - 60px); }
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 2rem; justify-content: center; }

/* 项目卡片 */
.project-card { 
    background: var(--card-bg); 
    border: 1px solid var(--border); 
    border-radius: var(--radius); 
    padding: 1.8rem; 
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    text-align: center; 
    position: relative;
    overflow: hidden;
}
.project-card:hover { 
    transform: translateY(-8px); 
    box-shadow: 0 12px 20px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1); 
    border-color: var(--primary); 
}

/* 徽标 - 胶囊形状 */
.card-badge { 
    position: absolute; 
    top: 15px; 
    right: 15px; 
    background: var(--primary); 
    color: white; 
    padding: 4px 12px; 
    font-size: 0.75rem; 
    font-weight: 600; 
    border-radius: 999px; /* 胶囊形状 */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 10;
    text-transform: none;
    white-space: nowrap;
    animation: badge-pulse 2s infinite;
}

@keyframes badge-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.card-icon { 
    width: 64px; 
    height: 64px; 
    background: #eff6ff; 
    border-radius: 18px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    margin-bottom: 1.2rem; 
    color: var(--primary); 
    font-size: 1.8rem; 
    transition: transform 0.3s;
}
.project-card:hover .card-icon { transform: scale(1.1) rotate(5deg); }

.card-icon.locked { background: #fef2f2; color: #ef4444; }
.card-title { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.8rem; color: var(--text-main); }
.card-meta { 
    font-size: 0.9rem; 
    color: var(--text-muted); 
    margin-bottom: 1.5rem; 
    display: flex; 
    align-items: center; 
    gap: 0.5rem; 
    justify-content: center;
}
.card-actions { 
    display: flex; 
    flex-wrap: wrap;
    gap: 0.8rem; 
    margin-top: auto; 
    justify-content: center; 
    width: 100%; 
}

/* 顶部公告栏 (专业胶囊样式) */
.announcement-bar {
    margin: 1rem 0 2.5rem 0;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(248, 250, 252, 0.5);
    border-radius: 20px;
    border: 1px solid rgba(226, 232, 240, 0.6);
}
.announcement-capsule {
    display: flex;
    align-items: center;
    padding: 0.5rem 1.25rem;
    border-radius: 100px;
    font-size: 0.875rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.08);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
    max-width: 100%;
}
.announcement-capsule:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border-color: rgba(0,0,0,0.15);
}
.announcement-capsule b {
    display: flex;
    align-items: center;
    margin-right: 0.75rem;
    padding-right: 0.75rem;
    border-right: 1px solid rgba(0,0,0,0.1);
    font-weight: 600;
    color: inherit;
    opacity: 0.9;
    font-size: 0.8rem;
    white-space: nowrap;
}
.announcement-capsule .content {
    line-height: 1.5;
    font-weight: 500;
}

/* 搜索框增强 */
.search-wrapper { position: relative; width: 100%; }
.search-results-popover {
    position: absolute; top: 100%; left: 0; width: 100%;
    background: white; border: 1px solid var(--border); border-radius: 12px;
    box-shadow: 0 15px 30px -5px rgba(0,0,0,0.1); z-index: 50;
    display: none; padding: 0.5rem 0; margin-top: 10px; max-height: 350px; overflow-y: auto;
    animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

.search-item { 
    padding: 0.8rem 1.2rem; 
    cursor: pointer; 
    font-size: 0.95rem; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    border-bottom: 1px solid #f1f5f9; 
    transition: all 0.2s;
}
.search-item:last-child { border-bottom: none; }
.search-item:hover { background: #eff6ff; color: var(--primary); padding-left: 1.5rem; }

/* 分页器 */
.pagination { display: flex; justify-content: center; gap: 10px; margin-top: 4rem; margin-bottom: 3rem; }
.page-btn { 
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border); 
    background: white; 
    border-radius: 10px; 
    cursor: pointer; 
    font-size: 1rem; 
    font-weight: 600;
    transition: all 0.2s; 
    color: var(--text-muted);
}
.page-btn.active { background: var(--primary); color: white; border-color: var(--primary); box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3); }
.page-btn:hover:not(.active) { background: #f8fafc; border-color: #cbd5e1; color: var(--primary); }

/* 密码框相关 */
.search-box { position: relative; width: 100%; }
.search-input { border-radius: 99px; padding-left: 2.5rem; }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); width: 16px; height: 16px; }

/* 密码框相关 */
.password-wrapper { position: relative; }
.password-toggle { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); cursor: pointer; color: var(--text-muted); }

/* Professional Tooltips - Direction Down */
[data-tooltip] {
    position: relative;
    cursor: pointer;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    top: 135%; /* 向下 */
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: rgba(15, 23, 42, 0.95);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    white-space: normal;
    word-break: break-all;
    min-width: 120px;
    max-width: 250px;
    line-height: 1.4;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 10000; /* 提高 z-index 避免干扰 */
    pointer-events: none;
}

[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Tooltip Arrow - Direction Down */
[data-tooltip]::before {
    content: "";
    position: absolute;
    top: 115%; /* 向下 */
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    border-width: 6px;
    border-style: solid;
    border-color: transparent transparent rgba(15, 23, 42, 0.95) transparent;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10000;
    pointer-events: none;
}

[data-tooltip]:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Mobile Adjustment */
@media (max-width: 768px) {
    [data-tooltip]::after { display: none; }
}

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); backdrop-filter: blur(2px); z-index: 100; display: flex; justify-content: center; align-items: center; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.modal-overlay.active { opacity: 1; pointer-events: auto; }
.modal-box { background: white; width: 90%; max-width: 420px; padding: 2rem; border-radius: 12px; box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1); transform: scale(0.95); transition: transform 0.2s; }
.modal-overlay.active .modal-box { transform: scale(1); }

/* Toast */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 10px; }
.toast { background: white; padding: 0.8rem 1.2rem; border-radius: 8px; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); border-left: 4px solid var(--primary); font-size: 0.9rem; animation: slideIn 0.3s ease; }
.toast.error { border-left-color: #ef4444; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* 辅助类 */
.hidden { display: none !important; }

/* 分页组件优化 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 3rem;
    padding: 1rem;
}

.page-btn {
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: white;
    color: var(--text-muted);
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    gap: 6px;
}

.page-btn:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
    background: #f0f7ff;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.1);
}

.page-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 12px -2px rgba(37, 99, 235, 0.3);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f8fafc;
}

.pagination-jump {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.pagination-jump input {
    width: 50px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 8px;
    text-align: center;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.pagination-jump input:focus {
    border-color: var(--primary);
}

.pagination-jump button {
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--primary);
    background: transparent;
    color: var(--primary);
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination-jump button:hover {
    background: var(--primary);
    color: white;
}

@media (max-width: 640px) {
    .pagination-jump { display: none; }
    .page-btn { min-width: 36px; height: 36px; padding: 0 8px; font-size: 0.85rem; }
}
