/* 青蒿寻方 — XinRui.TECH */
/* Health Fantastic 色系 */
:root {
    --primary:    #0D9488;
    --primary-dk: #0F766E;
    --primary-lt: #14B8A6;
    --accent:     #6366F1;
    --accent-lt:  #818CF8;
    --warm:       #F59E0B;
    --surface:    #F0FDFA;
    --card:       #FFFFFF;
    --ink:        #1E293B;
    --muted:      #64748B;
    --border:     #E2E8F0;
    --glow:       rgba(13,148,136,0.12);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
    background: var(--surface);
    color: var(--ink);
    line-height: 1.8;
    min-height: 100vh;
}
a { color: var(--primary-dk); text-decoration: none; transition: color .2s; }
a:hover { color: var(--accent); }

/* ── 导航栏 ─────────────────────────── */
.navbar {
    background: linear-gradient(135deg, #0F766E 0%, #0D9488 50%, #14B8A6 100%);
    color: #fff;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    box-shadow: 0 4px 20px rgba(13,148,136,0.15);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
}
.navbar .brand {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}
.navbar .brand::before {
    content: '🌿';
    font-size: 1.3rem;
}
.navbar .brand span {
    color: rgba(255,255,255,0.5);
    font-weight: 400;
    font-size: 0.8rem;
    margin-left: 4px;
}
.navbar nav a {
    color: rgba(255,255,255,0.85);
    margin-left: 1.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color .2s;
    position: relative;
}
.navbar nav a:hover {
    color: #fff;
    text-decoration: none;
}
.navbar nav a:hover::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0; right: 0;
    height: 2px;
    background: rgba(255,255,255,0.6);
    border-radius: 1px;
}
.navbar .user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
}
.navbar .user-info a { color: rgba(255,255,255,0.8); }

/* ── 布局 ─────────────────────────── */
.container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 2rem;
}

/* ── 首页 Hero ─────────────────── */
.hero {
    text-align: center;
    padding: 4rem 0 2.5rem;
}
.hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: 8px;
    background: linear-gradient(135deg, var(--primary-dk), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero p {
    color: var(--muted);
    margin-top: 0.8rem;
    font-size: 1.1rem;
    font-weight: 400;
}

/* ── 分类卡片 ─────────────────── */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}
.category-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    transition: all .3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    color: var(--ink);
    display: block;
    position: relative;
    overflow: hidden;
}
.category-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    opacity: 0;
    transition: opacity .3s;
}
.category-card:hover {
    box-shadow: 0 8px 32px var(--glow);
    transform: translateY(-4px);
    text-decoration: none;
    border-color: var(--primary-lt);
}
.category-card:hover::before {
    opacity: 1;
}
.category-card .icon { font-size: 2.5rem; }
.category-card h3 {
    margin: 0.8rem 0 0.4rem;
    color: var(--primary-dk);
    font-size: 1.25rem;
    font-weight: 700;
}
.category-card .desc { color: var(--muted); font-size: 0.9rem; line-height: 1.6; }
.category-card .count {
    display: inline-block;
    margin-top: 0.8rem;
    padding: 0.2rem 0.8rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-lt));
    color: #fff;
    border-radius: 2rem;
    font-size: 0.8rem;
    font-weight: 600;
}

/* ── 分类列表页 ─────────────────── */
.breadcrumb {
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 1.5rem;
}
.breadcrumb a { color: var(--primary); }
.page-list { list-style: none; }
.page-list li {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.2rem 1.5rem;
    margin-bottom: 0.8rem;
    transition: all .2s;
}
.page-list li:hover {
    border-color: var(--primary-lt);
    box-shadow: 0 4px 16px var(--glow);
    transform: translateX(4px);
}
.page-list a {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--ink);
}
.page-list a:hover { color: var(--primary); }
.page-list .excerpt { color: var(--muted); font-size: 0.9rem; margin-top: 0.3rem; }

/* ── 知识页面 ─────────────────── */
.wiki-content {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 3rem;
    margin-top: 1rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}
.wiki-content h1 {
    color: var(--primary-dk);
    font-size: 1.8rem;
    font-weight: 800;
    border-bottom: 3px solid;
    border-image: linear-gradient(90deg, var(--primary), var(--accent)) 1;
    padding-bottom: 0.6rem;
    margin-bottom: 1rem;
}
.wiki-content h2 {
    color: var(--primary-dk);
    font-size: 1.3rem;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.wiki-content h2::before {
    content: '';
    width: 4px;
    height: 1.2em;
    background: linear-gradient(to bottom, var(--primary), var(--accent));
    border-radius: 2px;
}
.wiki-content h3 {
    color: var(--accent);
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 1.2rem;
}
.wiki-content blockquote {
    border-left: 4px solid;
    border-image: linear-gradient(to bottom, var(--primary-lt), var(--accent-lt)) 1;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    background: linear-gradient(135deg, #F0FDFA, #EEF2FF);
    color: var(--ink);
    font-style: normal;
    border-radius: 0 12px 12px 0;
    font-size: 0.95rem;
    line-height: 2;
}
.wiki-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.95rem;
    border-radius: 8px;
    overflow: hidden;
}
.wiki-content th {
    background: linear-gradient(135deg, var(--primary-dk), var(--primary));
    color: #fff;
    padding: 0.6rem 1rem;
    text-align: left;
    font-weight: 600;
}
.wiki-content td {
    padding: 0.6rem 1rem;
    border-bottom: 1px solid var(--border);
}
.wiki-content tr:nth-child(even) td { background: #F8FAFC; }
.wiki-content a {
    color: var(--primary);
    border-bottom: 1px dashed var(--primary-lt);
    transition: all .2s;
}
.wiki-content a:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}
.wiki-content hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
    margin: 2rem 0;
}

/* ── 水印 ─────────────────── */
.watermark {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 9999;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='200'%3E%3Ctext transform='rotate(-25)' x='-40' y='120' fill='%230D9488' fill-opacity='0.08' font-size='16' font-family='sans-serif'%3EXinRui.TECH%3C/text%3E%3C/svg%3E");
    background-repeat: repeat;
}

/* ── 登录/注册页 ─────────────────── */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #F0FDFA 0%, #EEF2FF 100%);
}
.auth-box {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2.5rem;
    width: 400px;
    max-width: 90vw;
    box-shadow: 0 12px 40px rgba(13,148,136,0.1);
}
.auth-box h1 {
    text-align: center;
    color: var(--primary-dk);
    font-size: 1.5rem;
    letter-spacing: 3px;
    margin-bottom: 0.3rem;
}
.auth-box .subtitle {
    text-align: center;
    color: var(--muted);
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
}
.auth-box label {
    display: block;
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 0.3rem;
    margin-top: 1rem;
    font-weight: 500;
}
.auth-box input[type="text"],
.auth-box input[type="password"] {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    background: #F8FAFC;
    transition: all .2s;
}
.auth-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13,148,136,0.1);
    background: #fff;
}
.auth-box button {
    width: 100%;
    padding: 0.8rem;
    margin-top: 1.5rem;
    background: linear-gradient(135deg, var(--primary-dk), var(--primary));
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 1.05rem;
    font-family: inherit;
    cursor: pointer;
    letter-spacing: 2px;
    font-weight: 600;
    transition: all .2s;
    box-shadow: 0 4px 16px rgba(13,148,136,0.2);
}
.auth-box button:hover {
    background: linear-gradient(135deg, var(--primary), var(--primary-lt));
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(13,148,136,0.3);
}
.auth-box .error {
    background: #FEF2F2;
    color: #DC2626;
    padding: 0.5rem 0.8rem;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-top: 1rem;
    text-align: center;
}
.auth-box .switch {
    text-align: center;
    margin-top: 1.2rem;
    font-size: 0.9rem;
    color: var(--muted);
}

/* ── 防复制 ─────────────────── */
.no-select {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* ── 分享按钮 ─────────────────── */
.share-btn {
    background: linear-gradient(135deg, var(--accent), var(--accent-lt));
    color: #fff;
    border: none;
    padding: 0.4rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all .2s;
    box-shadow: 0 2px 8px rgba(99,102,241,0.2);
}
.share-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}

/* ── 分享对话框 ─────────────────── */
.modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(15,23,42,0.5);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
}
.modal-content {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2rem;
    width: 420px;
    max-width: 90vw;
    box-shadow: 0 16px 48px rgba(0,0,0,0.15);
}
.modal-content h3 {
    color: var(--primary-dk);
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}
.modal-content p { color: var(--muted); margin-bottom: 1rem; }
.share-options {
    display: flex;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
}
.share-options button {
    flex: 1;
    padding: 0.7rem;
    background: linear-gradient(135deg, var(--primary-dk), var(--primary));
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all .2s;
}
.share-options button:hover {
    background: linear-gradient(135deg, var(--primary), var(--primary-lt));
    transform: translateY(-1px);
}
#share-result {
    margin-bottom: 1rem;
}
#share-result input {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.85rem;
    font-family: monospace;
    margin-bottom: 0.5rem;
    background: #F8FAFC;
}
#share-result button {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 0.45rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
}
.modal-close {
    width: 100%;
    padding: 0.6rem;
    background: #F1F5F9;
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    color: var(--muted);
    font-weight: 500;
    transition: all .2s;
}
.modal-close:hover {
    background: #E2E8F0;
}

/* ── 页脚 ─────────────────── */
.footer {
    text-align: center;
    padding: 2.5rem;
    color: var(--muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
    margin-top: 3rem;
    background: #F8FAFC;
}

/* ── 响应式 ─────────────────── */
@media (max-width: 768px) {
    .navbar { padding: 0 1rem; height: 52px; }
    .navbar .brand { font-size: 1.1rem; }
    .navbar nav a { margin-left: 0.8rem; font-size: 0.85rem; }
    .container { padding: 1rem; }
    .hero h1 { font-size: 1.8rem; letter-spacing: 4px; }
    .category-grid { grid-template-columns: 1fr; }
    .wiki-content { padding: 1.5rem; border-radius: 12px; }
}
