/* ============================================
   实时汇率查询 - 严格按 tycat.cn (Fuwari 主题) 复刻
   ============================================ */

:root {
    color-scheme: light;
    --hue: 250;
    --primary: hsl(var(--hue) 72% 67%);
    --primary-strong: hsl(var(--hue) 70% 58%);
    --primary-soft: hsl(var(--hue) 78% 94%);
    --page-bg: hsl(var(--hue) 34% 96%);
    --card-bg: rgba(255, 255, 255, .96);
    --card-solid: #fff;
    --float-bg: rgba(255, 255, 255, .92);
    --text: hsl(var(--hue) 15% 18%);
    --text-75: hsl(var(--hue) 8% 34%);
    --text-50: hsl(var(--hue) 7% 50%);
    --text-30: hsl(var(--hue) 5% 64%);
    --line: hsl(var(--hue) 18% 89%);
    --line-dashed: hsl(var(--hue) 16% 86%);
    --button-bg: hsl(var(--hue) 55% 95%);
    --button-hover: hsl(var(--hue) 60% 90%);
    --code-bg: hsl(var(--hue) 22% 15%);
    --shadow: 0 10px 28px rgba(36, 27, 70, .055);
    --shadow-hover: 0 18px 42px rgba(36, 27, 70, .10);
    --radius: 16px;
    --radius-sm: 11px;
    --page-width: 1200px;
    --header-height: 72px;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 96px;
    background: var(--page-bg);
}

body {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
    background: var(--page-bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 16px;
    line-height: 1.7;
    text-rendering: optimizeLegibility;
}

a { color: var(--primary); text-decoration: none; transition: color .2s; }
a:hover { color: var(--primary-strong); }
img { max-width: 100%; height: auto; display: block; vertical-align: middle; }
ul, ol { list-style: none; }

/* ===== Navbar ===== */
.navbar {
    height: var(--header-height);
    background: var(--float-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 100;
}
.navbar-inner {
    max-width: var(--page-width);
    margin: 0 auto;
    padding: 0 24px;
    height: var(--header-height);
    display: flex;
    align-items: center;
    gap: 32px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    font-weight: 700;
    font-size: 17px;
}
.brand-mark { color: var(--primary); font-size: 20px; }
.main-nav { display: flex; gap: 4px; }
.nav-link {
    padding: 8px 16px;
    font-size: 14px;
    color: var(--text-75);
    border-radius: 8px;
    position: relative;
    transition: color .2s, background .2s;
}
.nav-link:hover { color: var(--text); background: var(--button-bg); }
.nav-link.active {
    color: var(--primary);
    background: var(--primary-soft);
    font-weight: 600;
}
.nav-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.nav-icon {
    padding: 5px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-75);
}
.nav-icon:hover { border-color: var(--primary); color: var(--primary); }
.nav-login {
    padding: 5px 16px;
    background: var(--primary);
    color: #fff;
    border-radius: 6px;
    font-size: 13px;
}
.nav-login:hover { background: var(--primary-strong); color: #fff; }

/* ===== Page Shell (主区) ===== */
.page-shell {
    max-width: var(--page-width);
    margin: 0 auto;
    padding: 24px 16px 48px;
    min-height: calc(100vh - var(--header-height) - 100px);
}

.site-grid {
    display: grid;
    gap: 24px;
}
.sidebar-left {
    grid-template-columns: 240px 1fr;
}

/* ===== Sidebar ===== */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: sticky;
    top: calc(var(--header-height) + 12px);
    align-self: flex-start;
}

.side-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow);
    border: 1px solid var(--line);
    transition: border-color .3s, box-shadow .3s;
}
.side-card:hover {
    border-color: var(--primary-soft);
    box-shadow: var(--shadow-hover);
}

.profile-card {
    text-align: center;
}
.profile-avatar {
    position: relative;
    display: inline-block;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 14px;
    box-shadow: 0 4px 16px rgba(0,0,0,.08);
}
.profile-avatar img {
    width: 100%; height: 100%;
    object-fit: cover;
}
.profile-avatar-hover {
    position: absolute; inset: 0;
    background: hsl(var(--hue) 70% 58% / .85);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .25s;
    font-size: 12px;
}
.profile-avatar:hover .profile-avatar-hover { opacity: 1; }

.profile-card h2 {
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 4px;
    color: var(--text);
}
.profile-accent {
    display: block;
    width: 32px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-strong));
    border-radius: 2px;
    margin: 10px auto;
}
.profile-card p {
    font-size: 13px;
    color: var(--text-50);
    margin: 0 0 14px;
    line-height: 1.6;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 8px;
}
.social-link {
    width: 32px; height: 32px;
    background: var(--button-bg);
    border-radius: 50%;
    color: var(--text-50);
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.social-link:hover { background: var(--primary); color: #fff; }

.sidebar-sticky { display: flex; flex-direction: column; gap: 14px; }

.compact-card { padding: 18px; }
.compact-card h2 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
}
.archive-card ul li {
    padding: 4px 0;
    font-size: 13px;
    border-bottom: 1px dashed var(--line-dashed);
}
.archive-card ul li:last-child { border-bottom: none; }
.archive-card ul li a {
    display: flex;
    justify-content: space-between;
    color: var(--text-75);
}
.archive-card ul li em {
    font-style: normal;
    color: var(--primary);
    background: var(--primary-soft);
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 11px;
}

.plain-widget-list li {
    padding: 6px 0;
    font-size: 13px;
    color: var(--text-75);
    border-bottom: 1px dashed var(--line-dashed);
}
.plain-widget-list li:last-child { border-bottom: none; }

/* ===== Content Column ===== */
.content-column {
    min-width: 0;
}

/* ===== Post Card（卡片列表）===== */
.post-list { display: flex; flex-direction: column; gap: 16px; }
.post-card {
    background: var(--card-solid);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--line);
    transition: box-shadow .3s, border-color .3s, transform .3s;
    display: flex;
    gap: 0;
    overflow: hidden;
}
.post-card:hover {
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-soft);
}

.post-card-content {
    flex: 1;
    min-width: 0;
    padding: 24px 28px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.post-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.title-accent {
    display: inline-block;
    width: 4px;
    height: 22px;
    background: linear-gradient(180deg, var(--primary), var(--primary-strong));
    border-radius: 2px;
    flex-shrink: 0;
}

.post-card-content h2 {
    font-size: 19px;
    font-weight: 700;
    line-height: 1.4;
    margin: 0;
    flex: 1;
    min-width: 0;
}
.post-card-content h2 a {
    color: var(--text);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color .2s;
}
.post-card-content h2 a:hover { color: var(--primary); }
.title-chevron {
    width: 18px; height: 18px;
    opacity: .4;
    flex-shrink: 0;
    transition: transform .2s, opacity .2s;
}
.post-card-content h2 a:hover .title-chevron { opacity: 1; transform: translateX(3px); }

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 12px;
    color: var(--text-50);
}
.meta-item { display: inline-flex; align-items: center; gap: 4px; }
.meta-icon { font-size: 13px; }

.post-excerpt {
    color: var(--text-75);
    font-size: 14px;
    line-height: 1.75;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    color: var(--text-50);
    margin-top: auto;
    align-items: center;
}
.post-word-count { color: var(--text-75); font-weight: 500; }
.post-stat-divider { color: var(--text-30); }
.compact-stat { color: var(--text-50); }

/* Post Cover（封面缩略图，右对齐） */
.post-cover {
    position: relative;
    flex-shrink: 0;
    width: 240px;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: var(--button-bg);
    align-self: stretch;
}
.post-cover img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .5s ease;
}
.post-card:hover .post-cover img { transform: scale(1.05); }
.cover-arrow {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.3);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    opacity: 0;
    transition: opacity .25s;
}
.post-card:hover .cover-arrow { opacity: 1; }

/* ===== Post Single（文章详情）===== */
.post-single {
    background: var(--card-solid);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 0;
    overflow: hidden;
}
.post-header {
    padding: 32px 36px 24px;
    border-bottom: 1px solid var(--line);
}
.post-title {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.4;
    margin: 0;
    color: var(--text);
}
.post-cover-main {
    width: 100%;
    aspect-ratio: 21/9;
    overflow: hidden;
    background: var(--button-bg);
}
.post-cover-main img { width: 100%; height: 100%; object-fit: cover; }
.post-content {
    padding: 32px 36px;
    font-size: 16px;
    line-height: 1.85;
    color: var(--text-75);
}
.post-content p { margin-bottom: 18px; }
.post-content img {
    display: block;
    width: 100%;
    border-radius: var(--radius-sm);
    margin: 16px 0;
    box-shadow: var(--shadow);
}
.post-content h2, .post-content h3 {
    color: var(--text);
    margin: 28px 0 14px;
    font-weight: 700;
}
.post-content h2 { font-size: 22px; }
.post-content h3 {
    font-size: 18px;
    padding-left: 12px;
    border-left: 4px solid var(--primary);
}
.post-content pre {
    background: var(--code-bg);
    color: #d4d4d4;
    padding: 16px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    font-size: 13px;
    margin: 16px 0;
}
.post-content code {
    background: var(--button-bg);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    color: var(--primary);
}
.post-content blockquote {
    background: var(--primary-soft);
    border-left: 4px solid var(--primary);
    padding: 12px 16px;
    color: var(--text);
    margin: 18px 0;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ===== Post Nav ===== */
.post-nav {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
}
.prev-post, .next-post {
    flex: 1;
    background: var(--card-solid);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px 18px;
    font-size: 13px;
}
.prev-link, .next-link { color: var(--text-75); display: block; }
.prev-link:hover, .next-link:hover { color: var(--primary); }
.prev-disabled, .next-disabled { color: var(--text-30); }

/* ===== Comments ===== */
.comments-area {
    background: var(--card-solid);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px 28px;
    margin-top: 16px;
}
.comments-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}
.comment-item {
    display: flex;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px dashed var(--line-dashed);
    font-size: 14px;
}
.comment-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.comment-body { flex: 1; }
.comment-author { font-weight: 600; color: var(--text); }
.comment-author time { color: var(--text-50); margin-left: 8px; font-weight: normal; font-size: 12px; }
.comment-text { color: var(--text-75); margin-top: 4px; }

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}
.comment-fields { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.comment-form input,
.comment-form textarea {
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: inherit;
    background: var(--page-bg);
    color: var(--text);
    outline: none;
    transition: border-color .2s, background .2s;
}
.comment-form input:focus,
.comment-form textarea:focus { border-color: var(--primary); background: var(--card-solid); }
.comment-form textarea { resize: vertical; min-height: 80px; }

.btn-primary {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    transition: background .2s;
}
.btn-primary:hover { background: var(--primary-strong); }

.btn-secondary {
    background: var(--card-solid);
    color: var(--text-75);
    border: 1px solid var(--line);
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }

/* ===== Page Nav (分页) ===== */
.page-nav {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 24px;
}
.page-current, .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: var(--card-solid);
    color: var(--text-75);
    border: 1px solid var(--line);
}
.page-current { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-link:hover { border-color: var(--primary); color: var(--primary); }

/* ===== Section header ===== */
.content-header {
    background: var(--card-solid);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 16px;
}
.section-title { font-size: 22px; font-weight: 700; color: var(--text); margin: 0 0 4px; }
.section-count { font-size: 13px; color: var(--text-50); margin: 0; }

/* ===== Upload Card ===== */
.upload-card {
    background: var(--page-bg);
    border: 2px dashed var(--line-dashed);
    border-radius: var(--radius);
    padding: 40px;
    text-align: center;
    margin-bottom: 16px;
    transition: all .2s;
}
.upload-card.drag-over { border-color: var(--primary); background: var(--primary-soft); }
.upload-emoji { font-size: 36px; margin-bottom: 8px; }
.upload-card p { margin: 4px 0; color: var(--text-75); font-size: 14px; }
.upload-hint { font-size: 12px; color: var(--text-50); }
.upload-card .btn-primary { display: inline-block; margin-top: 12px; }

/* ===== Manage Toolbar ===== */
.manage-toolbar {
    background: var(--card-solid);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    box-shadow: var(--shadow);
}
.manage-toolbar h2 { font-size: 16px; font-weight: 700; margin: 0; }
.stats { font-size: 12px; color: var(--text-50); flex: 1; }
.btn-group { display: flex; gap: 6px; }

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}
.gallery-item {
    background: var(--card-solid);
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: box-shadow .2s;
}
.gallery-item:hover { box-shadow: var(--shadow-hover); }
.gallery-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    cursor: zoom-in;
}
.gallery-info { padding: 10px 12px; font-size: 12px; }
.gallery-name { color: var(--text); margin-bottom: 4px; word-break: break-all; }
.gallery-meta { color: var(--text-50); font-size: 11px; margin-bottom: 8px; }
.gallery-actions { display: flex; gap: 4px; }
.gallery-actions button {
    flex: 1;
    font-size: 11px;
    padding: 4px 0;
    border: 1px solid var(--line);
    background: var(--card-solid);
    border-radius: 4px;
    cursor: pointer;
    color: var(--text-75);
    font-family: inherit;
}
.gallery-actions button:hover { background: var(--primary-soft); color: var(--primary); border-color: var(--primary-soft); }

.gallery-empty {
    background: var(--card-solid);
    border-radius: var(--radius);
    padding: 60px 20px;
    text-align: center;
    color: var(--text-50);
    box-shadow: var(--shadow);
}
.gallery-empty p { margin: 8px 0; }

/* ===== Lightbox ===== */
.t-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.88);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 20px;
    cursor: zoom-out;
}
.t-lightbox.active { display: flex; }
.t-lightbox-img { max-width: 90vw; max-height: 90vh; border-radius: var(--radius-sm); }
.t-lightbox-close {
    position: absolute; top: 20px; right: 30px;
    color: #fff; font-size: 36px; cursor: pointer; user-select: none;
}
.t-lightbox-caption {
    position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
    color: #ddd; font-size: 13px; background: rgba(0,0,0,.6);
    padding: 6px 14px; border-radius: 4px;
}

/* ===== Footer ===== */
.site-footer {
    background: var(--card-solid);
    border-top: 1px solid var(--line);
    padding: 24px;
    text-align: center;
    color: var(--text-50);
    font-size: 13px;
    margin-top: 32px;
}
.footer-inner p { margin: 4px 0; }
.footer-inner a { color: var(--text-50); }
.footer-inner a:hover { color: var(--primary); }

/* ===== Responsive ===== */
@media screen and (max-width: 960px) {
    .sidebar-left { grid-template-columns: 1fr; }
    .sidebar { position: static; flex-direction: row; flex-wrap: wrap; }
    .sidebar > * { flex: 1; min-width: 240px; }
    .post-cover { width: 160px; }
}
@media screen and (max-width: 640px) {
    .page-shell { padding: 16px 12px; }
    .post-card { flex-direction: column-reverse; }
    .post-cover { width: 100%; aspect-ratio: 16/9; }
    .post-header, .post-content { padding: 20px; }
    .post-title { font-size: 22px; }
    .navbar-inner { padding: 0 16px; gap: 16px; }
    .main-nav { display: none; }
    .comment-fields { grid-template-columns: 1fr; }
}