/* ============================================================
   TextPHP · 前端样式  |  大气现代风
   ============================================================ */
:root {
    --primary: #06f;
    --primary-dark: color-mix(in srgb, var(--primary) 60%, transparent);
    --primary-light: #eef2ff;
    --accent: #ec4899;
    --accent-dark: #be185d;
    --text: #1e293b;
    --text-light: #64748b;
    --text-muted: #94a3b8;
    --bg: #ffffff;
    --bg-soft: #f1f5f9;
    --border: #e2e8f0;
    --card: #ffffff;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
    --shadow: 0 4px 16px rgba(15, 23, 42, .08);
    --shadow-lg: 0 12px 32px rgba(15, 23, 42, .12);
    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 16px;
    --header-h: 68px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    --font-mono: "JetBrains Mono", "Fira Code", "Consolas", monospace;
    --icon-svg-size: 18px;
}

/* SVG 图标对齐 */
.icon { display: inline-block; vertical-align: -2px; flex-shrink: 0; }
button .icon, .btn .icon, a .icon { vertical-align: -2px; }
nav .icon, .navbar .icon { width: 20px; height: 20px; }

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.7;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; transition: color .2s; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }
button, input, textarea, select { font-family: inherit; font-size: inherit; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 820px; margin: 0 auto; padding: 0 20px; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.hidden { display: none !important; }

/* ============================================================
   顶部导航
   ============================================================ */
.site-header {
    position: sticky; top: 0; z-index: 100;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--border);
    height: var(--header-h);
    display: flex; align-items: center;
}
.site-header .container {display: flex;align-items: center;justify-content: space-between;gap: 28px;width: 100%;}
.logo { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 800; color: var(--text); flex-shrink: 0; }
.logo:hover { color: var(--primary); }
.logo-icon {
    width: 38px; height: 38px; border-radius: 10px;
    background: var(--primary);
    color: #fff; display: grid; place-items: center;
    font-size: 18px; font-weight: 800;
}
.logo-img {height: 30px;max-width: 180px;width: auto;object-fit: contain;}
.main-nav { display: flex; align-items: center; gap: 4px; flex: 1; }
.main-nav a {
    padding: 8px 14px; border-radius: 8px; color: var(--text-light);
    font-weight: 500; font-size: 15px; transition: all .2s;
}
.main-nav a:hover { color: var(--primary); background: var(--primary-light); }
.main-nav a.active { color: var(--primary); background: var(--primary-light); }
.header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.search-box { position: relative; }
.search-box input {
    width: 220px; height: 38px; padding: 0 36px 0 14px;
    border: 1px solid var(--border); border-radius: 20px; background: var(--bg-soft);
    transition: all .2s; font-size: 14px;
}
.search-box input:focus { outline: none; border-color: var(--primary); background: #fff; width: 280px; box-shadow: 0 0 0 3px rgba(79,70,229,.1); }
.search-box button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: var(--text-muted); padding: 6px; }
.cart-badge { position: relative; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; color: var(--text-light); transition: all .2s; }
.cart-badge:hover { background: var(--primary-light); color: var(--primary); }
.cart-badge .count {
    position: absolute; top: 2px; right: 2px; min-width: 17px; height: 17px;
    background: var(--accent); color: #fff; font-size: 11px; font-weight: 700;
    border-radius: 9px; display: grid; place-items: center; padding: 0 4px;
}
.user-menu { position: relative; }
.user-avatar {
    width: 40px; height: 40px; border-radius: 50%; object-fit: cover;
    border: 2px solid var(--border); cursor: pointer;
    background: var(--primary); color: #fff;
    display: grid; place-items: center; font-weight: 700;
}
.dropdown {
    position: absolute; top: calc(100% + 8px); right: 0; min-width: 180px;
    background: #fff; border: 1px solid var(--border); border-radius: 12px;
    box-shadow: var(--shadow-lg); padding: 6px; opacity: 0; visibility: hidden;
    transform: translateY(-6px); transition: all .2s;
}
.user-menu:hover .dropdown, .dropdown:hover { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown a {
    display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px;
    color: var(--text); font-size: 14px;
}
.dropdown a:hover { background: var(--bg-soft); color: var(--primary); }
.dropdown .divider { height: 1px; background: var(--border); margin: 4px 0; }

/* 按钮 */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 20px; border-radius: 8px; border: 1px solid transparent;
    font-weight: 600; font-size: 14px; cursor: pointer; transition: all .2s;
    background: var(--bg-soft); color: var(--text); text-decoration: none;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-dark); color: #fff; }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ghost { background: transparent; color: var(--text-light); }
.btn-ghost:hover { background: var(--bg-soft); color: var(--text); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 12px 28px; font-size: 16px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ============================================================
   首页 Hero
   ============================================================ */
.hero {
    background: var(--bg-soft);
    color: var(--text);
    padding: 30px 0 30px;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--border);
}
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-color: rgb(0 0 0 / 36%);
    z-index: 1;
}

.hero img {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    right: 0;
    left: 0;
    bottom: 0;
    object-fit: cover;
}


.hero .container {position: relative;z-index: 1;}
.hero h1 {font-size: 44px;font-weight: 800;margin-bottom: 16px;letter-spacing: -.8px;color: var(--card);}
.hero p {font-size: 18px;color: var(--card);max-width: 680px;margin-bottom: 30px;}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero .btn-primary { background: var(--primary); color: #fff; }
.hero .btn-primary:hover { background: var(--primary-dark); color: #fff; }
.hero .btn-outline { border-color: var(--border); color: var(--text); background: var(--card); }
.hero .btn-outline:hover { background: var(--bg-soft); border-color: var(--primary); color: var(--primary); }

/* 统计条 */
.stats-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 40px; }
.stat-item {background: rgb(255 255 255 / 78%);border: 1px solid var(--border);border-radius: 12px;padding: 18px 20px;}
.stat-item .num { font-size: 28px; font-weight: 800; color: var(--primary); }
.stat-item .label { font-size: 13px; color: var(--text); margin-top: 4px; }

/* ============================================================
   主体布局
   ============================================================ */
.main { padding: 40px 0 60px; }
.layout { display: grid; grid-template-columns: 1fr 320px; gap: 32px; align-items: start; }
.layout-full { grid-template-columns: 1fr; }

/* 文章卡片 */
.post-card {
    background: var(--card); border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--shadow-sm); border: 1px solid var(--border);
    transition: all .25s; display: flex;
}
.post-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); border-color: transparent; }
.post-card .cover { width: 240px; flex-shrink: 0; background: var(--bg-soft); position: relative; overflow: hidden; }
.post-card .cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.post-card:hover .cover img { transform: scale(1.06); }
.post-card .cover-placeholder {
    width: 100%; height: 100%; display: grid; place-items: center;
    background: var(--bg-soft);
    color: var(--text-muted); font-size: 40px; font-weight: 700;
}
.post-card .body { padding: 22px 24px; flex: 1; display: flex; flex-direction: column; }
.post-card .meta { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-muted); margin-bottom: 10px; flex-wrap: wrap; }
.post-card .meta .cat { background: var(--primary-light); color: var(--primary); padding: 2px 10px; border-radius: 12px; font-weight: 600; }
.post-card .meta .top-tag { background: var(--accent); color: #fff; padding: 2px 8px; border-radius: 12px; font-weight: 600; font-size: 11px; }
.post-card h2 { font-size: 21px; font-weight: 700; margin-bottom: 8px; line-height: 1.4; }
.post-card h2 a { color: var(--text); }
.post-card h2 a:hover { color: var(--primary); }
.post-card .excerpt { color: var(--text-light); font-size: 14px; line-height: 1.7; margin-bottom: 14px; flex: 1; }
.post-card .footer { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--text-muted); }
.post-card .footer .actions { display: flex; gap: 14px; }

/* 简洁列表文章项 */
.post-item {
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 20px 24px; margin-bottom: 16px; transition: all .2s; box-shadow: var(--shadow-sm);
}
.post-item:hover { box-shadow: var(--shadow); border-color: transparent; transform: translateX(3px); }
.post-item h3 { font-size: 18px; margin-bottom: 8px; }
.post-item h3 a { color: var(--text); }
.post-item h3 a:hover { color: var(--primary); }
.post-item .meta { display: flex; gap: 12px; font-size: 13px; color: var(--text-muted); flex-wrap: wrap; }

/* 侧边栏 */
.sidebar { display: flex; flex-direction: column; gap: 22px; position: sticky; top: calc(var(--header-h) + 24px); }
.widget { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); }
.widget-title { font-size: 16px; font-weight: 700; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 2px solid var(--primary-light); position: relative; }
.widget-title::after { content: ''; position: absolute; bottom: -2px; left: 0; width: 40px; height: 2px; background: var(--primary); }

/* 分类列表 */
.cat-list li { display: flex; justify-content: space-between; align-items: center; padding: 9px 12px; border-radius: 8px; transition: background .2s; }
.cat-list li:hover { background: var(--bg-soft); }
.cat-list a { color: var(--text); flex: 1; }
.cat-list a:hover { color: var(--primary); }
.cat-list .count { font-size: 12px; color: var(--text-muted); background: var(--bg-soft); padding: 1px 9px; border-radius: 10px; }

/* 标签云 */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-cloud a { padding: 5px 12px; background: var(--bg-soft); border-radius: 14px; font-size: 13px; color: var(--text-light); transition: all .2s; }
.tag-cloud a:hover { background: var(--primary); color: #fff; transform: translateY(-2px); }

/* 热门文章 */
.hot-list li { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--border); }
.hot-list li:last-child { border-bottom: none; }
.hot-list .rank { width: 22px; height: 22px; flex-shrink: 0; border-radius: 6px; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; background: var(--text-muted); }
.hot-list li:nth-child(1) .rank { background: var(--accent); }
.hot-list li:nth-child(2) .rank { background: #f97316; }
.hot-list li:nth-child(3) .rank { background: #eab308; }
.hot-list a { color: var(--text); font-size: 14px; line-height: 1.5; }
.hot-list a:hover { color: var(--primary); }

/* 推荐商品 */
.product-mini { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.product-mini:last-child { border-bottom: none; }
.product-mini img { width: 60px; height: 60px; border-radius: 8px; object-fit: cover; background: var(--bg-soft); }
.product-mini .info { flex: 1; min-width: 0; }
.product-mini .name { font-size: 14px; font-weight: 500; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-mini .name:hover { color: var(--primary); }
.product-mini .price { color: var(--accent); font-weight: 700; margin-top: 4px; }

/* ============================================================
   文章详情
   ============================================================ */
.post-detail { background: #fff; border-radius: var(--radius); padding: 40px 48px; box-shadow: var(--shadow-sm); border: 1px solid var(--border); }
.post-detail h1 { font-size: 32px; font-weight: 800; line-height: 1.35; margin-bottom: 16px; color: var(--text); }
.post-meta { display: flex; align-items: center; gap: 16px; padding: 16px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin-bottom: 28px; font-size: 14px; color: var(--text-light); flex-wrap: wrap; }
.post-meta .author { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text); }
.post-meta .author img { width: 32px; height: 32px; border-radius: 50%; }
.post-cover { border-radius: var(--radius); overflow: hidden; margin-bottom: 28px; max-height: 420px; }
.post-content { font-size: 16px; line-height: 1.85; color: #334155; }
.post-content h1, .post-content h2, .post-content h3 { margin: 28px 0 14px; font-weight: 700; color: var(--text); }
.post-content h2 { font-size: 24px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.post-content h3 { font-size: 20px; }
.post-content p { margin-bottom: 16px; }
.post-content ul, .post-content ol { margin: 12px 0 16px 24px; }
.post-content ul li { list-style: disc; margin-bottom: 6px; }
.post-content ol li { list-style: decimal; margin-bottom: 6px; }
.post-content blockquote {
    border-left: 4px solid var(--primary); background: var(--primary-light);
    padding: 14px 20px; margin: 18px 0; border-radius: 0 8px 8px 0; color: var(--text);
}
.post-content pre {
    background: #1e293b; color: #e2e8f0; padding: 18px 22px; border-radius: 10px;
    overflow-x: auto; margin: 18px 0; font-size: 14px; line-height: 1.6;
}
.post-content code { font-family: var(--font-mono); font-size: 90%; }
.post-content :not(pre) > code { background: var(--bg-soft); color: var(--accent-dark); padding: 2px 6px; border-radius: 4px; }
.post-content pre code { background: none; padding: 0; color: inherit; }
.post-content img { border-radius: 8px; margin: 16px 0; }
.post-content a { color: var(--primary); border-bottom: 1px solid var(--primary-light); }
.post-content a:hover { border-bottom-color: var(--primary); }
.post-content hr { border: none; border-top: 1px solid var(--border); margin: 28px 0; }

.post-tags { margin: 28px 0; display: flex; gap: 8px; flex-wrap: wrap; }
.post-tags a { padding: 6px 14px; background: var(--bg-soft); border-radius: 16px; font-size: 13px; color: var(--text-light); }
.post-tags a:hover { background: var(--primary); color: #fff; }

.post-actions { display: flex; gap: 14px; padding: 24px 0; border-top: 1px solid var(--border); justify-content: center; }
.post-actions .btn { min-width: 110px; }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 28px; }
.post-nav a { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; transition: all .2s; }
.post-nav a:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.post-nav .label { font-size: 12px; color: var(--text-muted); }
.post-nav .title { font-weight: 600; margin-top: 4px; color: var(--text); }
.post-nav .next { text-align: right; }

/* 评论区 */
.comments { background: #fff; border-radius: var(--radius); padding: 32px 40px; margin-top: 24px; box-shadow: var(--shadow-sm); border: 1px solid var(--border); }
.comments h3 { font-size: 20px; margin-bottom: 24px; }
.comment-form { margin-bottom: 32px; }
.comment-form textarea { width: 100%; min-height: 110px; padding: 14px; border: 1px solid var(--border); border-radius: 10px; resize: vertical; font-size: 14px; transition: border-color .2s; }
.comment-form textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.1); }
.comment-form .guest-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.comment-form .guest-fields input {padding: 10px 14px;border: 1px solid var(--border);border-radius: 8px;width: 100%;}
.comment-list { }
.comment-item { padding: 18px 0; border-bottom: 1px solid var(--border); }
.comment-item:last-child { border-bottom: none; }
.comment-item .head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.comment-item .avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 700; }
.comment-item .avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.comment-item .name { font-weight: 600; }
.comment-item .admin-badge { background: var(--primary); color: #fff; font-size: 11px; padding: 1px 7px; border-radius: 8px; }
.comment-item .time { font-size: 12px; color: var(--text-muted); margin-left: auto; }
.comment-item .content { color: #475569; padding-left: 48px; }
.comment-item .reply-btn { padding-left: 48px; margin-top: 8px; font-size: 13px; color: var(--text-muted); cursor: pointer; background: none; border: none; }
.comment-item .reply-btn:hover { color: var(--primary); }
.comment-children { padding-left: 48px; margin-top: 12px; }
.comment-children .comment-item { border-bottom: none; border-left: 2px solid var(--border); padding-left: 16px; }

/* ============================================================
   商城
   ============================================================ */
.shop-hero {background: var(--bg-soft);color: var(--text);padding: 56px 0;text-align: center;border-bottom: 1px solid var(--border);overflow: hidden;position: relative;}
.shop-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-color: rgb(0 0 0 / 36%);
    z-index: 1;
}
.shop-hero img {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    right: 0;
    left: 0;
    bottom: 0;
    object-fit: cover;
}
.shop-hero h1 {font-size: 36px;font-weight: 800;margin-bottom: 10px;color: var(--card);position: relative;z-index: 9;}
.shop-hero p {color: var(--card);font-size: 16px;position: relative;z-index: 9;}
.shop-layout { display: grid; grid-template-columns: 200px 1fr 260px; gap: 24px; padding: 32px 0; align-items: start; }
.shop-filters { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; position: sticky; top: calc(var(--header-h) + 20px); }
.shop-filters h4 { font-size: 14px; color: var(--text-muted); margin-bottom: 12px; text-transform: uppercase; letter-spacing: .5px; }
.shop-filters ul li {border-radius: 7px;}
.shop-filters ul li a {color: var(--text);font-size: 14px;display: flex;justify-content: space-between;padding: 10px;background-color: var(--primary-light);margin: 10px 0;}
.shop-filters ul li a:hover, .shop-filters ul li a.active {color: var(--primary);font-weight: 600;}
.shop-filters ul li a.active {background: var(--border);}
.shop-sort { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.shop-sort a { padding: 7px 14px; background: #fff; border: 1px solid var(--border); border-radius: 18px; font-size: 13px; color: var(--text-light); }
.shop-sort a.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.product-grid {display: grid;grid-template-columns: repeat(2, 1fr);gap: 20px;}
.product-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: all .25s; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; }
.product-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); border-color: var(--primary-light); }
.product-card .cover { height: 220px; background: var(--bg-soft); position: relative; overflow: hidden; display: block; }
.product-card .cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.product-card:hover .cover img { transform: scale(1.08); }
.product-card .cover-ph { width: 100%; height: 100%; display: grid; place-items: center; background: var(--bg-soft); color: var(--text-muted); }
.product-card .cover-ph .icon { color: var(--text-muted); opacity: .45; }
.product-card .badge { position: absolute; top: 10px; left: 10px; padding: 3px 10px; border-radius: 12px; font-size: 11px; color: #fff; font-weight: 600; letter-spacing: .3px; z-index: 2; }
.product-card .badge.hot { background: var(--accent); }
.product-card .badge.new { background: var(--success); }
.product-card .badge.discount { background: var(--warning); top: 10px; left: auto; right: 10px; }
.product-card .body { padding: 16px; display: flex; flex-direction: column; flex: 1; }
.product-card .name { font-size: 15px; font-weight: 600; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 46px; line-height: 1.4; }
.product-card .name:hover { color: var(--primary); }
.product-card .subtitle { font-size: 12px; color: var(--text-muted); margin: 4px 0 8px; height: 18px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.product-card .rating-row { display: flex; align-items: center; margin-bottom: 8px; }
.product-card .price-row { display: flex; align-items: baseline; gap: 8px; }
.product-card .price { font-size: 20px; font-weight: 800; color: var(--accent); }
.product-card .original { font-size: 13px; color: var(--text-muted); text-decoration: line-through; }
.product-card .meta-row { display: flex; align-items: center; gap: 14px; margin-top: 10px; font-size: 12px; color: var(--text-muted); }
.product-card .meta-row .sales { display: inline-flex; align-items: center; gap: 4px; }
.product-card .meta-row .stock { display: inline-flex; align-items: center; gap: 4px; color: var(--success); }
.product-card .meta-row .stock.out { color: var(--danger); }
.product-card .actions { display: flex; gap: 8px; margin-top: 14px; margin-top: auto; padding-top: 14px; }

/* 星级评分 */
.rating-stars { display: inline-flex; align-items: center; gap: 2px; color: var(--warning); }
.rating-stars .star { color: var(--warning); }
.rating-stars .star-empty { color: var(--border); }
.rating-stars .star-half { color: var(--warning); }
.rating-stars .rating-value { font-size: 12px; color: var(--text-light); margin-left: 6px; font-weight: 600; }
.rating-stars .rating-count { font-size: 12px; color: var(--text-muted); margin-left: 4px; }

/* 商品详情 */
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; background: #fff; padding: 32px; border-radius: var(--radius); border: 1px solid var(--border); }
.product-gallery .main-img { width: 100%; height: 440px; border-radius: var(--radius); overflow: hidden; background: var(--bg-soft); }
.product-gallery .main-img img { width: 100%; height: 100%; object-fit: cover; }
.product-gallery .main-ph { width: 100%; height: 100%; display: grid; place-items: center; background: var(--bg-soft); color: var(--text-muted); }
.product-gallery .main-ph .icon { color: var(--text-muted); opacity: .4; }
.product-info .rating-line { padding: 6px 0 12px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.product-info .rating-line .rating-value { font-size: 14px; }
.product-info .rating-line .rating-count { font-size: 13px; }
.product-gallery .thumbs { display: flex; gap: 10px; margin-top: 12px; }
.product-gallery .thumbs img { width: 70px; height: 70px; object-fit: cover; border-radius: 8px; cursor: pointer; border: 2px solid transparent; }
.product-gallery .thumbs img.active { border-color: var(--primary); }
.product-info h1 { font-size: 28px; font-weight: 800; margin-bottom: 8px; }
.product-info .subtitle { color: var(--text-light); font-size: 16px; margin-bottom: 20px; }
.product-info .price-box { background: var(--bg-soft); border-radius: 12px; padding: 20px; margin-bottom: 20px; }
.product-info .price-box .now { font-size: 36px; font-weight: 800; color: var(--accent); }
.product-info .price-box .orig { font-size: 16px; color: var(--text-muted); text-decoration: line-through; margin-left: 12px; }
.product-info .price-box .save { background: var(--accent); color: #fff; padding: 2px 10px; border-radius: 12px; font-size: 12px; margin-left: 12px; }
.product-info .meta-row { display: flex; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.product-info .meta-row .label { color: var(--text-muted); width: 80px; }
.product-info .qty { display: flex; align-items: center; gap: 14px; margin: 22px 0; }
.qty-control { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.qty-control button { width: 38px; height: 38px; background: var(--bg-soft); border: none; cursor: pointer; font-size: 18px; color: var(--text); }
.qty-control button:hover { background: var(--primary-light); color: var(--primary); }
.qty-control input { width: 56px; height: 38px; border: none; text-align: center; font-size: 15px; font-weight: 600; }
.qty-control input:focus { outline: none; }
.buy-actions { display: flex; gap: 12px; }
.product-desc { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; margin-top: 24px; }
.product-desc h2 { font-size: 20px; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 2px solid var(--primary-light); }
.product-desc .content { line-height: 1.85; color: #475569; }
.product-desc .content h1, .product-desc .content h2, .product-desc .content h3 { margin: 20px 0 10px; color: var(--text); }
.product-desc .content pre { background: #1e293b; color: #e2e8f0; padding: 14px; border-radius: 8px; overflow-x: auto; }
.product-desc .content code { font-family: var(--font-mono); }

/* ============================================================
   购物车 / 结算 / 订单
   ============================================================ */
.cart-page, .checkout-page, .order-page { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 28px 32px; box-shadow: var(--shadow-sm); }
.page-title { font-size: 24px; font-weight: 800; margin-bottom: 20px; display: flex; align-items: center; gap: 10px; }
.cart-table { width: 100%; }
.cart-table th { text-align: left; padding: 12px 8px; border-bottom: 2px solid var(--border); color: var(--text-muted); font-size: 13px; font-weight: 600; }
.cart-table td { padding: 16px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.cart-table .prod { display: flex; align-items: center; gap: 14px; }
.cart-table .prod img { width: 70px; height: 70px; border-radius: 8px; object-fit: cover; background: var(--bg-soft); }
.cart-table .prod .ph { width: 70px; height: 70px; border-radius: 8px; background: linear-gradient(135deg, #eef2ff, #fce7f3); display: grid; place-items: center; color: var(--primary); font-weight: 800; }
.cart-table .prod .name { font-weight: 500; }
.cart-table .prod .name:hover { color: var(--primary); }
.cart-table .price { color: var(--accent); font-weight: 700; }
.cart-table .subtotal { color: var(--accent); font-weight: 800; }
.cart-table .remove-btn { color: var(--text-muted); cursor: pointer; background: none; border: none; padding: 4px 8px; border-radius: 6px; }
.cart-table .remove-btn:hover { color: var(--danger); background: #fef2f2; }
.cart-footer { display: flex; justify-content: space-between; align-items: center; padding: 20px 0 0; margin-top: 8px; }
.cart-total { font-size: 16px; }
.cart-total .amount { font-size: 26px; font-weight: 800; color: var(--accent); }

.checkout-items { margin-bottom: 24px; }
.checkout-items .item { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.checkout-items .item img { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; background: var(--bg-soft); }
.checkout-items .item .name { flex: 1; }
.checkout-items .item .qty { color: var(--text-muted); }
.checkout-items .item .sub { color: var(--accent); font-weight: 700; width: 100px; text-align: right; }
.address-select { margin-bottom: 20px; }
.address-card { border: 2px solid var(--border); border-radius: 10px; padding: 16px; margin-bottom: 12px; cursor: pointer; transition: all .2s; }
.address-card:hover { border-color: var(--primary-light); }
.address-card.selected { border-color: var(--primary); background: var(--primary-light); }
.address-card .top { display: flex; justify-content: space-between; margin-bottom: 8px; }
.address-card .name { font-weight: 700; }
.address-card .default-tag { background: var(--primary); color: #fff; font-size: 11px; padding: 1px 8px; border-radius: 8px; }
.address-card .detail { color: var(--text-light); font-size: 14px; }

/* 订单状态 */
.order-status-banner { padding: 20px 24px; border-radius: 12px; margin-bottom: 20px; display: flex; align-items: center; gap: 16px; color: #fff; }
.order-status-banner.pending { background: linear-gradient(135deg, #f59e0b, #f97316); }
.order-status-banner.paid { background: linear-gradient(135deg, #10b981, #059669); }
.order-status-banner.shipped { background: linear-gradient(135deg, #3b82f6, #6366f1); }
.order-status-banner.completed { background: linear-gradient(135deg, #64748b, #475569); }
.order-status-banner.cancelled, .order-status-banner.refunded { background: linear-gradient(135deg, #94a3b8, #64748b); }
.order-status-banner .icon { font-size: 32px; }
.order-status-banner .text { font-size: 18px; font-weight: 700; }
.order-status-banner .desc { font-size: 13px; opacity: .9; }
.order-timeline { display: flex; gap: 0; margin: 24px 0; }
.order-timeline .step { flex: 1; text-align: center; position: relative; padding-top: 24px; }
.order-timeline .step::before { content: ''; position: absolute; top: 8px; left: 50%; right: -50%; height: 2px; background: var(--border); z-index: 0; }
.order-timeline .step:last-child::before { display: none; }
.order-timeline .step::after { content: ''; position: absolute; top: 2px; left: 50%; transform: translateX(-50%); width: 14px; height: 14px; border-radius: 50%; background: var(--border); z-index: 1; }
.order-timeline .step.done::after { background: var(--success); }
.order-timeline .step.current::after { background: var(--primary); box-shadow: 0 0 0 4px var(--primary-light); }
.order-timeline .step .label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.order-timeline .step.done .label, .order-timeline .step.current .label { color: var(--text); font-weight: 600; }

/* ============================================================
   认证页
   ============================================================ */
.auth-page {min-height: calc(100vh - var(--header-h));display: grid;place-items: center;padding: 40px 20px;}
.auth-card { background: #fff; border-radius: 20px; box-shadow: 0 24px 60px rgba(0,0,0,.25); width: 100%; max-width: 440px; padding: 40px; }
.auth-card h1 { font-size: 26px; font-weight: 800; margin-bottom: 6px; text-align: center; }
.auth-card .sub { color: var(--text-muted); text-align: center; margin-bottom: 28px; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.form-control {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    transition: all .2s;
    background: #fff;
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.1); }
textarea.form-control { min-height: 100px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-text { font-size: 13px; color: var(--text-muted); margin-top: 6px; }
.form-error { color: var(--danger); font-size: 13px; margin-top: 4px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-light); }
.checkbox-row input { width: 16px; height: 16px; accent-color: var(--primary); }
.auth-footer { text-align: center; margin-top: 20px; font-size: 14px; color: var(--text-muted); }

/* ============================================================
   个人中心
   ============================================================ */
.profile-layout { display: grid; grid-template-columns: 240px 1fr; gap: 28px; padding: 32px 0; align-items: start; }
.profile-side { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; position: sticky; top: calc(var(--header-h) + 20px); }
.profile-card { text-align: center; padding-bottom: 20px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.profile-card .avatar { width: 80px; height: 80px; border-radius: 50%; margin: 0 auto 12px; object-fit: cover; border: 3px solid var(--primary-light); background: var(--primary); color: #fff; display: grid; place-items: center; font-size: 32px; font-weight: 800; }
.profile-card .name { font-size: 18px; font-weight: 700; }
.profile-card .email { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.profile-nav a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 8px; color: var(--text-light); font-weight: 500; transition: all .2s; }
.profile-nav a:hover { background: var(--bg-soft); color: var(--text); }
.profile-nav a.active { background: var(--primary-light); color: var(--primary); }
.profile-nav a .badge { margin-left: auto; background: var(--accent); color: #fff; font-size: 11px; padding: 1px 8px; border-radius: 10px; }
.profile-content { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 28px 32px; box-shadow: var(--shadow-sm); }

.order-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.order-tabs a { padding: 10px 18px; color: var(--text-light); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.order-tabs a.active { color: var(--primary); border-bottom-color: var(--primary); }
.order-tabs a:hover { color: var(--primary); }
.order-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 14px; transition: box-shadow .2s; }
.order-card:hover { box-shadow: var(--shadow); }
.order-card .head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 12px; border-bottom: 1px solid var(--border); margin-bottom: 12px; font-size: 13px; color: var(--text-muted); }
.order-card .status-tag { padding: 3px 12px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.status-tag.s0 { background: #fef3c7; color: #92400e; }
.status-tag.s1 { background: #d1fae5; color: #065f46; }
.status-tag.s2 { background: #dbeafe; color: #1e40af; }
.status-tag.s3 { background: #f1f5f9; color: #475569; }
.status-tag.s4, .status-tag.s5 { background: #fee2e2; color: #991b1b; }
.order-card .item-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.order-card .item-row img { width: 50px; height: 50px; border-radius: 6px; object-fit: cover; background: var(--bg-soft); }
.order-card .item-row .name { flex: 1; font-size: 14px; }
.order-card .foot { display: flex; justify-content: space-between; align-items: center; padding-top: 12px; border-top: 1px solid var(--border); margin-top: 8px; }
.order-card .total { color: var(--accent); font-weight: 800; font-size: 17px; }

/* ============================================================
   提示与分页
   ============================================================ */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; display: flex; align-items: center; gap: 10px; }
.alert-success { background: #d1fae5; color: #065f46; }
.alert-error { background: #fee2e2; color: #991b1b; }
.alert-info { background: #dbeafe; color: #1e40af; }
.alert-warning { background: #fef3c7; color: #92400e; }
.alert-icon { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: rgba(255,255,255,.5); font-weight: 700; flex-shrink: 0; font-size: 13px; }
.alert-success .alert-icon { background: #10b981; color: #fff; }
.alert-error .alert-icon { background: #ef4444; color: #fff; }

/* 表单按钮 loading 状态 */
.btn-loading { position: relative; opacity: .85; cursor: wait !important; }
.btn-loading::before { content: ''; display: inline-block; width: 12px; height: 12px; margin-right: 6px; border: 2px solid rgba(255,255,255,.5); border-top-color: #fff; border-radius: 50%; animation: btn-spin .7s linear infinite; vertical-align: -2px; }
@keyframes btn-spin { to { transform: rotate(360deg); } }

.pagination { margin-top: 32px; display: flex; justify-content: center; }
.pagination ul { display: flex; gap: 6px; list-style: none; }
.pagination li a, .pagination li span { display: block; padding: 8px 14px; border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: 14px; background: #fff; }
.pagination li a:hover { border-color: var(--primary); color: var(--primary); }
.pagination li.active span { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination li.disabled span { color: var(--text-muted); background: var(--bg-soft); cursor: not-allowed; }

/* 空状态 */
.empty { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty .icon { font-size: 56px; margin-bottom: 16px; opacity: .5; }
.empty h3 { font-size: 18px; color: var(--text); margin-bottom: 8px; }
.empty p { margin-bottom: 20px; }

/* 页脚 */
.site-footer { background: #1e293b; color: #cbd5e1; padding: 48px 0 24px; margin-top: 60px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; margin-bottom: 32px; }
.footer-col h4 { color: #fff; font-size: 15px; margin-bottom: 16px; font-weight: 600; }
.footer-col p { font-size: 14px; line-height: 1.8; color: #94a3b8; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col ul li a { color: #94a3b8; font-size: 14px; }
.footer-col ul li a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid #334155; padding-top: 20px; text-align: center; font-size: 13px; color: #64748b; }
.social-links { display: flex; gap: 12px; }
.social-links a { width: 36px; height: 36px; border-radius: 8px; background: #334155; display: grid; place-items: center; color: #cbd5e1; }
.social-links a:hover { background: var(--primary); color: #fff; }

/* 返回顶部 */
.back-to-top { position: fixed; bottom: 30px; right: 30px; width: 46px; height: 46px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow-lg); opacity: 0; visibility: hidden; transition: all .3s; border: none; font-size: 20px; z-index: 90; }
.back-to-top.show { opacity: 1; visibility: visible; }
.back-to-top:hover { background: var(--primary-dark); transform: translateY(-3px); }

/* 模态框 */
.modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.55); display: none; align-items: center; justify-content: center; z-index: 200; padding: 20px; backdrop-filter: blur(4px); }
.modal-overlay.show { display: flex; }
.modal { background: #fff; border-radius: 14px; padding: 28px; max-width: 480px; width: 100%; box-shadow: var(--shadow-lg); }
.modal h3 { font-size: 19px; margin-bottom: 14px; }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* Toast */
.toast-container { position: fixed; top: 84px; right: 24px; z-index: 300; display: flex; flex-direction: column; gap: 10px; }
.toast { background: #fff; border-radius: 10px; padding: 12px 18px; box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 10px; min-width: 240px; border-left: 4px solid var(--primary); animation: slideIn .3s; }
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast .msg { flex: 1; font-size: 14px; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 1024px) {
    .layout { grid-template-columns: 1fr; }
    .sidebar { position: static; flex-direction: row; flex-wrap: wrap; }
    .sidebar .widget { flex: 1; min-width: 280px; }
    .shop-layout { grid-template-columns: 1fr; }
    .shop-filters { position: static; }
    .product-grid { grid-template-columns: repeat(2, 1fr); }
    .product-detail { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .post-card .cover { width: 180px; }
}
@media (max-width: 768px) {
    .main-nav { display: none; }
    .search-box input {width: 0;padding: 18px;}
    .search-box input:focus { width: 200px; }
    .search-box {
    width: 39px;
    }
    .hero h1 { font-size: 30px; }
    .hero p { font-size: 15px; }
    .stats-bar { grid-template-columns: 1fr 1fr; }
    .post-card { flex-direction: column; }
    .post-card .cover { width: 100%; height: 180px; }
    .post-detail { padding: 24px 20px; }
    .post-detail h1 { font-size: 24px; }
    .post-nav { grid-template-columns: 1fr; }
    .comments { padding: 22px 18px; }
    .product-grid { grid-template-columns: 1fr; }
    .profile-layout { grid-template-columns: 1fr; }
    .profile-side { position: static; }
    .footer-grid { grid-template-columns: 1fr; }
    .cart-table th:nth-child(3), .cart-table td:nth-child(3) { display: none; }
    .form-row { grid-template-columns: 1fr; }
    .order-timeline { font-size: 12px; }
}
