/* FriendLinks — 友情链接插件样式（浅色） */

.fl-page {
    --fl-brand: #ffd100;
    --fl-brand-soft: #fff3c2;
    --fl-text: #1b1d22;
    --fl-muted: #8a9098;
    --fl-line: #e9ebef;
    padding: 8px 2px 40px;
    color: var(--fl-text);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* 0.7.0：三个按钮统一盒模型与高度。
   主题常会给 a / label 设不同的 line-height、padding，只靠 padding 撑高度会让
   「友链列表 / 友链 RSS / 申请友链」高低不齐，这里改为固定高度 + 居中。 */
.fl-page .fl-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 6px 0 24px;
    flex-wrap: wrap;
    line-height: 1;
}

.fl-page .fl-toolbar > .fl-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    flex: 0 0 auto;
    align-self: center;
    height: 34px;
    margin: 0;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: #f1f2f5;
    color: #5a6068;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    vertical-align: middle;
    transition: background .16s ease, color .16s ease, border-color .16s ease;
}

.fl-page .fl-toolbar > .fl-chip:hover {
    background: #e7e9ee;
}

.fl-page .fl-toolbar > .fl-chip.is-on {
    background: var(--fl-brand);
    color: #101116;
    font-weight: 700;
}

/* 0.9.0：博客大全徽章区。不显示标题，只有一行徽章；用间距与下方友链卡片分开 */
.fl-badges {
    margin: 0 0 26px;
}

.fl-badge-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 14px;
}

.fl-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    max-width: 100%;
    text-decoration: none;
    transition: transform .16s ease, opacity .16s ease;
}

.fl-badge:hover {
    transform: translateY(-2px);
    opacity: .92;
}

.fl-badge img {
    display: block;
    width: auto;
    max-width: 100%;
    height: 32px;
    border: 0;
    border-radius: 4px;
    object-fit: contain;
}

.fl-badge-text {
    display: inline-flex;
    align-items: center;
    height: 28px;
    padding: 0 12px;
    background: #fff;
    border: 1px solid #e4e7ec;
    border-radius: 999px;
    color: #5a6068;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.fl-badge:hover .fl-badge-text {
    border-color: var(--fl-brand);
    color: #7a6500;
}

.fl-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 14px;
    margin-bottom: 30px;
}

.fl-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 16px 18px;
    background: #fff;
    border: 1px solid var(--fl-line);
    border-radius: 14px;
    text-decoration: none;
    color: inherit;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.fl-card:hover {
    transform: translateY(-2px);
    border-color: var(--fl-brand);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .06);
}

.fl-card.is-dead {
    opacity: .6;
}

.fl-card-top {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    margin-bottom: 6px;
}

.fl-icon {
    flex: 0 0 auto;
    font-size: 18px;
}

.fl-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--fl-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fl-dead {
    flex: 0 0 auto;
    margin-left: auto;
    padding: 1px 7px;
    border-radius: 6px;
    background: #fdecec;
    color: #c0392b;
    font-size: 10px;
    font-weight: 700;
}

.fl-desc {
    font-size: 12.5px;
    line-height: 1.6;
    color: #7b808a;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 8px;
}

.fl-rss-tag {
    align-self: flex-start;
    margin-bottom: 6px;
    padding: 1px 7px;
    border-radius: 6px;
    background: var(--fl-brand-soft);
    color: #7a6500;
    font-size: 10px;
    font-weight: 700;
}

.fl-url {
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px dashed var(--fl-line);
    color: #a8adb6;
    font-size: 11px;
    word-break: break-all;
}

.fl-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 34px 20px;
    margin-bottom: 24px;
    background: #fff;
    border: 1px dashed #dfe2e7;
    border-radius: 16px;
    text-align: center;
}

.fl-empty h3 {
    margin: 0;
    font-size: 15px;
}

.fl-empty p {
    margin: 0;
    color: var(--fl-muted);
    font-size: 13px;
}

/* 0.6.0：申请按钮并入工具条，点开后表单在下方展开（推开内容，不遮挡卡片） */
.fl-apply-check {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    opacity: 0;
    pointer-events: none;
}

.fl-page .fl-toolbar > .fl-chip-apply {
    background: #fff;
    border-color: var(--fl-brand);
    color: #7a6500;
    cursor: pointer;
    user-select: none;
}

.fl-page .fl-toolbar > .fl-chip-apply::before {
    content: '+';
    display: inline-block;
    margin-right: 6px;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    position: relative;
    top: -1px;
}

.fl-apply-check:checked ~ .fl-toolbar .fl-chip-apply {
    background: var(--fl-brand);
    border-color: var(--fl-brand);
    color: #101116;
}

.fl-apply-check:checked ~ .fl-toolbar .fl-chip-apply::before {
    content: '\2212';
}

.fl-page .fl-toolbar > .fl-chip-apply:hover {
    background: #fffdf4;
    border-color: var(--fl-brand);
}

.fl-apply-check:checked ~ .fl-toolbar .fl-chip-apply:hover {
    background: #f2c400;
    border-color: #f2c400;
}

.fl-apply-check:focus-visible ~ .fl-toolbar .fl-chip-apply {
    outline: 2px solid var(--fl-brand);
    outline-offset: 2px;
}

.fl-apply-body {
    display: none;
    margin: 0 0 22px;
    padding: 20px;
    background: #fafaf7;
    border: 1px solid var(--fl-line);
    border-radius: 16px;
}

.fl-apply-check:checked ~ .fl-apply-body {
    display: block;
}

.fl-feed-head h2 {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 800;
}

.fl-note,
.fl-feed-head p {
    margin: 0 0 16px;
    color: #9aa0aa;
    font-size: 12px;
}

.fl-note b {
    color: #c0392b;
}

.fl-msg {
    margin-bottom: 14px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
}

.fl-msg.is-ok {
    background: #eef7ee;
    color: #1a7f37;
}

.fl-msg.is-err {
    background: #fdecec;
    color: #c0392b;
}

.fl-form,
.fl-admin-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.fl-field,
.fl-admin-form label:not(.fl-admin-check) {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.fl-field > span,
.fl-admin-form label > span {
    color: #4a5058;
    font-size: 13px;
    font-weight: 600;
}

.fl-field > span b {
    color: #c0392b;
}

.fl-field input[type="text"],
.fl-field input[type="url"],
.fl-admin-form input[type="text"],
.fl-admin-form input[type="url"],
.fl-admin-form input[type="number"] {
    box-sizing: border-box;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #dfe2e7;
    border-radius: 9px;
    outline: none;
    background: #fff;
    color: var(--fl-text);
    font-size: 14px;
    transition: border-color .16s ease, box-shadow .16s ease;
}

.fl-field input:focus,
.fl-admin-form input:focus {
    border-color: var(--fl-brand);
    box-shadow: 0 0 0 3px rgba(255, 209, 0, .16);
}

.fl-check,
.fl-admin-check {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #5a6068;
    font-size: 13px;
    font-weight: 400;
    cursor: pointer;
}

.fl-hint {
    display: block;
    color: #9aa0aa;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.6;
}

.fl-submit {
    align-self: flex-start;
    padding: 10px 22px;
    border: 0;
    border-radius: 9px;
    background: var(--fl-brand);
    color: #101116;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.fl-submit:hover {
    filter: brightness(.96);
}

.fl-feed-head {
    margin-bottom: 18px;
}

.fl-feed {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.fl-feed-item {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 13px 16px;
    background: #fff;
    border: 1px solid var(--fl-line);
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: border-color .16s ease, background .16s ease;
}

.fl-feed-item:hover {
    border-color: var(--fl-brand);
    background: #fffdf4;
}

.fl-feed-site {
    flex: 0 0 auto;
    padding: 2px 9px;
    border-radius: 6px;
    background: var(--fl-brand-soft);
    color: #7a6500;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.fl-feed-title {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fl-feed-item time {
    flex: 0 0 auto;
    color: #a8adb6;
    font-size: 11px;
}

/* ---------------- 管理面板 ---------------- */

.fl-admin {
    --fl-brand: #ffd100;
    max-width: 960px;
    margin: 0 auto;
    padding: 28px 18px 60px;
    color: #1b1d22;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

.fl-admin h1 {
    margin: 0 0 10px;
    font-size: 21px;
}

.fl-admin h2 {
    margin: 0 0 12px;
    color: #5a6068;
    font-size: 15px;
}

.fl-admin-links {
    margin: 0 0 18px;
    color: #8a9098;
    font-size: 12px;
}

.fl-admin-links a {
    color: #a57600;
}

.fl-admin-sec {
    margin-bottom: 28px;
}

/* 0.7.0：顶部快捷操作区（检测 / 刷新 RSS / 导入 / 导出） */
.fl-quick {
    position: relative;
    margin: 0 0 24px;
    padding: 16px;
    background: #f7f8fa;
    border: 1px solid #e9ebef;
    border-radius: 12px;
}

/* 导入开关：纯 CSS 展开，表单就在顶部快捷区里，不额外跳页 */
.fl-import-check {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    opacity: 0;
    pointer-events: none;
}

.fl-quick-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px 18px;
}

.fl-quick-btns {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.fl-quick-btns--end {
    margin-left: auto;
}

.fl-quick-tip {
    margin: 12px 0 0;
    color: #8a9098;
    font-size: 12px;
    line-height: 1.7;
}

.fl-quick-stat {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0 0;
    padding-top: 12px;
    border-top: 1px dashed #e4e7ec;
}

.fl-quick-stat a {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 11px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #e4e7ec;
    color: #5a6068;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    transition: border-color .16s ease, background .16s ease;
}

.fl-quick-stat a:hover {
    border-color: var(--fl-brand);
    background: #fffdf4;
}

.fl-quick-stat a.is-pending {
    color: #9a6b00;
    border-color: #f2dfa2;
}

.fl-quick-stat a.is-approved {
    color: #1a7f37;
    border-color: #bfe3c9;
}

.fl-quick-stat a.is-rejected {
    color: #a03a2f;
    border-color: #f0c9c4;
}

.fl-quick-stat a.is-badge {
    color: #4a5b8a;
    border-color: #ccd6ec;
}

/* 导入面板（默认收起，点顶部「导入友链」展开） */
.fl-import-panel {
    display: none;
    margin-top: 14px;
    padding: 16px;
    background: #fff;
    border: 1px solid #e4e7ec;
    border-radius: 10px;
}

.fl-import-check:checked ~ .fl-import-panel {
    display: block;
}

.fl-import-check:checked ~ .fl-quick-bar .fl-import-label {
    background: #fff3c2;
    border-color: #f0d67a;
    color: #7a6500;
}

.fl-import-form {
    margin: 0;
}

.fl-import-row {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 12px;
}

.fl-import-file {
    display: flex;
    flex: 1 1 280px;
    min-width: 220px;
    flex-direction: column;
    gap: 6px;
}

.fl-import-file > span {
    color: #4a5058;
    font-size: 12px;
    font-weight: 600;
}

.fl-import-form input[type="file"] {
    box-sizing: border-box;
    width: 100%;
    padding: 6px 10px;
    background: #fff;
    border: 1px dashed #d8dce3;
    border-radius: 8px;
    color: #5a6068;
    font-size: 12px;
}

.fl-import-form input[type="file"]::file-selector-button {
    margin-right: 10px;
    padding: 3px 10px;
    border: 1px solid #dfe2e7;
    border-radius: 6px;
    background: #f6f7f9;
    color: #3a4048;
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
}

.fl-import-form input[type="file"]::file-selector-button:hover {
    background: #eceef2;
}

.fl-import-check:focus-visible ~ .fl-quick-bar .fl-import-label {
    outline: 2px solid #1a7f37;
    outline-offset: 2px;
}

.fl-import-form .fl-admin-check {
    padding-bottom: 8px;
    color: #5a6068;
    font-size: 12px;
    white-space: nowrap;
}

.fl-import-form .fl-btn {
    flex: 0 0 auto;
}

.fl-import-form .fl-hint {
    margin: 10px 0 0;
}

/* 0.6.0：待审核 / 已通过 / 已拒绝 分组可展开收起 */
.fl-sec {
    background: #fbfbfc;
    border: 1px solid #e9ebef;
    border-left-width: 3px;
    border-radius: 12px;
    margin-bottom: 12px;
}

.fl-sec.is-pending {
    border-left-color: #f0b400;
}

.fl-sec.is-approved {
    border-left-color: #1a7f37;
}

.fl-sec.is-rejected {
    border-left-color: #c0392b;
}

.fl-sec > summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    list-style: none;
    cursor: pointer;
    user-select: none;
}

.fl-sec > summary::-webkit-details-marker {
    display: none;
}

.fl-sec > summary::after {
    content: '展开';
    margin-left: auto;
    color: #9aa0aa;
    font-size: 12px;
}

.fl-sec[open] > summary::after {
    content: '收起';
}

.fl-sec-title {
    font-size: 14px;
    font-weight: 700;
    color: #1b1d22;
}

.fl-sec-count {
    min-width: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #e4e7ec;
    color: #6a7178;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
}

.fl-sec-body {
    padding: 2px 14px 4px;
}

.fl-add-sec {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px dashed #e4e7ec;
}

/* ---------------- 0.8.0 博客大全徽章管理 ---------------- */

.fl-badge-sec {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px dashed #e4e7ec;
}

.fl-badge-sec h2 {
    display: flex;
    align-items: center;
    gap: 8px;
}

.fl-badge-tip {
    margin: -4px 0 14px;
}

.fl-badge-card {
    padding: 12px 14px;
}

.fl-badge-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.fl-badge-thumb {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    height: 38px;
    padding: 0 8px;
    background: #fff;
    border: 1px solid #eef0f4;
    border-radius: 8px;
}

.fl-badge-thumb img {
    display: block;
    width: auto;
    max-width: 150px;
    height: 30px;
    object-fit: contain;
}

.fl-badge-thumb .fl-badge-ph {
    color: #9aa0aa;
    font-size: 11px;
}

.fl-badge-info {
    flex: 1 1 220px;
    min-width: 0;
}

.fl-badge-img-url {
    margin-top: 3px;
    color: #a8adb6;
    font-size: 11px;
    word-break: break-all;
}

.fl-badge-sort {
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: 6px;
    background: #f1f2f5;
    color: #8a9098;
    font-size: 10px;
    font-weight: 700;
}

.fl-badge-btns {
    margin-top: 0;
    flex: 0 0 auto;
}

.fl-badge-add {
    margin-top: 4px;
    padding: 16px;
    background: #fff;
    border: 1px dashed #dfe2e7;
    border-radius: 12px;
}

.fl-badge-add h3 {
    margin: 0;
    color: #5a6068;
    font-size: 13px;
    font-weight: 700;
}

form.fl-badge-add.fl-admin-form {
    max-width: 560px;
}

.fl-badge-add label.fl-sort-field input {
    width: 96px;
}

.fl-admin-card {
    padding: 14px 16px;
    margin-bottom: 10px;
    background: #fff;
    border: 1px solid #e9ebef;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
}

.fl-admin-card.fl-muted {
    color: #9aa0aa;
    font-size: 13px;
}

.fl-admin-name {
    font-weight: 700;
    font-size: 14px;
}

.fl-admin-url,
.fl-admin-desc,
.fl-admin-rss {
    margin-top: 4px;
    color: #6a7178;
    font-size: 12px;
    word-break: break-all;
}

.fl-admin-desc {
    color: #8a9098;
}

.fl-admin-rss {
    color: #b06500;
}

.fl-alive {
    color: #1a7f37;
    font-size: 11px;
}

.fl-dead {
    color: #c0392b;
}

.fl-unknown {
    color: #9aa0aa;
    font-size: 11px;
}

.fl-auth {
    padding: 1px 7px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
}

.fl-auth.on {
    background: #fff3c2;
    color: #7a6500;
}

.fl-auth.off {
    background: #f1f2f5;
    color: #8a9098;
}

.fl-admin-btns {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.fl-inline {
    display: flex;
    margin: 0;
}

.fl-admin-form .fl-btn {
    align-self: flex-start;
}

.fl-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    height: 32px;
    padding: 0 14px;
    border: 1px solid #dfe2e7;
    border-radius: 8px;
    background: #fff;
    color: #3a4048;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background .16s ease, border-color .16s ease, color .16s ease;
}

.fl-btn:hover {
    background: #f6f7f9;
    border-color: #c9ced6;
}

.fl-btn.ok {
    background: #1a7f37;
    border-color: #1a7f37;
    color: #fff;
}

.fl-btn.ok:hover {
    background: #166b2e;
    border-color: #166b2e;
}

.fl-btn.bad {
    background: #c0392b;
    border-color: #c0392b;
    color: #fff;
}

.fl-btn.bad:hover {
    background: #a93226;
    border-color: #a93226;
}

.fl-btn.del {
    color: #c0392b;
    border-color: #edc9c4;
}

.fl-btn.del:hover {
    background: #fdf2f1;
    border-color: #d98b80;
}

.fl-btn.brand {
    background: #fff7d6;
    border-color: #f0d67a;
    color: #7a6500;
}

.fl-btn.brand:hover {
    background: #fff1b8;
    border-color: #e8c95a;
}

.fl-import-label {
    cursor: pointer;
    user-select: none;
}

.fl-import-label::after {
    content: '';
    width: 0;
    height: 0;
    margin-left: 7px;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
    opacity: .6;
    transition: transform .16s ease;
}

.fl-import-check:checked ~ .fl-quick-bar .fl-import-label::after {
    transform: rotate(180deg);
}

.fl-admin-edit {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dashed #e9ebef;
}

.fl-admin-edit summary {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #6a7178;
    font-size: 12px;
    cursor: pointer;
    list-style: none;
}

/* 默认三角标记在嵌套 details 里会跑到分区左侧，改用自绘箭头 */
.fl-admin-edit summary::-webkit-details-marker {
    display: none;
}

.fl-admin-edit summary::before {
    content: '\25B8';
    color: #8a9098;
    font-size: 12px;
    line-height: 1;
}

.fl-admin-edit[open] summary::before {
    content: '\25BE';
}

.fl-admin-edit .fl-admin-form {
    margin-top: 12px;
    max-width: 520px;
}

@media (max-width: 560px) {
    .fl-grid {
        grid-template-columns: 1fr;
    }

    .fl-badges {
        margin-bottom: 20px;
    }

    .fl-badge-list {
        gap: 10px 12px;
    }

    .fl-badge img {
        height: 28px;
    }

    .fl-page .fl-toolbar {
        gap: 8px;
    }

    .fl-page .fl-toolbar > .fl-chip {
        height: 32px;
        padding: 0 14px;
    }

    .fl-feed-item {
        flex-wrap: wrap;
        gap: 6px;
    }

    .fl-feed-title {
        flex-basis: 100%;
        white-space: normal;
    }

    .fl-quick {
        padding: 14px;
    }

    .fl-quick-bar {
        gap: 10px;
    }

    .fl-quick-btns {
        gap: 8px;
    }

    .fl-quick-btns--end {
        margin-left: 0;
    }

    .fl-import-form .fl-admin-check {
        padding-bottom: 0;
        white-space: normal;
    }
}
