/* 首頁專用：搜尋、工具卡封面、文章縮圖。顏色變數在 style.css 的 :root */
.home-hero {
    max-width: 1200px;
    margin: 0 auto;
    padding: 34px 20px 0;
}
.home-hero h1 {
    color: var(--ink);
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    line-height: 1.25;
}
.home-hero > p {
    margin-top: 6px;
    max-width: 46em;
    color: var(--ink-2);
    font-size: 1.05rem;
    line-height: 1.7;
}
.tool-search {
    margin-top: 16px;
    max-width: 520px;
}
.tool-search input {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    border: 1.5px solid var(--line-strong);
    border-radius: 12px;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-size: 16px;
}
.tool-search input::placeholder { color: #66737a; }
.tool-search input:focus {
    outline: 3px solid var(--teal);
    outline-offset: 1px;
    border-color: var(--teal);
}
.recent-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    color: var(--ink-2);
    font-size: 0.9em;
}
.recent-row[hidden] { display: none; }
.recent-row a {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--teal-soft);
    color: var(--teal-dark);
    font-weight: 700;
    text-decoration: none;
}
.recent-row a:hover { background: #cfeae6; }
.home-hero > .search-empty {
    margin-top: 12px;
    font-size: 0.95rem;
}
.search-empty a { color: var(--teal-dark); font-weight: 700; }

.home-main { padding-top: 8px; }
.home-section { margin-top: 30px; }
.home-section > h2 {
    color: var(--ink);
    font-size: 1.45em;
    line-height: 1.35;
}
.home-section > .section-copy {
    margin: 4px 0 14px;
    max-width: 52em;
    line-height: 1.7;
}
.home-section > h2 + .tools-grid { margin-top: 14px; }

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 16px;
}
.tools-grid.feature { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tool-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    color: inherit;
    text-decoration: none;
    transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}
.tool-card:hover {
    transform: translateY(-3px);
    border-color: var(--line-strong);
    box-shadow: 0 10px 26px rgba(31, 45, 51, 0.14);
}
.tool-card[hidden], .home-section[hidden] { display: none; }
.cover {
    display: grid;
    place-items: center;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    background: var(--tint);
}
.cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.25s;
}
.tool-card:hover .cover img { transform: scale(1.04); }
/* 封面圖還沒進來時的色塊和圖示 */
.cover-icon {
    color: var(--ink);
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
}
.tool-card-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 14px 14px;
}
.tool-card h3 {
    color: var(--ink);
    font-size: 1.05em;
    line-height: 1.4;
}
.tool-card:hover h3 { color: var(--teal-dark); }
.tool-card p {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    margin: 4px 0 10px;
    color: var(--ink-2);
    font-size: 0.9em;
    line-height: 1.6;
}
.feature .tool-card h3 { font-size: 1.18em; }
.feature .tool-card p { display: block; overflow: visible; font-size: 0.94em; }
.tool-tag {
    margin-top: auto;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--teal-soft);
    color: var(--teal-dark);
    font-size: 0.78em;
    font-weight: bold;
}

.support-panel {
    max-width: none;
    margin: 30px 0 0;
}

.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 12px;
}
.article-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 10px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    color: inherit;
    text-decoration: none;
    transition: background 0.18s, border-color 0.18s;
}
.article-row:hover {
    background: var(--teal-soft);
    border-color: var(--line-strong);
}
.article-row img {
    flex-shrink: 0;
    width: 108px;
    height: 72px;
    border-radius: 8px;
    object-fit: cover;
}
.article-row h3 {
    color: var(--ink);
    font-size: 1em;
    line-height: 1.4;
}
.article-row p {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    margin-top: 2px;
    color: var(--ink-2);
    font-size: 0.86em;
    line-height: 1.5;
}
.article-more { margin-top: 14px; }

.about-panel {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: 24px;
    align-items: start;
}
.about-panel h2 {
    margin-bottom: 8px;
    color: var(--ink);
    font-size: 1.45em;
}
.about-panel p { margin-bottom: 12px; }
.about-panel a { color: var(--teal-dark); }
.about-panel img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 12px;
}
.about-panel figcaption {
    margin-top: 6px;
    color: #5f6b72;
    font-size: 0.82em;
    line-height: 1.5;
}
.principles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}

@media (prefers-reduced-motion: reduce) {
    .tool-card, .cover img, .article-row { transition: none; }
    .tool-card:hover { transform: none; }
    .tool-card:hover .cover img { transform: none; }
}
@media (max-width: 760px) {
    .about-panel { grid-template-columns: 1fr; }
    .tools-grid.feature { grid-template-columns: 1fr; gap: 10px; }
    /* 手機：三張主打卡改成左圖右文，一屏看得完 */
    .feature .tool-card { flex-direction: row; }
    .feature .cover { flex: 0 0 38%; aspect-ratio: auto; }
    .feature .tool-card-body { padding: 10px 12px 12px; }
    .feature .tool-card h3 { font-size: 1.05em; }
    .feature .tool-card p { font-size: 0.86em; line-height: 1.5; }
    .feature .cover-icon { font-size: 2.4rem; }
}
@media (max-width: 600px) {
    .home-hero { padding: 16px 16px 0; }
    .home-hero > p { font-size: 0.98rem; line-height: 1.6; }
    .tool-search { margin-top: 12px; max-width: none; }
    .home-main { padding: 0 16px 24px; }
    .home-section { margin-top: 24px; }
    .home-section > h2 { font-size: 1.25em; }
    .home-section > .section-copy { font-size: 0.94em; }
    /* 手機：日常工具兩欄，只留圖和名稱，少滑很多 */
    .tools-grid.daily { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .daily .tool-card p, .daily .tool-tag { display: none; }
    .daily .tool-card-body { padding: 8px 10px 10px; }
    .daily .tool-card h3 { font-size: 0.95em; }
    .daily .cover-icon { font-size: 2.4rem; }
    .article-grid { grid-template-columns: minmax(0, 1fr); }
    .article-row img { width: 88px; height: 64px; }
    .support-panel { margin-top: 24px; }
}
