/* theme.css */

:root {
    /* ========== 自定义配置区 (在这里修改) ========== */
    
    /* 图标容器的大小 (外框) */
    --icon-box-size: 56px; 
    
    /* 内部图片的大小 (100%表示填满外框，80%表示留点边距) */
    --img-scale: 70%;     

    /* 内部 Emoji 文字的大小 */
    --emoji-size: 28px;    

    /* 整体背景颜色 */
    --bg-color: #000000;
    
    /* 卡片背景颜色 */
    --card-bg: rgba(28, 28, 30, 0.6);
    
    /* 强调色 (按钮/高亮) */
    --accent-color: #0A84FF;
    
    /* =========================================== */

    --text-primary: #ffffff;
    --text-secondary: rgba(235, 235, 245, 0.6);
    --card-border: rgba(255, 255, 255, 0.1);
    --blur-strength: 20px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    padding-bottom: 40px;
}

/* 顶部导航栏 */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(var(--blur-strength));
    -webkit-backdrop-filter: blur(var(--blur-strength));
    border-bottom: 0.5px solid var(--card-border);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-title {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(90deg, #fff, #a1a1aa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-actions { display: flex; gap: 12px; }

.icon-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: white;
    cursor: pointer;
    transition: 0.2s;
    text-decoration: none;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.2); }
.icon-btn svg { width: 20px; height: 20px; }

/* 搜索栏 */
.search-container {
    max-width: 1000px;
    margin: 20px auto 10px;
    padding: 0 20px;
}

.search-input {
    width: 100%;
    background: rgba(118, 118, 128, 0.24);
    border: none;
    border-radius: 12px;
    padding: 12px 16px 12px 40px;
    color: white;
    font-size: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%238e8e93' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 12px center;
    transition: 0.3s;
}
.search-input:focus { outline: none; background-color: rgba(118, 118, 128, 0.4); }

/* 网格布局 */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}

.card {
    background: var(--card-bg);
    border: 0.5px solid var(--card-border);
    border-radius: 20px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    text-decoration: none;
    color: white;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    height: 100%;
}

.card:hover {
    transform: translateY(-5px);
    background: rgba(44, 44, 46, 0.8);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    border-color: rgba(255,255,255,0.2);
}

.card:active { transform: scale(0.96); }

/* --- 图标核心样式 --- */
.card-icon {
    width: var(--icon-box-size);
    height: var(--icon-box-size);
    border-radius: 14px;
    display: flex; 
    align-items: center; 
    justify-content: center;
    font-size: var(--emoji-size); /* 控制 Emoji 大小 */
    margin-bottom: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    overflow: hidden; /* 确保图片不溢出圆角 */
}

/* 控制图片大小 */
.card-icon img { 
    width: var(--img-scale); 
    height: var(--img-scale); 
    object-fit: cover; 
    border-radius: 14px; 
}

.card-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; line-height: 1.3; }
.card-desc { font-size: 12px; color: var(--text-secondary); line-height: 1.4; }

.badge {
    position: absolute; top: 10px; right: 10px;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 10px;
    color: rgba(255,255,255,0.9);
    border: 0.5px solid rgba(255,255,255,0.1);
}

/* 模态框样式 */
.modal {
    display: none; position: fixed; z-index: 1000;
    left: 0; top: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    opacity: 0; transition: opacity 0.3s;
}
.modal.show { opacity: 1; }

.modal-content {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: rgba(30, 30, 30, 0.95);
    border: 0.5px solid rgba(255,255,255,0.15);
    padding: 30px; border-radius: 24px;
    width: 90%; max-width: 360px;
    text-align: center;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}
.modal.show .modal-content { transform: translate(-50%, -50%) scale(1); }

.modal h2 { margin-bottom: 16px; font-size: 18px; }
.pass-input {
    width: 100%; padding: 12px;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px; color: white;
    font-size: 16px; margin-bottom: 20px;
    outline: none; text-align: center;
}
.pass-input:focus { border-color: var(--accent-color); }

.modal-btns { display: flex; gap: 10px; }
.btn {
    flex: 1; padding: 12px; border: none; border-radius: 10px;
    font-size: 15px; font-weight: 600; cursor: pointer;
}
.btn-cancel { background: rgba(255,255,255,0.1); color: white; }
.btn-confirm { background: var(--accent-color); color: white; }
.error-msg { color: #FF453A; font-size: 13px; margin-bottom: 15px; display: none; }