/* ========== 标题溢出修复（强制） ========== */
.link-card {
    position: relative;
    max-width: 100%;
    overflow: hidden;
}

.link-card .link-title {
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    word-break: break-all !important;
    word-wrap: break-word !important;
    white-space: normal !important;
    line-height: 1.3 !important;
    max-height: 2.6em !important;
    width: 100% !important;
    max-width: 100% !important;
}

/* 网格视图 */
.links:not(.list) .link-card {
    width: 100%;
    max-width: 100%;
}

.links:not(.list) .link-card .link-title {
    max-width: calc(100% - 10px) !important;
    font-size: 0.82rem !important;
}

/* 列表视图 */
.links.list .link-card .link-title {
    -webkit-line-clamp: 1 !important;
    max-height: 1.3em !important;
    max-width: 200px !important;
}

/* link-info 容器也要限制 */
.link-card .link-info {
    overflow: hidden;
    max-width: 100%;
    min-width: 0;
    flex: 1;
}

/* ========== 扩展模态框样式 ========== */
.ext-modal-bg {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.ext-modal {
    background: var(--bg-card, #fff);
    border-radius: 16px;
    max-width: 600px;
    width: 92%;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 10px 50px rgba(0,0,0,0.3);
}

.ext-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border, #eee);
    background: var(--bg-card, #fff);
    position: sticky;
    top: 0;
    z-index: 10;
}

.ext-modal-title { font-weight: 600; font-size: 1.1rem; }
.ext-modal-close { cursor: pointer; font-size: 1.5rem; opacity: 0.6; background: none; border: none; }
.ext-modal-close:hover { opacity: 1; }

.ext-modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(85vh - 60px);
}

/* 表单样式 */
.ext-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border, #ddd);
    border-radius: 8px;
    font-size: 0.95rem;
    box-sizing: border-box;
    background: var(--bg-card, #fff);
    color: var(--text-main, #333);
}

.ext-label { display: block; margin-bottom: 6px; font-weight: 500; font-size: 0.9rem; }
.ext-group { margin-bottom: 16px; }
.ext-row { display: flex; gap: 12px; }
.ext-row > * { flex: 1; }

/* 按钮 */
.ext-btn { padding: 10px 20px; border-radius: 8px; border: none; cursor: pointer; font-size: 0.95rem; }
.ext-btn-primary { background: #6366f1; color: #fff; }
.ext-btn-primary:hover { background: #5558e3; }
.ext-btn-ghost { background: transparent; border: 1px solid var(--border, #ddd); }
.ext-btn-ghost:hover { background: var(--bg-main, #f5f5f5); }
.ext-btn-danger { background: #fee2e2; color: #ef4444; }

/* 折叠面板 */
.ext-section { margin-bottom: 12px; border: 1px solid var(--border, #eee); border-radius: 10px; overflow: hidden; }
.ext-section-header { padding: 14px 16px; cursor: pointer; font-weight: 600; background: var(--bg-main, #f9f9f9); display: flex; justify-content: space-between; align-items: center; }
.ext-section-header:hover { background: var(--bg-hover, #f0f0f0); }
.ext-section-content { padding: 16px; line-height: 1.8; display: none; }
.ext-section.active .ext-section-content { display: block; }
.ext-section.active .ext-section-arrow { transform: rotate(180deg); }

/* 标签 */
.ext-tag { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 0.8rem; }
.ext-tag-ok { background: #dcfce7; color: #16a34a; }
.ext-tag-no { background: #f3f4f6; color: #6b7280; }

/* 信息框 */
.ext-info { padding: 14px; border-radius: 8px; margin: 12px 0; }
.ext-info-warn { background: #fffbeb; border-left: 4px solid #f59e0b; }
.ext-info-gray { background: var(--bg-main, #f3f4f6); }
