/*
样式文件：Fu's 工具包样式
功能：定义网站的视觉样式和响应式布局
*/

/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 导航栏样式 */
.navbar {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
    text-decoration: none;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: #007bff;
}

/* 导航栏登录态（用户名 + 退出按钮） */
.nav-user {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.nav-username {
    color: #666;
    font-size: 14px;
}

.nav-logout {
    margin: 0;
}

.nav-logout-btn {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    font-size: 14px;
    cursor: pointer;
}

/* 主要内容区域 */
.main-content {
    margin-top: 0;
    min-height: calc(100vh - 120px);
}

/* 英雄区域样式（旧版首页遗留，当前无页面使用） */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 100px 0;
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.hero-title {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero-subtitle {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.hero-description {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    opacity: 0.8;
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-primary:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: transparent;
    color: white;
    border: 2px solid white;
}

.btn-secondary:hover {
    background-color: white;
    color: #333;
}

/* 关于区域样式（旧版首页遗留，当前无页面使用） */
.about {
    padding: 80px 0;
    background-color: white;
}

.about h2 {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2.5rem;
    color: #333;
}

.about-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    align-items: start;
}

.about-text p {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    line-height: 1.7;
}

.about-links h3 {
    margin-bottom: 1rem;
    color: #333;
}

.contact-list {
    list-style: none;
}

.contact-list li {
    margin-bottom: 0.5rem;
    padding: 0.5rem 0;
}

.contact-list a {
    color: #007bff;
    text-decoration: none;
}

.contact-list a:hover {
    text-decoration: underline;
}

/* 项目展示区域样式（旧版首页遗留，当前无页面使用） */
.projects-section {
    padding: 40px 0 80px 0;
    background-color: #f8f9fa;
}

.projects-section h2 {
    text-align: center;
    margin-bottom: 1rem;
    font-size: 2.5rem;
    color: #333;
}

.section-subtitle {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 1.1rem;
    color: #6c757d;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.project-card {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.project-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #333;
}

.project-description {
    margin-bottom: 1.5rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-technologies {
    margin-bottom: 1.5rem;
}

.tech-tag {
    display: inline-block;
    background-color: #e9ecef;
    color: #495057;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.project-link {
    color: #007bff;
    text-decoration: none;
    font-weight: 600;
}

.project-link:hover {
    text-decoration: underline;
}

.no-projects {
    text-align: center;
    padding: 3rem;
    color: #6c757d;
}

/* 错误页面样式 */
.error-page {
    padding: 100px 0;
    text-align: center;
}

.error-content h1 {
    font-size: 6rem;
    color: #dc3545;
    margin-bottom: 1rem;
}

.error-content h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #333;
}

.error-content p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    color: #6c757d;
}

/* 页脚样式 */
.footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 2rem 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

    .about-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .projects-container {
        grid-template-columns: 1fr;
    }

    .nav-menu {
        gap: 1rem;
    }

    .hero-actions {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 200px;
    }
}

/* =========================================================
   首页对称两栏布局（重构版）
   桌面：等宽等高两栏；平板：收窄留白；手机：单栏堆叠
   ========================================================= */

.page {
    max-width: 1160px;
    margin: 0 auto;
    padding: 56px 28px 72px;
}

.page-head {
    margin-bottom: 40px;
}

.page-title {
    font-size: 27px;
    font-weight: 700;
    letter-spacing: 0.2px;
    color: #24292f;
}

.page-sub {
    color: #6c7686;
    font-size: 15px;
    margin-top: 10px;
}

/* 对称两栏：minmax(0,1fr) 防止长内容撑破，stretch 保证等高；
   行间距略大于列间距，避免第二行功能块与第一行视觉上粘连 */
.home-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 32px;
    row-gap: 40px;
    align-items: stretch;
}

.block {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: #fff;
    border-radius: 18px;
    padding: 34px 34px 36px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.03),
                0 24px 48px -32px rgba(16, 24, 40, 0.16);
    min-height: 460px;
}

.block-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 30px;
}

.block-title {
    font-size: 19px;
    font-weight: 700;
    display: flex;
    align-items: baseline;
    gap: 10px;
    color: #24292f;
}

.block-index {
    font-size: 12px;
    font-weight: 700;
    color: #4a6cf7;
    letter-spacing: 1px;
}

.block-note {
    font-size: 13px;
    color: #9aa4b2;
    margin-top: 8px;
}

/* 二级页入口占位：功能复杂时启用，当前封存不可点 */
.block-link {
    flex: none;
    font-size: 12px;
    color: #9aa4b2;
    text-decoration: none;
    cursor: not-allowed;
    white-space: nowrap;
}

.block-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 22px;
    min-height: 0;
}

.field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #6c7686;
    margin-bottom: 10px;
}

.field textarea {
    width: 100%;
    min-height: 156px;
    resize: vertical;
    padding: 16px 18px;
    font: inherit;
    font-size: 16px; /* ≥16px：防 iOS 聚焦自动放大 */
    line-height: 1.7;
    color: #24292f;
    background: #fbfcfe;
    border: 1px solid #edf0f5;
    border-radius: 12px;
}

.field input {
    width: 100%;
    min-height: 48px;
    padding: 12px 18px;
    font: inherit;
    font-size: 16px; /* ≥16px：防 iOS 聚焦自动放大 */
    color: #24292f;
    background: #fbfcfe;
    border: 1px solid #edf0f5;
    border-radius: 12px;
}

.field textarea::placeholder,
.field input::placeholder {
    color: #a9b2c0;
}

.field textarea:focus,
.field input:focus {
    outline: none;
    border-color: #4a6cf7;
}

/* 隐藏元素（JS 控制显隐） */
.hidden {
    display: none !important;
}

/* 表单状态提示（结果区下方） */
.form-status {
    min-height: 20px;
    font-size: 13px;
    color: #9aa4b2;
    text-align: center;
}

/* 登录页错误提示（红色，区别于普通提示灰字） */
.form-status.error {
    color: #e5484d;
}

/* 登录页：居中卡片 */
.login-wrap {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 70vh;
    padding: 56px 28px 72px;
}

.login-card {
    max-width: 380px;
    width: 100%;
}

/* 登录表单：字段与按钮同款 22px 间距（表单不是 .block-body 直接子级，gap 不生效，需自行撑开） */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.block-actions {
    display: flex;
}

.btn-main {
    width: 100%;
    min-height: 46px;
    border: none;
    border-radius: 12px;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    background: #4a6cf7;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-main:hover:not(:disabled) {
    background: #3b5cdb;
}

.btn-main:disabled {
    background: #d9e0f4;
    color: #fff;
    cursor: not-allowed;
}

/* 结果区：限高 + 块内滚动，不撑高卡片 */
.result-box {
    flex: 1;
    min-height: 152px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border: 1px dashed #dfe4ec;
    border-radius: 12px;
    color: #9aa4b2;
    font-size: 13px;
    text-align: center;
    overflow: auto;
}

/* 平板过渡 */
@media (max-width: 1024px) {
    .page {
        padding: 44px 22px 56px;
    }

    .home-grid {
        column-gap: 24px;
        row-gap: 32px;
    }

    .block {
        padding: 28px;
        min-height: 420px;
    }
}

/* 手机：单栏堆叠 */
@media (max-width: 768px) {
    .home-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        row-gap: 26px;
    }

    .page {
        padding: 32px 16px 44px;
    }

    .page-head {
        margin-bottom: 26px;
    }

    .page-title {
        font-size: 22px;
    }

    .page-sub {
        font-size: 14px;
        margin-top: 8px;
    }

    .block {
        padding: 24px 20px 26px;
        border-radius: 16px;
        min-height: 0;
    }

    .block-head {
        margin-bottom: 22px;
    }

    .block-title {
        font-size: 17px;
    }

    .block-body {
        gap: 18px;
    }

    .field textarea {
        min-height: 132px;
        padding: 14px;
    }

    .btn-main {
        min-height: 44px;
    }

    .result-box {
        min-height: 120px;
    }
}

/* =========================================================
   主题管理（首页右栏块）
   ========================================================= */

/* 新增表单：紧凑两列（档位 + 来源），手机转单列 */
.topic-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.topic-form-row {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 14px;
}

/* 下拉选择样式（与 .field input 视觉一致） */
.field select {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    font: inherit;
    font-size: 16px; /* ≥16px：防 iOS 聚焦自动放大 */
    color: #24292f;
    background: #fbfcfe;
    border: 1px solid #edf0f5;
    border-radius: 12px;
    cursor: pointer;
}

.field select:focus {
    outline: none;
    border-color: #4a6cf7;
}

/* 来源类别复选：覆盖 .field input 的整宽样式，仅 checkbox 本身生效 */
.topic-cats {
    display: flex;
    align-items: center;
    gap: 20px;
    min-height: 48px;
    padding: 0 6px;
}

.cat-item {
    display: inline-flex;
    align-items: center;
    font-size: 15px;
    line-height: 1;
    color: #24292f;
    cursor: pointer;
}

/* 间距用 margin 显式提供（不依赖 flex gap），兼容更稳 */
.cat-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    min-height: 0;
    margin: 0 8px 0 0;
    padding: 0;
    flex: none;
    vertical-align: middle;
    accent-color: #4a6cf7;
}

/* 文字行高收紧，使 16px 复选框与 15px 文字严格垂直居中 */
.cat-text {
    line-height: 1;
}

/* 高级选项（关注点）：默认折叠，展开时显示输入框 */
.topic-advanced {
    font-size: 13px;
    color: #9aa4b2;
}

.topic-advanced summary {
    cursor: pointer;
    padding: 4px 0;
    user-select: none;
    list-style: none;
}

.topic-advanced summary::-webkit-details-marker {
    display: none;
}

.topic-advanced summary::before {
    content: '▸ ';
    color: #9aa4b2;
    font-size: 11px;
}

.topic-advanced[open] summary::before {
    content: '▾ ';
}

.topic-advanced .field {
    margin-top: 10px;
}

/* 计数与列表折叠开关：整行可点，计数靠左、箭头靠右 */
.topic-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    background: #fbfcfe;
    border: 1px solid #edf0f5;
    border-radius: 12px;
    font: inherit;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.topic-toggle:hover {
    border-color: #4a6cf7;
}

.topic-caret {
    font-size: 12px;
    color: #9aa4b2;
    transition: transform 0.2s ease;
}

.topic-toggle.expanded .topic-caret {
    transform: rotate(90deg);
}

/* 计数行：靠左显示（置于折叠开关内），达到建议/上限数量时变色提示 */
.topic-count {
    font-size: 12px;
    color: #9aa4b2;
    text-align: left;
}

.topic-count.warn {
    color: #d48806;
}

.topic-count.danger {
    color: #d4380d;
}

/* 主题列表：默认折叠（JS 加 .visible 显示），展开后限高滚动 */
.topic-list {
    display: none;
    max-height: 220px;
    overflow-y: auto;
    flex-direction: column;
    gap: 10px;
    padding: 2px;
}

.topic-list.visible {
    display: flex;
}

.topic-empty {
    flex: 1;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed #dfe4ec;
    border-radius: 12px;
    color: #9aa4b2;
    font-size: 13px;
}

/* 主题行 */
.topic-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid #edf0f5;
    border-radius: 12px;
    background: #fbfcfe;
}

.topic-item-main {
    flex: 1;
    min-width: 0;
}

.topic-item-name {
    font-size: 15px;
    font-weight: 600;
    color: #24292f;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topic-item-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 7px;
    font-size: 12px;
    color: #9aa4b2;
}

/* 状态徽标与档位/来源标签 */
.topic-badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    flex: none;
}

.topic-badge.on {
    background: #e6f7ee;
    color: #1a9d5a;
}

.topic-badge.off {
    background: #eef0f4;
    color: #8a94a6;
}

.tag {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 6px;
    font-size: 11px;
    background: #eef1fb;
    color: #4a6cf7;
}

.topic-item-actions {
    display: flex;
    gap: 6px;
    flex: none;
}

.btn-mini {
    padding: 6px 12px;
    border: 1px solid #dfe4ec;
    border-radius: 8px;
    font: inherit;
    font-size: 12px;
    background: #fff;
    color: #6c7686;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.btn-mini:hover {
    border-color: #4a6cf7;
    color: #4a6cf7;
}

.btn-mini.danger:hover {
    border-color: #e54d42;
    color: #e54d42;
}

/* 编辑弹窗 */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(16, 24, 40, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.modal {
    width: 100%;
    max-width: 440px;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    background: #fff;
    border-radius: 18px;
    padding: 26px 26px 24px;
    box-shadow: 0 24px 64px -24px rgba(16, 24, 40, 0.4);
}

.modal-title {
    font-size: 17px;
    font-weight: 700;
    color: #24292f;
    margin-bottom: 4px;
}

.modal-id {
    font-size: 12px;
    color: #9aa4b2;
    margin-bottom: 20px;
    word-break: break-all;
}

.modal .field {
    margin-bottom: 16px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.modal-actions .btn-main {
    flex: 1;
}

.btn-ghost {
    flex: 1;
    min-height: 46px;
    border: 1px solid #dfe4ec;
    border-radius: 12px;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    background: #fff;
    color: #6c7686;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.btn-ghost:hover {
    border-color: #4a6cf7;
    color: #4a6cf7;
}

/* 手机：新增表单转单列，弹窗收窄 */
@media (max-width: 768px) {
    .topic-form-row {
        grid-template-columns: 1fr;
    }

    .modal {
        padding: 20px 18px;
        max-height: calc(100vh - 60px);
    }
}

/* =========================================================
   复用语管理：首页第三块 + 二级页（/phrases）
   ========================================================= */

/* HTML hidden 属性兜底：防止自定义 display 覆盖 UA 样式（如 .toast 的 fixed） */
[hidden] {
    display: none !important;
}

/* 首页第三块到二级页的入口链接（"查看全部 →"） */
.block-link-go {
    flex: none;
    font-size: 12px;
    color: #9aa4b2;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.block-link-go:hover {
    color: #4a6cf7;
}

/* 首页快速添加：上下流式排列（内容 → 标签 → 按钮），由 .block-body 的纵向 gap 撑开 */

/* 首页收藏预览 */
.ph-home-preview {
    border-top: 1px dashed #dfe4ec;
    padding-top: 20px;
}

.ph-home-preview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.ph-home-preview-title {
    font-size: 13px;
    font-weight: 600;
    color: #6c7686;
}

.ph-home-fav-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.ph-home-fav-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 16px;
    border: 1px solid #edf0f5;
    border-radius: 12px;
    background: #fbfcfe;
}

.ph-home-fav-content {
    font-size: 14px;
    line-height: 1.6;
    color: #24292f;
    word-break: break-word;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.ph-home-fav-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.ph-home-fav-tag {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 6px;
    font-size: 11px;
    background: #eef1fb;
    color: #4a6cf7;
}

.ph-home-fav-empty {
    padding: 20px;
    border: 1px dashed #dfe4ec;
    border-radius: 12px;
    color: #9aa4b2;
    font-size: 13px;
    text-align: center;
}

/* ---------- 二级页：工具栏 ---------- */
.ph-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.ph-search {
    position: relative;
    flex: 1;
    max-width: 420px;
}

.ph-search input {
    width: 100%;
    min-height: 46px;
    padding: 10px 38px 10px 18px;
    font: inherit;
    font-size: 16px; /* ≥16px：防 iOS 聚焦自动放大 */
    color: #24292f;
    background: #fbfcfe;
    border: 1px solid #edf0f5;
    border-radius: 12px;
    outline: none;
}

.ph-search input:focus {
    border-color: #4a6cf7;
}

.ph-search-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: #9aa4b2;
    font-size: 18px;
    cursor: pointer;
    padding: 0 6px;
    line-height: 1;
}

.ph-toolbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.ph-result-info {
    font-size: 13px;
    color: #9aa4b2;
}

.ph-add-btn {
    width: auto;
    padding: 0 22px;
    flex: none;
}

/* ---------- 二级页：标签筛选 chips ---------- */
.ph-cats {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.ph-chip {
    padding: 7px 14px;
    border: 1px solid #edf0f5;
    border-radius: 20px;
    font: inherit;
    font-size: 13px;
    background: #fff;
    color: #6c7686;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.ph-chip:hover {
    border-color: #4a6cf7;
    color: #4a6cf7;
}

.ph-chip.active {
    background: #4a6cf7;
    border-color: #4a6cf7;
    color: #fff;
}

.ph-cats-manage {
    margin-left: auto;
    padding: 7px 14px;
    border: 1px dashed #dfe4ec;
    border-radius: 20px;
    font: inherit;
    font-size: 13px;
    background: #fff;
    color: #9aa4b2;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.ph-cats-manage:hover {
    border-color: #4a6cf7;
    color: #4a6cf7;
}

/* ---------- 二级页：条目列表 ---------- */
.ph-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ph-card {
    background: #fff;
    border: 1px solid #edf0f5;
    border-radius: 14px;
    padding: 16px 18px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.ph-card-head {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.ph-card-title {
    flex: 1;
    min-width: 0;
    font-size: 15px;
    line-height: 1.7;
    color: #24292f;
    white-space: pre-wrap;
    word-break: break-word;
}

/* 收藏切换按钮：☆/★ */
.ph-fav {
    flex: none;
    border: none;
    background: transparent;
    font-size: 18px;
    line-height: 1;
    color: #c4cbd6;
    cursor: pointer;
    padding: 2px 0 0;
    transition: color 0.2s ease;
}

.ph-fav:hover {
    color: #f5a623;
}

.ph-fav.on {
    color: #f5a623;
}

.ph-note {
    margin-top: 8px;
    font-size: 13px;
    color: #6c7686;
    word-break: break-word;
}

.ph-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #edf0f5;
    font-size: 12px;
    color: #9aa4b2;
}

.ph-cat-tag {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 6px;
    font-size: 11px;
    background: #eef1fb;
    color: #4a6cf7;
    margin-right: 6px;
}

.ph-card-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.ph-empty {
    text-align: center;
    color: #9aa4b2;
    padding: 60px 20px;
    font-size: 14px;
}

/* ---------- 二级页：模态框细节 ---------- */
.ph-content-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.ph-content-row textarea {
    flex: 1;
}

.ph-content-row .btn-mini {
    flex: none;
    margin-top: 2px;
    white-space: nowrap;
}

.ph-hint {
    font-size: 12px;
    color: #9aa4b2;
    margin-top: 8px;
}

.req {
    color: #e5484d;
}

.danger {
    color: #e5484d;
    font-weight: 600;
}

.ph-confirm-text {
    font-size: 14px;
    line-height: 1.8;
    color: #24292f;
    margin: 18px 0;
    word-break: break-word;
}

/* 标签管理模态框 */
.ph-cat-create {
    display: flex;
    gap: 10px;
    margin: 18px 0 14px;
}

.ph-cat-create input {
    flex: 1;
    min-height: 46px;
    padding: 10px 16px;
    font: inherit;
    font-size: 15px;
    color: #24292f;
    background: #fbfcfe;
    border: 1px solid #edf0f5;
    border-radius: 12px;
    outline: none;
}

.ph-cat-create input:focus {
    border-color: #4a6cf7;
}

.ph-cat-create .btn-main {
    width: auto;
    padding: 0 20px;
}

.ph-cat-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
    max-height: 260px;
    overflow-y: auto;
}

.ph-cat-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #edf0f5;
    border-radius: 10px;
    background: #fbfcfe;
}

.ph-cat-row-name {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    color: #24292f;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ph-cat-row-count {
    font-size: 12px;
    color: #9aa4b2;
}

.ph-cat-row-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.ph-cat-empty {
    text-align: center;
    color: #9aa4b2;
    padding: 24px 0;
    font-size: 13px;
}

/* 轻提示 toast */
.toast {
    position: fixed;
    left: 50%;
    bottom: 40px;
    transform: translateX(-50%);
    background: rgba(16, 24, 40, 0.85);
    color: #fff;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 13px;
    z-index: 3000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

/* ---------- 复用语：手机端适配 ---------- */
@media (max-width: 768px) {
    .ph-home-fav-list {
        grid-template-columns: 1fr;
    }

    .ph-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .ph-search {
        max-width: none;
    }

    .ph-toolbar-right {
        justify-content: space-between;
    }

    .ph-cats-manage {
        margin-left: 0;
    }

    .ph-card-meta {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .ph-card-actions {
        justify-content: flex-end;
    }

    .ph-cat-create {
        flex-direction: column;
    }

    .ph-cat-create .btn-main {
        width: 100%;
    }
}
