/* css/app.css */

/* =========================================
   1. CSS Variables (全局变量)
   ========================================= */
:root {
    --surface-text: 17 24 39;
    --surface-bg: 255 255 255;
    --surface-border: 226 232 240;
    
    /* Colors Palette */
    --lime-600: 101 163 13;
    --sky-600: 2 132 199;
    --gray-400: 156 163 175;
    --orange-400: 251 146 60;
    --rose-500: 244 63 94;
    --blue-500: 59 130 246;
    --green-500: 34 197 94;
    --primary-hue-500: 43 182 115; /* Adjusted to match green theme */

    /* Gradients & Shadows */
    --gradient-magic: linear-gradient(to right, #25aae1, #40e495, #30dd8a, #2bb673);
    --shadow-glowing: 0 4px 15px 0 rgba(49, 196, 190, 0.75);
    --shadow-card: 0 2px 10px rgba(0,0,0,0.03);
    --shadow-float: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* =========================================
   2. Global Helpers (通用辅助类)
   ========================================= */

/* Magic Text Gradient */
.text-seasalt,
.hover\:text-seasalt:hover{
    background-image: var(--gradient-magic);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    background-size: 300% 100%;
    transition: all 0.1s ease-in-out;
}

/* Magic Background Gradient Button */
.bg-seasalt {
    background-image: var(--gradient-magic);
    background-size: 300% 100%;
    color: white;
    transition: all 0.1s ease-in-out;
    cursor: pointer;
}
.bg-seasalt:hover {
    background-position: 100% 0;
}

/* Glowing Shadow Effect */
.glowing:hover {
    box-shadow: var(--shadow-glowing);
}

/* Search Input Focus Effect */
.search-focus:focus {
    border-color: transparent;
    outline: none;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #40e495; 
    border-image-source: var(--gradient-magic);
    border-image-slice: 1;
}

/* Vertical Align Helper */
.vertical-bottom {
    vertical-align: text-bottom;
}

/* =========================================
   3. Component Styles (页面特定组件)
   ========================================= */

/* --- Index Page: Sadie Effect (Hero Card) --- */
.effect-sadie figcaption::before {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    content: '';
    opacity: 0;
    transform: translateY(50%); /* translate-y-1/2 */
    transition: all 0.3s;
    background: linear-gradient(to bottom, rgba(72,76,97,0) 0%, rgba(72,76,97,0.8) 75%);
}

.effect-sadie h2 {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    color: #484c61;
    transform: translateY(-50%);
    transition: all 0.3s;
}

.effect-sadie p {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 2rem;
    opacity: 0;
    transform: translateY(0.5rem); /* translate-y-2 */
    transition: all 0.3s;
    color: white;
}

.effect-sadie:hover h2 {
    color: white;
    transform: translateY(-50%) translateY(-2.5rem); /* -translate-y-10 approx */
}

.effect-sadie:hover figcaption::before,
.effect-sadie:hover p {
    opacity: 1;
    transform: translateY(0);
}

/* --- Index Page: Tooltip --- */
[data-tips] {
    position: relative;
}
[data-tips]::after {
    content: attr(data-tips);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 0.5rem;
    padding: 0.5rem 0.75rem;
    background-color: #65C18C;
    color: white;
    font-size: 0.75rem;
    border-radius: 0.25rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    pointer-events: none;
    white-space: pre;
    z-index: 10;
}
[data-tips]:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-0.25rem);
}

/* --- App Center: App Card Hover --- */
.app-card {
    transition: all 0.3s;
    border: 1px solid transparent;
}
.app-card:hover {
    transform: translateY(-0.25rem);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); /* shadow-lg */
    border-color: #e5e7eb; /* border-gray-200 */
}

/* --- Hire Me Page: Navigation Links --- */
.nav-link {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 1.125rem; /* text-lg */
    color: black;
    transition: color 0.15s;
}
.nav-link:hover {
    background-image: var(--gradient-magic);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.nav-link.active {
    background-image: var(--gradient-magic);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 500;
}

/* --- Hire Me Page: Service Cards --- */
.service-card {
    background-color: white;
    padding: 2rem;
    border-radius: 1rem;
    border: 1px solid #f3f4f6; /* border-gray-100 */
    box-shadow: var(--shadow-card);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    z-index: 10;
}
.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(to right, #25aae1, #30dd8a);
    transform: scaleX(0);
    transition: transform 0.3s;
    transform-origin: left;
}
.service-card:hover {
    box-shadow: var(--shadow-float);
    transform: translateY(-0.5rem);
}
.service-card:hover::before {
    transform: scaleX(1);
}

/* =========================================
   4. Markdown Content Styles (文章详情页)
   ========================================= */

/* Table Styles */
.article-content table {
    border-collapse: collapse;
    border-spacing: 0;
    width: 100%;
    background-color: rgb(var(--surface-bg));
    color: rgb(var(--surface-text));
    border: 1px solid rgb(var(--surface-border));
    border-radius: 8px;
    overflow: hidden;
}

.article-content table tr {
    background-color: rgb(var(--surface-bg));
    transition: all .3s;
}

.article-content table tr th,
.article-content table tr td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid rgb(var(--surface-border));
    font-size: 0.95rem;
}

.article-content table tr th {
    background-color: #f8fafc;
    font-weight: 600;
    color: #1f2937;
}

.article-content table tr:last-child td {
    border-bottom: none;
}

.article-content table tbody tr:hover {
    background-color: #f1f5f9;
}

/* Lists */
.article-content ul { list-style-type: disc; padding-left: 1.5rem; margin-bottom: 1rem; }
.article-content ol { list-style-type: decimal; padding-left: 1.5rem; margin-bottom: 1rem; }
.article-content li { margin-bottom: 0.25rem; }

/* Links */
.article-content a {
    color: rgb(var(--primary-hue-500));
    text-decoration: none;
    border-bottom: 1px dashed transparent;
    transition: all 0.2s;
}
.article-content a:hover {
    color: rgb(var(--primary-hue-500));
    border-bottom-color: rgb(var(--primary-hue-500));
}

/* Code Blocks Wrapper */
pre {
    border-radius: 0.5rem;
    position: relative;
    margin: 1.5rem 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Decorative Blur Behind Code Blocks */
pre:before {
    background-color: rgba(var(--primary-hue-500) / 1);
    border-radius: 50%;
    content: "";
    filter: blur(60px);
    opacity: 0.15;
    position: absolute;
    top: -8rem;
    right: -10rem;
    width: 25em;
    height: 25em;
    z-index: 0;
    pointer-events: none;
}

/* Inline Code */
:not(pre) > code {
    background-color: rgba(var(--primary-hue-500) / 0.1);
    color: rgb(var(--primary-hue-500));
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.875em;
    padding: 0.2em 0.4em;
    border-radius: 0.25rem;
}

/* Highlight.js Colors (Custom Theme) */
.hljs-doctag, .hljs-keyword, .hljs-meta .hljs-keyword, .hljs-template-tag, .hljs-template-variable, .hljs-type, .hljs-variable.language_ { color: #ff7b72; }
.hljs-title, .hljs-title.class_, .hljs-title.class_.inherited__, .hljs-title.function_ { color: #d2a8ff; }
.hljs-attr, .hljs-attribute, .hljs-literal, .hljs-meta, .hljs-number, .hljs-operator, .hljs-selector-attr, .hljs-selector-class, .hljs-selector-id, .hljs-variable { color: #0284c7; }
.hljs-meta .hljs-string, .hljs-regexp, .hljs-string { color: #65a30d; }
.hljs-tag, .code-line { color: #8b949e; }
.hljs-built_in, .hljs-symbol { color: #ffa657; }
.hljs-code, .hljs-comment, .hljs-formula { color: #8b949e; font-style: italic; }
.hljs-name, .hljs-quote, .hljs-selector-pseudo, .hljs-selector-tag { color: #ff7b72; }
.hljs-subst { color: #f0883e; }
.hljs-section { color: #1f6feb; font-weight: 700; }
.hljs-punctuation { color: #6b7280; }

/* Mermaid Container */
.mermaid {
    display: flex;
    justify-content: center;
    background: #f8fafc;
    padding: 2rem;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
    margin: 1.5rem 0;
    overflow-x: auto;
}

/* Custom Scrollbar for Code Blocks */
/*.custom-scroll::-webkit-scrollbar { width: 8px; height: 8px; }*/
/*.custom-scroll::-webkit-scrollbar-track { background: transparent; }*/
/*.custom-scroll::-webkit-scrollbar-thumb { background: #4b5563; border-radius: 4px; }*/
/*.custom-scroll::-webkit-scrollbar-thumb:hover { background: #6b7280; }*/
