/* ============================================================
   文件下载模块 (Download)
   语言栏单选 + 文档行卡片（名称/锁标/标签/大小/次数/下载按钮）+ 登录门禁弹窗
   ============================================================ */
.download-module-wrapper {
    height: 100%;
    min-height: 400px;
    padding: 28px 32px;
    background-color: #fafafa;
    overflow-y: auto;
    box-sizing: border-box;
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

/* 左侧主内容列（语言栏 + 列表） */
.download-main {
    flex: 1;
    min-width: 0;
}

/* 右侧广告栏：设计稿 300 × 1600（外列 320 含留白，同百科矩阵模式）
   顶边贴内容区顶分割线、右边贴页面右边缘：负 margin 抵消 wrapper 的 padding */
.download-ad-sidebar {
    box-sizing: border-box;
    width: 320px;
    padding-left: 20px;
    flex-shrink: 0;
    margin-top: -28px;
    margin-right: -32px;
}

.download-ad-sticky {
    width: 300px;
    height: 1600px;
    background: #f9fafb;
    border: 1px dashed #d1d5db;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 1. 文档语言选择栏：单选 chip，选中反色 */
.download-lang-bar {
    margin-bottom: 20px;
}

.download-lang-label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 10px;
}

.download-lang-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.download-lang-chip {
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid #d2d2d7;
    background: #fff;
    color: #1d1d1f;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.download-lang-chip:hover {
    border-color: #86868b;
}

.download-lang-chip.active {
    background: #1d1d1f;
    border-color: #1d1d1f;
    color: #fff;
}

/* 2. 下载列表：每行一张卡片，两行信息 + 右侧下载按钮 */
.download-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.download-row {
    display: flex;
    align-items: center;
    gap: 18px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 14px 20px;
    transition: box-shadow 0.2s;
}

.download-row:hover {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

.download-row-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.download-row-line {
    display: flex;
    align-items: center;
    gap: 10px;
}

.download-title {
    font-size: 15px;
    font-weight: 600;
    color: #1d1d1f;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.download-size,
.download-count {
    font-size: 13px;
    color: #86868b;
    white-space: nowrap;
}

.download-size b,
.download-count b {
    color: #1d1d1f;
    font-weight: 600;
    margin: 0 4px;
}

.download-size {
    margin-left: auto;
}

.download-count {
    margin-left: auto;
}

.download-meta-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

/* 锁标：仅注册用户可下载（金色，与 JLPT VIP 锁同色系） */
.download-lock-icon {
    width: 15px;
    height: 15px;
    stroke: #b8860b;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

/* VIP 徽标：仅 VIP 会员可下载（金色小胶囊） */
.download-vip-badge {
    padding: 1px 7px;
    border-radius: 6px;
    border: 1px solid #b8860b;
    color: #b8860b;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    line-height: 1.4;
    flex-shrink: 0;
}

/* 资源类型标签：可多个 */
.download-tag {
    padding: 2px 10px;
    border-radius: 999px;
    background: rgba(250, 35, 59, 0.08);
    color: #fa233b;
    font-size: 12px;
    white-space: nowrap;
}

/* 3. 下载按钮：红色圆角方块 + 白色下载图标 */
.download-btn {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 6px;
    background: #fa233b;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 0.2s;
}

.download-btn:hover {
    opacity: 0.85;
}

.download-btn svg {
    width: 20px;
    height: 20px;
    stroke: #fff;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* 4. 空态与加载态 */
.download-empty {
    padding: 60px 0;
    text-align: center;
}

.download-spinner {
    width: 28px;
    height: 28px;
    margin: 60px auto;
    border: 3px solid #e5e5e5;
    border-top-color: #fa233b;
    border-radius: 50%;
    animation: download-spin 0.8s linear infinite;
}

@keyframes download-spin {
    to { transform: rotate(360deg); }
}

/* 5. 登录门禁弹窗（样式对齐 JLPT VIP 门禁） */
.download-login-mask {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1200;
}

.download-login-dialog {
    background: #fff;
    border-radius: 12px;
    padding: 22px 28px 18px;
    width: 320px;
    text-align: center;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}

.download-login-dialog-lock {
    width: 34px;
    height: 34px;
    stroke: #b8860b;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.download-login-dialog-title {
    margin: 10px 0 6px;
    font-size: 16px;
    font-weight: 700;
    color: #1d1d1f;
}

.download-login-dialog-desc {
    margin: 0 0 16px;
    font-size: 13px;
    line-height: 1.6;
    color: rgba(29, 29, 31, 0.65);
}

.download-login-dialog-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.download-login-btn {
    display: inline-block;
    padding: 7px 18px;
    border-radius: 8px;
    border: 1px solid #d2d2d7;
    background: #fff;
    color: #1d1d1f;
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
}

.download-login-btn.primary {
    background: #fa233b;
    border-color: #fa233b;
    color: #fff;
}
