/* ------------------------------------
 * Typecho Default Theme · 美化版
 *
 * 在原版基础上重做视觉：留白、圆角卡片、渐变强调色、
 * 吸顶毛玻璃导航、自适应暗色模式。
 * --------------------------------- */

/* ------------------
 * 设计变量
 * --------------- */
:root {
    --c1: #36e0c8;
    --c2: #2f8bff;
    --accent: #2f8bff;
    --grad: linear-gradient(135deg, #36e0c8, #2f8bff);
    --bg: #f5f7fb;
    --bg-soft: #eef2f9;
    --card: #ffffff;
    --card-glass: rgba(255, 255, 255, .82);
    --text: #1f2733;
    --text-soft: #4b566b;
    --muted: #8b95a9;
    --line: #e6ecf5;
    --code-bg: #f3f6fb;
    --on-grad: #04121f;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .06);
    --shadow-hover: 0 6px 16px rgba(16, 24, 40, .08), 0 18px 40px rgba(16, 24, 40, .10);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0b1020;
        --bg-soft: #101a2e;
        --card: #131c30;
        --card-glass: rgba(19, 28, 48, .82);
        --text: #e7eef9;
        --text-soft: #c2cde0;
        --muted: #8695ad;
        --line: #22304a;
        --code-bg: #0e1729;
        --shadow: 0 1px 2px rgba(0, 0, 0, .30), 0 8px 24px rgba(0, 0, 0, .35);
        --shadow-hover: 0 6px 16px rgba(0, 0, 0, .40), 0 18px 40px rgba(0, 0, 0, .45);
    }
}

/* ------------------
 * Global style
 * --------------- */
body {
    background-color: var(--bg);
    color: var(--text);
    font-family: "PingFang SC", "Hiragino Sans GB", "Source Han Sans CN", "Microsoft Yahei", -apple-system,
    BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background: rgba(47, 139, 255, .22);
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color .2s, background-color .2s, box-shadow .2s;
}

a:hover, a:active {
    color: var(--c1);
}

pre, code {
    background: var(--code-bg);
    font-family: Menlo, Monaco, Consolas, "Lucida Console", "Courier New", monospace;
    font-size: .9em;
}

code {
    padding: 2px 6px;
    border-radius: 6px;
    color: var(--text-soft);
}

pre {
    padding: 14px 16px;
    overflow: auto;
    max-height: 400px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    line-height: 1.6;
}

pre code {
    padding: 0;
    background: none;
    color: var(--text-soft);
}

blockquote {
    margin: 1em 0;
    padding: .8em 1.1em;
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    background: var(--bg-soft);
    color: var(--text-soft);
}

blockquote p {
    margin: 0;
}

table {
    border: 1px solid var(--line);
    border-collapse: collapse;
    width: 100%;
}

table th,
table td {
    padding: 8px 12px;
    border: 1px solid var(--line);
}

table th {
    background: var(--bg-soft);
    color: var(--text);
}

h1, h2, h3, h4, h5, h6 {
    font-family: inherit;
    font-weight: 700;
    color: var(--text);
    line-height: 1.4;
}

input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
textarea {
    padding: 9px 12px;
    border: 1px solid var(--line);
    width: 100%;
    border-radius: var(--radius-sm);
    background: var(--card);
    color: var(--text);
    font-family: inherit;
    font-size: 1em;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    transition: border-color .2s, box-shadow .2s;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="password"]:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(47, 139, 255, .16);
}

textarea {
    resize: vertical;
}

/* Special link style */
.post-meta a,
.post-content a,
.widget a,
.comment-content a {
    border-bottom: 1px dashed var(--line);
}

.post-meta a:hover,
.post-content a:hover,
.widget a:hover,
.comment-content a:hover {
    border-bottom-color: transparent;
}

/* ------------------
 * Header
 * --------------- */

#header {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 14px 0 10px;
    background: var(--card-glass);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--line);
}

#logo {
    display: inline-block;
    color: var(--text);
    font-size: 1.9em;
    font-weight: 800;
    letter-spacing: .5px;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

#logo img {
    max-height: 48px;
}

.description {
    margin: .35em 0 0;
    color: var(--muted);
    font-style: normal;
    font-size: .9em;
}

/* Navigation menu */
#nav-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 12px 0 0;
    padding: 0;
}

#nav-menu a {
    display: inline-block;
    float: none;
    margin: 0;
    padding: 7px 14px;
    border: none;
    border-radius: 999px;
    height: auto;
    line-height: 1.3;
    color: var(--text-soft);
    font-size: .95em;
    transition: color .2s, background-color .2s, transform .2s;
}

#nav-menu a:hover {
    background: var(--bg-soft);
    color: var(--text);
    transform: translateY(-1px);
}

#nav-menu .current {
    background: var(--grad);
    color: var(--on-grad);
    font-weight: 600;
}

/* Search */
#search {
    position: relative;
    margin-top: 12px;
}

#search input.text {
    padding: 8px 40px 8px 14px;
    border-radius: 999px;
    background: var(--bg-soft);
    border-color: transparent;
}

#search input.text:focus {
    background: var(--card);
}

#search button {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    padding: 0;
    width: 24px;
    height: 24px;
    background: transparent url(img/icon-search.png) no-repeat center center;
    direction: ltr; /* fix RTL language */
    text-indent: -9999em;
    cursor: pointer;
    opacity: .6;
}

#search button:hover {
    opacity: 1;
}

@media
(-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {
    #search button {
        background-image: url(img/icon-search@2x.png);
        -webkit-background-size: 24px 24px;
        -moz-background-size: 24px 24px;
        -o-background-size: 24px 24px;
        background-size: 24px 24px;
    }
}

/* ------------------
 * 首页 Hero
 * --------------- */
.site-hero {
    position: relative;
    overflow: hidden;
    margin: 18px 0 20px;
    padding: 26px 26px 28px;
    border-radius: var(--radius);
    background: var(--grad);
    color: var(--on-grad);
    box-shadow: 0 10px 30px rgba(47, 139, 255, .25);
}

.site-hero:after {
    content: "";
    position: absolute;
    right: -50px;
    bottom: -90px;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .18);
}

.site-hero-title {
    position: relative;
    margin: 0;
    font-size: 1.9em;
    font-weight: 800;
    letter-spacing: .5px;
    color: var(--on-grad);
}

.site-hero-desc {
    position: relative;
    margin: .4em 0 0;
    font-size: .95em;
    opacity: .85;
    color: var(--on-grad);
}

/* ------------------
 * Main
 * --------------- */
#main,
#secondary {
    padding-top: 18px;
}

.post {
    position: relative;
    margin: 0 0 18px;
    padding: 22px 24px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: transform .25s, box-shadow .25s, border-color .25s;
}

.post:before {
    content: "";
    position: absolute;
    left: 0;
    top: 20px;
    bottom: 20px;
    width: 3px;
    border-radius: 3px;
    background: var(--grad);
    opacity: 0;
    transition: opacity .25s;
}

.post:hover {
    transform: translateY(-3px);
    border-color: transparent;
    box-shadow: var(--shadow-hover);
}

.post:hover:before {
    opacity: 1;
}

.post-title {
    margin: 0 0 .55em;
    font-size: 1.35em;
    font-weight: 700;
    line-height: 1.45;
}

.post-title a {
    color: var(--text);
}

.post-title a:hover {
    color: var(--accent);
}

.post-meta {
    list-style: none;
    margin: 0 0 14px;
    padding: 0;
    color: var(--muted);
    font-size: .85em;
}

.post-meta li {
    display: inline-block;
    margin: 0 6px 6px 0;
    padding: 4px 11px;
    border: none;
    border-left: 0;
    border-radius: 999px;
    background: var(--bg-soft);
    color: var(--muted);
}

.post-meta li:first-child {
    margin-left: 0;
    padding-left: 11px;
    border: none;
}

.post-content {
    line-height: 1.8;
    color: var(--text-soft);
}

.post-content p {
    margin: .7em 0;
}

.post-content img,
.comment-content img {
    border-radius: var(--radius-sm);
}

.post .tags {
    clear: both;
    margin: 14px 0 0;
    color: var(--muted);
    font-size: .85em;
}

.tags a {
    display: inline-block;
    margin: 0 4px 0 0;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--bg-soft);
    border-bottom: none;
    color: var(--text-soft);
}

.tags a:hover {
    background: var(--grad);
    color: var(--on-grad);
}

.more {
    margin: 16px 0 0;
    text-align: left;
}

.more a {
    display: inline-block;
    padding: 7px 18px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--accent);
    font-size: .9em;
    background: transparent;
}

.more a:hover {
    background: var(--grad);
    border-color: transparent;
    color: var(--on-grad);
}

.post-near {
    list-style: none;
    margin: 20px 0;
    padding: 0;
    color: var(--text-soft);
}

.post-near li {
    margin: 8px 0;
    padding: 10px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--card);
}

.archive-title {
    margin: 0 0 16px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    background: var(--bg-soft);
    color: var(--text-soft);
    font-size: .95em;
}

.protected .text {
    width: 50%;
}

/* Page nav */
.page-navigator {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin: 22px 0;
    padding: 0;
    text-align: center;
}

.page-navigator li {
    display: inline-block;
    margin: 0;
}

.page-navigator a {
    display: inline-block;
    min-width: 36px;
    padding: 0 12px;
    height: 36px;
    line-height: 36px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--card);
    color: var(--text-soft);
}

.page-navigator a:hover {
    background: var(--grad);
    border-color: transparent;
    color: var(--on-grad);
    transform: translateY(-1px);
}

.page-navigator .current a {
    color: var(--on-grad);
    background: var(--grad);
    border-color: transparent;
    font-weight: 600;
}

/* ------------------
 * Comment list
 * --------------- */
#comments {
    margin-top: 18px;
    padding: 20px 24px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

#comments > h3 {
    margin: 0 0 14px;
    font-size: 1.1em;
}

.comment-list, .comment-list ol {
    list-style: none;
    margin: 0;
    padding: 0;
}

.comment-list li {
    padding: 14px 16px;
    margin-top: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--card);
}

.comment-list li.comment-level-odd {
    background: var(--bg-soft);
}

.comment-list li.comment-level-even {
    background: var(--card);
}

.comment-list li.comment-by-author {
    border-color: var(--c1);
    background: var(--card);
}

.comment-list li .comment-reply {
    text-align: right;
    font-size: .9em;
}

.comment-meta a {
    color: var(--muted);
    font-size: .9em;
}

.comment-author {
    display: block;
    margin-bottom: 3px;
    color: var(--text);
}

.comment-author .avatar {
    float: left;
    margin-right: 10px;
    border-radius: 50%;
}

.comment-author cite {
    font-weight: bold;
    font-style: normal;
}

/* Comment reply */
.comment-list .respond {
    margin-top: 15px;
    border-top: 1px solid var(--line);
}

.respond .cancel-comment-reply {
    float: right;
    margin-top: 15px;
    font-size: .9em;
}

#comment-form label {
    display: block;
    margin-bottom: .5em;
    font-weight: bold;
    color: var(--text);
}

#comment-form .required:after {
    content: " *";
    color: #C00;
}

#comment-form .submit {
    padding: 9px 22px;
    border: none;
    border-radius: 999px;
    background: var(--grad);
    color: var(--on-grad);
    font-weight: 600;
    font-family: inherit;
    font-size: 1em;
    cursor: pointer;
    transition: transform .2s, box-shadow .2s;
}

#comment-form .submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(47, 139, 255, .35);
}

/* ------------------
 * secondary
 * --------------- */
#secondary {
    word-wrap: break-word;
}

.widget {
    margin-bottom: 18px;
    padding: 18px 20px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.widget-title {
    position: relative;
    margin: 0 0 12px;
    padding-left: 12px;
    font-size: 1em;
    font-weight: 700;
    color: var(--text);
}

.widget-title:before {
    content: "";
    position: absolute;
    left: 0;
    top: .2em;
    bottom: .2em;
    width: 4px;
    border-radius: 4px;
    background: var(--grad);
}

.widget-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget-list li {
    margin: 0 0 2px;
    padding: 6px 8px;
    border-radius: 8px;
    line-height: 1.6;
    transition: background-color .2s;
}

.widget-list li:hover {
    background: var(--bg-soft);
}

.widget-list li ul {
    margin-left: 15px;
}

.widget-list a {
    color: var(--text-soft);
}

.widget-list a:hover {
    color: var(--accent);
}

/* ------------------
 * Footer
 * --------------- */
#footer {
    margin-top: 18px;
    padding: 28px 0 36px;
    line-height: 1.6;
    text-align: center;
    color: var(--muted);
    border-top: 1px solid var(--line);
}

#footer a {
    color: var(--text-soft);
}

#footer a:hover {
    color: var(--accent);
}

/* -----------------
 * Error page
 * -------------- */
.error-page {
    margin-top: 80px;
    margin-bottom: 100px;
    padding: 40px 24px;
    text-align: center;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* -----------------
 * Content format
 *--------------- */
.post-content, .comment-content {
    line-height: 1.8;
    word-wrap: break-word;
}

.post-content h2, .comment-content h2 {
    font-size: 1.25em;
}

.post-content img, .comment-content img,
.post-content video, .comment-content video {
    max-width: 100%;
}

.post-content a img,
.comment-content a img {
    background: none;
    position: static;
}

.post-content hr, .comment-content hr {
    margin: 2em auto;
    width: 100px;
    border: 1px solid var(--line);
    border-width: 2px 0 0 0;
}

/* -----------------
 * Misc
 *--------------- */
.aligncenter, div.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.alignleft {
    float: left;
}

.alignright {
    float: right;
}

img.alignleft {
    margin: 0 15px 0 0;
}

img.alignright {
    margin: 0 0 0 15px;
}

/* -----------------
 * Responsive
 *--------------- */
@media (max-width: 767px) {
    body {
        font-size: 14px;
    }
    #header {
        padding: 10px 0 8px;
    }
    #logo {
        font-size: 1.6em;
    }
    #nav-menu {
        gap: 4px;
    }
    #nav-menu a {
        float: none;
        display: inline-block;
        margin: 0;
        padding: 6px 12px;
        font-size: .9em;
    }
    .site-hero {
        margin: 14px 0 16px;
        padding: 20px 18px 22px;
    }
    .site-hero-title {
        font-size: 1.5em;
    }
    .post,
    #comments {
        padding: 18px 16px;
    }
}

@media (max-width: 768px) {
    #header,
    .post-title,
    .post-meta,
    .more {
        text-align: left;
    }
}

@media (min-width: 768px) {
    #body {
        padding-bottom: 10px;
    }
}

@media (min-width: 1200px) {
    .container {
        max-width: 1080px;
    }
}

/*
* Hide from both screenreaders and browsers: h5bp.com/u
*/
.hidden {
    display: none !important;
    visibility: hidden;
}

/*
* Hide only visually, but have it available for screenreaders: h5bp.com/v
*/
.sr-only {
    border: 0;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
}

/*
* Extends the .sr-only class to allow the element to be focusable
* when navigated to via the keyboard: h5bp.com/p
*/
.sr-only.focusable:active,
.sr-only.focusable:focus {
    clip: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    position: static;
    width: auto;
}

/*
* Hide visually and from screenreaders, but maintain layout
*/
.invisible {
    visibility: hidden;
}
