/* 友情链接插件样式（fl- 前缀作用域，不覆盖主题） */
.fl-section {
    background: var(--bg-card, #fff);
    border: 1px solid var(--border-light, #e2e8f0);
    border-radius: var(--radius-md, 12px);
    padding: 18px 20px;
    margin: 18px 0 0;
}

.fl-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.fl-head h2 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary, #1e293b);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.fl-head h2 i {
    color: var(--accent, #b8860b);
}

.fl-apply-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--border-medium, #cbd5e1);
    background: transparent;
    color: var(--text-secondary, #475569);
    font-size: 12.5px;
    padding: 6px 12px;
    border-radius: var(--radius-sm, 8px);
    cursor: pointer;
    transition: all .18s ease;
}

.fl-apply-btn:hover {
    border-color: var(--accent, #b8860b);
    color: var(--accent, #b8860b);
}

.fl-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    line-height: 1.9;
}

.fl-item {
    color: var(--text-secondary, #475569);
    font-size: 13px;
    text-decoration: none;
    transition: color .15s ease;
}

.fl-item:hover {
    color: var(--accent, #b8860b);
}

.fl-item-desc { display: none; }

.fl-empty {
    color: var(--text-muted, #94a3b8);
    font-size: 13px;
}

/* ===== 百搭样式：无背景、无阴影、不依赖主题变量 ===== */
.fl-section--flow,
.fl-section--outline,
.fl-section--columns,
.fl-section--ledger {
    background: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    max-width: 1180px;
    margin: 18px auto 22px;
}

.fl-section--flow .fl-head,
.fl-section--outline .fl-head,
.fl-section--columns .fl-head,
.fl-section--ledger .fl-head {
    margin-bottom: 10px;
}

.fl-section--flow .fl-head h2,
.fl-section--outline .fl-head h2,
.fl-section--columns .fl-head h2,
.fl-section--ledger .fl-head h2 {
    font-size: 13px;
    font-weight: 400;
    color: inherit;
    opacity: .55;
}

.fl-section--flow .fl-head h2 i,
.fl-section--outline .fl-head h2 i,
.fl-section--columns .fl-head h2 i,
.fl-section--ledger .fl-head h2 i {
    display: none;
}

.fl-section--flow .fl-apply-btn,
.fl-section--outline .fl-apply-btn,
.fl-section--columns .fl-apply-btn,
.fl-section--ledger .fl-apply-btn {
    background: none;
    border: 0;
    padding: 0;
    font-size: 12.5px;
    color: inherit;
    opacity: .55;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.fl-section--flow .fl-apply-btn:hover,
.fl-section--outline .fl-apply-btn:hover,
.fl-section--columns .fl-apply-btn:hover,
.fl-section--ledger .fl-apply-btn:hover {
    opacity: 1;
    color: inherit;
}

.fl-section--flow .fl-item,
.fl-section--outline .fl-item,
.fl-section--columns .fl-item,
.fl-section--ledger .fl-item {
    color: inherit;
    opacity: .78;
}

.fl-section--flow .fl-item:hover,
.fl-section--outline .fl-item:hover,
.fl-section--columns .fl-item:hover,
.fl-section--ledger .fl-item:hover {
    color: var(--accent, currentColor);
    opacity: 1;
}

.fl-section--flow .fl-item:hover .fl-item-name,
.fl-section--columns .fl-item:hover .fl-item-name,
.fl-section--ledger .fl-item:hover .fl-item-name {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* 1 · 纯文字流 */
.fl-section--flow .fl-links {
    gap: 4px 26px;
    line-height: 1.9;
    font-size: 13px;
}

.fl-section--flow .fl-item-desc { display: none; }

/* 2 · 细线标签 */
.fl-section--outline .fl-links {
    gap: 8px;
    font-size: 12.5px;
    line-height: 1.5;
}

.fl-section--outline .fl-item {
    border: 1px solid rgba(128, 128, 128, .32);
    border-radius: 3px;
    padding: 3px 10px;
    transition: border-color .15s ease, opacity .15s ease;
}

.fl-section--outline .fl-item:hover {
    border-color: var(--accent, currentColor);
    text-decoration: none;
}

.fl-section--outline .fl-item-desc { display: none; }

/* 3 · 双行留白网格 */
.fl-section--columns .fl-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 10px 26px;
    line-height: 1.5;
}

.fl-section--columns .fl-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.fl-section--columns .fl-item-name {
    font-size: 13px;
}

.fl-section--columns .fl-item-desc {
    display: block;
    font-size: 11.5px;
    opacity: .5;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 4 · 目录式两列 */
.fl-section--ledger .fl-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 34px;
    font-size: 13px;
    line-height: 1.6;
}

.fl-section--ledger .fl-item {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(128, 128, 128, .18);
    text-decoration: none;
}

.fl-section--ledger .fl-item-name {
    flex: none;
    max-width: 62%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fl-section--ledger .fl-item-desc {
    display: block;
    flex: 1;
    min-width: 0;
    font-size: 11.5px;
    opacity: .45;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===== 主题：卡片网格 ===== */
.fl-section--cards .fl-links {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    line-height: 1.6;
}

.fl-section--cards .fl-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    border: 1px solid var(--border-light, #e2e8f0);
    border-radius: var(--radius-sm, 8px);
    padding: 12px 14px;
    background: var(--bg-card, #fff);
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.fl-section--cards .fl-item:hover {
    border-color: var(--accent, #b8860b);
    box-shadow: 0 6px 18px rgba(15, 23, 42, .08);
    transform: translateY(-1px);
}

.fl-section--cards .fl-item-name {
    font-weight: 600;
    color: var(--text-primary, #1e293b);
}

.fl-section--cards .fl-item-desc {
    display: block;
    font-size: 12px;
    color: var(--text-muted, #94a3b8);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===== 主题：胶囊标签 ===== */
.fl-section--chips .fl-links {
    gap: 8px 10px;
}

.fl-section--chips .fl-item {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border: 1px solid var(--border-light, #e2e8f0);
    border-radius: 999px;
    background: var(--bg-sidebar, #f1f5f9);
    font-size: 12.5px;
    transition: all .15s ease;
}

.fl-section--chips .fl-item:hover {
    border-color: var(--accent, #b8860b);
    background: #f8fafc;
    color: var(--accent, #b8860b);
}

.fl-expire-warn {
    margin: 0 0 10px;
    font-size: 12.5px;
    color: var(--accent, #b8860b);
}

/* ===== 申请弹窗 ===== */
.fl-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.fl-modal[hidden] { display: none; }

.fl-mask {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .45);
    backdrop-filter: blur(2px);
}

.fl-dialog {
    position: relative;
    width: 100%;
    max-width: 460px;
    background: var(--bg-card, #fff);
    border-radius: var(--radius-lg, 20px);
    padding: 26px 26px 22px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .25);
    animation: fl-pop .22s ease;
}

@keyframes fl-pop {
    from { opacity: 0; transform: translateY(12px) scale(.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.fl-close {
    position: absolute;
    top: 14px;
    right: 16px;
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    color: var(--text-muted, #94a3b8);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    border-radius: 50%;
    transition: all .15s ease;
}

.fl-close:hover { background: var(--bg-sidebar, #f1f5f9); color: var(--text-primary, #1e293b); }

.fl-dialog h3 {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary, #1e293b);
    margin: 0 0 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.fl-dialog h3 i { color: var(--accent, #b8860b); }

.fl-tip {
    font-size: 12.5px;
    color: var(--text-muted, #94a3b8);
    margin: 0 0 18px;
}

.fl-field { margin-bottom: 14px; }

.fl-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.fl-field label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary, #475569);
    margin-bottom: 6px;
}

.fl-field label em { color: var(--danger, #ef4444); font-style: normal; }

.fl-field input,
.fl-field textarea {
    width: 100%;
    border: 1px solid var(--border-medium, #cbd5e1);
    border-radius: var(--radius-sm, 8px);
    padding: 9px 12px;
    font-size: 13.5px;
    color: var(--text-primary, #1e293b);
    background: #fff;
    transition: border-color .15s ease, box-shadow .15s ease;
    box-sizing: border-box;
}

.fl-field input:focus,
.fl-field textarea:focus {
    outline: none;
    border-color: var(--accent, #b8860b);
    box-shadow: 0 0 0 3px rgba(184, 134, 11, .12);
}

.fl-field textarea { resize: vertical; }

.fl-submit {
    width: 100%;
    margin-top: 4px;
    border: none;
    border-radius: var(--radius-sm, 8px);
    background: var(--primary, #333);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    padding: 11px;
    cursor: pointer;
    transition: background .18s ease;
}

.fl-submit:hover { background: var(--primary-dark, #000); }
.fl-submit[disabled] { opacity: .6; cursor: not-allowed; }

.fl-msg {
    margin: 10px 0 0;
    font-size: 13px;
    text-align: center;
    min-height: 18px;
}

.fl-msg.ok { color: var(--success, #10b981); }
.fl-msg.err { color: var(--danger, #ef4444); }

@media (max-width: 640px) {
    .fl-row { grid-template-columns: 1fr; gap: 0; }
    .fl-dialog { padding: 22px 18px 18px; }
    .fl-section--ledger .fl-links { grid-template-columns: 1fr; gap: 0; }
    .fl-section--flow .fl-links { gap: 4px 18px; }
}
