/* ============================================================
   基金工具附加页专用样式（申赎时效 / 收益口径 / 分红对比）
   在 css/tailwind.min.css、css/style.css 之后加载。
   深色模式统一由 html.dark 生效。
   ============================================================ */

/* ---------- 页面导航条 ---------- */
.crumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 6px;
}
.crumb a { color: #2563eb; text-decoration: none; }
.crumb a:hover { text-decoration: underline; }
html.dark .crumb { color: #a5b0c0; }
html.dark .crumb a { color: #93c5fd; }
.crumb .sep { opacity: .5; }

/* ---------- 结果大数字（复用 style.css 主结果类） ---------- */
.res-block { line-height: 1.6; }
.res-block strong {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
    font-weight: 600;
}

/* ---------- 时间线（申赎时效） ---------- */
.timeline {
    list-style: none;
    margin: 0;
    padding: 0;
    position: relative;
}
.timeline::before {
    content: "";
    position: absolute;
    left: 13px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: #d1d5db;
    border-radius: 2px;
}
html.dark .timeline::before { background: #2b3a55; }
.tl-item { position: relative; padding: 0 0 18px 40px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot {
    position: absolute;
    left: 6px;
    top: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #3b82f6;
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, .35);
    box-sizing: border-box;
}
html.dark .tl-dot { border-color: #111a2c; }
.tl-item.is-pending .tl-dot { background: #9ca3af; box-shadow: 0 0 0 2px rgba(156,163,175,.3); }
.tl-item.is-ok .tl-dot { background: #10b981; box-shadow: 0 0 0 2px rgba(16,185,129,.3); }
.tl-item.is-warn .tl-dot { background: #f59e0b; box-shadow: 0 0 0 2px rgba(245,158,11,.3); }
.tl-title { font-weight: 600; color: #1f2937; }
html.dark .tl-title { color: #e2e8f0; }
.tl-sub { font-size: 13px; color: #6b7280; margin-top: 2px; }
html.dark .tl-sub { color: #a5b0c0; }
.tl-note { font-size: 12.5px; color: #6b7280; margin-top: 4px; }
html.dark .tl-note { color: #7c8ba0; }

/* ---------- 筛选 chips（收益口径） ---------- */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip {
    border: 1px solid #d1d5db;
    background: #fff;
    color: #374151;
    border-radius: 999px;
    padding: 5px 14px;
    font-size: 13px;
    line-height: 1.2;
    cursor: pointer;
    transition: all .18s ease;
    -webkit-tap-highlight-color: transparent;
}
.chip:hover { border-color: #93c5fd; color: #1d4ed8; }
.chip .cnt { margin-left: 5px; font-size: 11px; opacity: .8; }
.chip.is-active {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}
html.dark .chip { background: #0d1526; border-color: #2b3a55; color: #cbd5e1; }
html.dark .chip:hover { border-color: #3b82f6; color: #bfdbfe; }
html.dark .chip.is-active { background: #2563eb; border-color: #2563eb; color: #fff; }

/* 术语条目卡片 */
.term-list { display: flex; flex-direction: column; gap: 10px; }
.term-item {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 14px 16px;
    transition: border-color .18s ease, box-shadow .18s ease;
}
html.dark .term-item { background: #111a2c; border-color: #2b3a55; }
.term-item:focus-within, .term-item:hover { border-color: #93c5fd; }
.term-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.term-name { font-size: 15.5px; font-weight: 700; color: #1f2937; margin: 0; }
html.dark .term-name { color: #e6ebf3; }
.term-alias { font-size: 12px; color: #9ca3af; font-weight: 400; }
html.dark .term-alias { color: #7c8ba0; }
.term-tag {
    font-size: 11px;
    line-height: 1;
    padding: 3px 8px;
    border-radius: 999px;
    color: #fff;
}
.tag-profit { background: #10b981; }
.tag-money  { background: #14b8a6; }
.tag-nav    { background: #3b82f6; }
.tag-fee    { background: #f59e0b; }
.tag-concept{ background: #8b5cf6; }
.term-desc  { font-size: 14px; color: #374151; margin: 8px 0 0; line-height: 1.7; }
html.dark .term-desc { color: #cbd5e1; }
.term-note  { font-size: 12.5px; color: #6b7280; margin: 6px 0 0; line-height: 1.6;
              border-left: 3px solid #f59e0b; padding-left: 8px; }
html.dark .term-note { color: #a5b0c0; }
.term-note a { color: #2563eb; text-decoration: none; }
html.dark .term-note a { color: #93c5fd; }
.term-note a:hover { text-decoration: underline; }
.search-empty { text-align: center; color: #9ca3af; padding: 26px 0; }
html.dark .search-empty { color: #7c8ba0; }

/* 搜索框 */
.search-box { position: relative; }
.search-box input {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 9px 12px 9px 36px;
    font-size: 14px;
    background: #fff;
    color: #1f2937;
}
html.dark .search-box input { background: #0d1526; color: #e2e8f0; border-color: #2b3a55; }
.search-box input::placeholder { color: #9ca3af; }
html.dark .search-box input::placeholder { color: #64748b; }
.search-box input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, .18);
}
.search-box .ico {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: #9ca3af;
    pointer-events: none;
}
html.dark .search-box .ico { color: #64748b; }

/* ---------- 数据速查表 ---------- */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 640px;
}
.tbl th, .tbl td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: top;
}
html.dark .tbl th, html.dark .tbl td { border-color: #2b3a55; }
.tbl thead th { font-weight: 600; color: #6b7280; font-size: 13px; background: #f9fafb; }
html.dark .tbl thead th { color: #a5b0c0; background: #0b1220; }
.tbl tbody tr:hover { background: rgba(59,130,246,.05); }
html.dark .tbl tbody tr:hover { background: rgba(59,130,246,.08); }
.tbl .type-name { font-weight: 600; color: #1f2937; }
html.dark .tbl .type-name { color: #e6ebf3; }
.tbl .text-muted { color: #9ca3af; font-size: 12px; }
html.dark .tbl .text-muted { color: #64748b; }

/* ---------- 相关工具内链卡 ---------- */
.tool-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.tool-link {
    display: block;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 13.5px;
    color: #374151;
    text-decoration: none;
    background: #fff;
    transition: border-color .18s ease, transform .15s ease;
}
html.dark .tool-link { background: #111a2c; border-color: #2b3a55; color: #cbd5e1; }
.tool-link b { display: block; color: #1d4ed8; font-weight: 600; margin-bottom: 2px; }
html.dark .tool-link b { color: #93c5fd; }
.tool-link:hover { border-color: #93c5fd; transform: translateY(-1px); }

/* ---------- 模型假设卡片 ---------- */
.assume-card {
    background: rgba(245, 158, 11, .08);
    border: 1px dashed rgba(245, 158, 11, .5);
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.7;
}
html.dark .assume-card { color: #a5b0c0; }

/* 工具页表单控件（卡片内 input/select）深色适配：
   主站 style.css 的暗色规则只作用于 #inputPanel，此处覆盖工具页 */
html.dark .card-shadow input,
html.dark .card-shadow select {
    background-color: #0d1526;
    color: #e2e8f0;
    border-color: #2b3a55;
}
html.dark .card-shadow input::placeholder { color: #64748b; }
html.dark .card-shadow select option { background-color: #0d1526; color: #e2e8f0; }
html.dark .card-shadow input:focus,
html.dark .card-shadow select:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, .18);
}

/* 表单字段组（对齐主站输入控件观感） */
.field-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 4px;
}
html.dark .field-label { color: #cbd5e1; }
.field-label small { font-weight: 400; color: #9ca3af; margin-left: 4px; }
html.dark .field-label small { color: #64748b; }

/* ---------- 新手指南（A3） ---------- */
.gstep { display: flex; gap: 14px; align-items: flex-start; }
.step-badge {
    flex: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #2563eb;
    color: #fff;
    font-weight: 700;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, .18);
}
html.dark .step-badge { background: #3b82f6; box-shadow: 0 0 0 4px rgba(59, 130, 246, .22); }
.ticklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ticklist li {
    position: relative;
    padding-left: 20px;
    font-size: 14px;
    color: #374151;
    line-height: 1.75;
}
html.dark .ticklist li { color: #cbd5e1; }
.ticklist li::before {
    content: "";
    position: absolute;
    left: 1px;
    top: 8px;
    width: 7px;
    height: 7px;
    border-radius: 2px;
    background: #10b981;
    transform: rotate(45deg);
}
.mini-link {
    display: inline-block;
    border: 1px solid #d1d5db;
    color: #2563eb;
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 12.5px;
    text-decoration: none;
    transition: all .18s ease;
}
html.dark .mini-link { border-color: #2b3a55; color: #93c5fd; }
.mini-link:hover { border-color: #3b82f6; background: rgba(59, 130, 246, .08); }

/* ---------- 扣款计划表（B5） ---------- */
.drip-note { font-size: 12.5px; color: #6b7280; line-height: 1.7; }
html.dark .drip-note { color: #a5b0c0; }
.skipped-flag { color: #f59e0b; font-weight: 600; }
.toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%);
    background: #1f2937;
    color: #fff;
    font-size: 13px;
    padding: 9px 16px;
    border-radius: 999px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
    z-index: 60;
}
.toast.show { opacity: 1; }
html.dark .toast { background: #374151; }

/* ---------- 打印样式（B5 生成器） ---------- */
@media print {
    body { background: #fff !important; }
    .no-print { display: none !important; }
    .site-header, .crumb, footer { display: none !important; }
    main { padding: 0; max-width: none; }
    .card-shadow { box-shadow: none !important; }
    .tbl-wrap { overflow: visible; }
    .tbl { min-width: 0; font-size: 12px; }
    .tbl th, .tbl td { padding: 6px 8px; }
}

/* ============================================================
   工具页兜底工具类
   精简版 tailwind 未包含、但工具页在使用的类（值参照 Tailwind v3）。
   仅作用于加载 tools.css 的工具页，避免依赖缺失类导致布局破损。
   ============================================================ */
.bg-gray-600 { background-color: #4b5563; }
.col-span-2 { grid-column: span 2 / span 2; }
.flex-1 { flex: 1 1 0%; }
.gap-3 { gap: .75rem; }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.h-72 { height: 18rem; }
.list-disc { list-style-type: disc; }
.mb-2 { margin-bottom: .5rem; }
.mb-3 { margin-bottom: .75rem; }
.mb-5 { margin-bottom: 1.25rem; }
.mb-8 { margin-bottom: 2rem; }
.mt-1 { margin-top: .25rem; }
.mt-5 { margin-top: 1.25rem; }
.no-underline { text-decoration: none; }
.opacity-90 { opacity: .9; }
.p-5 { padding: 1.25rem; }
.pl-5 { padding-left: 1.25rem; }
.px-2 { padding-left: .5rem; padding-right: .5rem; }
.py-2\.5 { padding-top: .625rem; padding-bottom: .625rem; }
.py-5 { padding-top: 1.25rem; padding-bottom: 1.25rem; }
.space-y-4 > :not([hidden]) ~ :not([hidden]) { margin-top: 1rem; }
.text-amber-600 { color: #d97706; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-blue-300 { color: #93c5fd; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }

.hover\:bg-gray-700:hover { background-color: #374151; }
.hover\:text-blue-200:hover { color: #bfdbfe; }
.hover\:underline:hover { text-decoration: underline; }

@media (min-width: 640px) {
    .sm\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .sm\:col-span-1 { grid-column: span 1 / span 1; }
}
@media (min-width: 768px) {
    .md\:py-8 { padding-top: 2rem; padding-bottom: 2rem; }
    .md\:text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md\:col-span-2 { grid-column: span 2 / span 2; }
    .md\:col-span-3 { grid-column: span 3 / span 3; }
    .md\:grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .md\:grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
    .lg\:grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .lg\:col-span-2 { grid-column: span 2 / span 2; }
    .lg\:col-span-3 { grid-column: span 3 / span 3; }
}
