/* Line CMS - Public Site Styles */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', 'Microsoft JhengHei', 'PingFang TC', 'Noto Sans TC', sans-serif;
    background: #0a0e1a;
    color: #c8d6e5;
    line-height: 1.9;
    font-size: 17px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: #00d4ff; text-decoration: none; transition: color 0.2s; }
a:hover { color: #74b9ff; }

/* Navbar */
.navbar {
    background: rgba(10, 14, 26, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 212, 255, 0.15);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3em;
    font-weight: 700;
    color: #00d4ff;
}

.logo-icon { font-size: 1.2em; }

.nav-menu {
    list-style: none;
    display: flex;
    gap: 5px;
    margin: 0;
}

.nav-menu a {
    display: block;
    padding: 8px 16px;
    color: #c8d6e5;
    border-radius: 8px;
    font-size: 0.95em;
    transition: all 0.2s;
}

.nav-menu a:hover {
    background: rgba(0, 212, 255, 0.1);
    color: #00d4ff;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: #00d4ff;
    border-radius: 2px;
}

/* Hero */
.hero {
    background: linear-gradient(135deg, #0a0e1a 0%, #0f1525 50%, #0a0e1a 100%);
    padding: 27px 30px;
    text-align: center;
    border-bottom: 1px solid rgba(0, 212, 255, 0.1);
}

.hero-title {
    font-size: 2.5em;
    color: #00d4ff;
    line-height: 1.4;
    margin-bottom: 15px;
    text-shadow: 0 0 30px rgba(0, 212, 255, 0.2);
}

.hero-subtitle {
    color: #5a6a7e;
    font-size: 1.15em;
    max-width: 600px;
    margin: 0 auto;
}

/* Hero title/subtitle link wrappers */
.hero-title-link {
    text-decoration: none;
    display: block;
}

.hero-title-link:hover {
    text-decoration: none;
}

.hero-subtitle-link {
    text-decoration: none;
    display: block;
    max-width: 600px;
    margin: 0 auto;
}

.hero-subtitle-link:hover {
    text-decoration: none;
}

.hero-subtitle-link p {
    transition: opacity 0.2s;
}

.hero-subtitle-link:hover p {
    opacity: 0.8;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 30px;
    flex: 1;
}

/* Article Grid */
.article-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.article-card {
    background: rgba(15, 25, 45, 0.6);
    border: 1px solid rgba(0, 212, 255, 0.12);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    border-color: rgba(0, 212, 255, 0.3);
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 212, 255, 0.08);
}

.card-cover {
    display: block;
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: #0f1525;
}

.card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.article-card:hover .card-cover img {
    transform: scale(1.05);
}

.card-cover-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3em;
    color: rgba(0, 212, 255, 0.3);
}

.card-body {
    padding: 16px 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-category {
    display: inline-block;
    font-size: 0.78em;
    color: #74b9ff;
    background: rgba(116, 185, 255, 0.1);
    padding: 2px 10px;
    border-radius: 4px;
    margin-bottom: 10px;
    align-self: flex-start;
}

.card-title {
    font-size: 1.05em;
    line-height: 1.45;
    margin-bottom: 8px;
}

.card-title a {
    color: #dfe6e9;
}

.card-title a:hover {
    color: #00d4ff;
}

.card-summary {
    color: #5a6a7e;
    font-size: 0.85em;
    flex: 1;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    display: flex;
    gap: 12px;
    font-size: 0.78em;
    color: #5a6a7e;
    padding-top: 10px;
    border-top: 1px solid rgba(0, 212, 255, 0.08);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 40px;
}

.pagination a, .pagination .current {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.9em;
}

.pagination a {
    background: rgba(15, 25, 45, 0.6);
    border: 1px solid rgba(0, 212, 255, 0.12);
    color: #c8d6e5;
}

.pagination a:hover {
    background: rgba(0, 212, 255, 0.1);
    border-color: rgba(0, 212, 255, 0.3);
}

.pagination .current {
    background: #00d4ff;
    color: #0a0e1a;
    font-weight: 600;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 80px 30px;
}

.empty-state h2 {
    color: #00d4ff;
    margin-bottom: 15px;
}

.empty-state p {
    color: #5a6a7e;
    margin-bottom: 25px;
}

.error-code {
    font-size: 4em;
    color: rgba(0, 212, 255, 0.3);
    margin-bottom: 10px;
}

.btn {
    display: inline-block;
    padding: 10px 25px;
    background: linear-gradient(135deg, #00d4ff, #0078d4);
    color: #0a0e1a;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.3);
    color: #0a0e1a;
}

/* Article detail page */
.article-container {
    max-width: 860px;
    margin: 0 auto;
    padding: 40px 30px 80px;
}

.article-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid rgba(0, 212, 255, 0.15);
}

.article-header h1 {
    font-size: 2em;
    color: #00d4ff;
    line-height: 1.4;
    margin-bottom: 12px;
}

.article-meta {
    display: flex;
    justify-content: center;
    gap: 20px;
    color: #5a6a7e;
    font-size: 0.85em;
}

.meta-cat a {
    color: #74b9ff;
    background: rgba(116, 185, 255, 0.1);
    padding: 2px 10px;
    border-radius: 4px;
}

.cover-image {
    width: 100%;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 8px 40px rgba(0, 212, 255, 0.1);
}

.article-body {
    line-height: 1.9;
}

.article-body p {
    margin-bottom: 18px;
    text-align: justify;
}

.article-body h2 {
    color: #00d4ff;
    font-size: 1.5em;
    margin-top: 50px;
    margin-bottom: 20px;
    padding-left: 18px;
    border-left: 4px solid #00d4ff;
}

.article-body h3 {
    color: #74b9ff;
    font-size: 1.2em;
    margin-top: 35px;
    margin-bottom: 15px;
}

.article-body h4 {
    color: #a29bfe;
    font-size: 1.05em;
    margin-top: 25px;
    margin-bottom: 12px;
}

.article-body ul,
.article-body ol {
    margin: 18px 0 18px 25px;
}

.article-body li {
    margin-bottom: 10px;
}

.article-body blockquote {
    background: rgba(162, 155, 254, 0.08);
    border-left: 4px solid #a29bfe;
    padding: 20px 25px;
    margin: 25px 0;
    border-radius: 0 10px 10px 0;
    color: #b2bec3;
}

.article-body blockquote p {
    margin-bottom: 0;
}

.article-body code {
    background: rgba(0, 212, 255, 0.1);
    color: #00d4ff;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.9em;
}

.article-body pre {
    background: rgba(10, 14, 26, 0.8);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 10px;
    padding: 20px;
    overflow-x: auto;
    margin: 20px 0;
}

.article-body pre code {
    background: none;
    padding: 0;
}

.article-body img {
    max-width: 100%;
    border-radius: 8px;
    margin: 15px 0;
}

.article-body a {
    color: #00d4ff;
    text-decoration: underline;
}

.article-body strong {
    color: #dfe6e9;
    font-weight: 700;
}

.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.article-body th,
.article-body td {
    border: 1px solid rgba(0, 212, 255, 0.15);
    padding: 10px 15px;
    text-align: left;
}

.article-body th {
    background: rgba(0, 212, 255, 0.05);
    color: #00d4ff;
}

.article-body hr {
    border: none;
    border-top: 1px solid rgba(0, 212, 255, 0.15);
    margin: 30px 0;
}

/* Related articles */
.related-section {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid rgba(0, 212, 255, 0.15);
}

.related-section h3 {
    color: #00d4ff;
    margin-bottom: 20px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.related-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 15px;
    background: rgba(15, 25, 45, 0.6);
    border: 1px solid rgba(0, 212, 255, 0.12);
    border-radius: 10px;
    color: #c8d6e5;
    transition: all 0.2s;
}

.related-card:hover {
    border-color: rgba(0, 212, 255, 0.3);
    color: #00d4ff;
}

.related-card img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 6px;
}

/* Category header */
.category-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(0, 212, 255, 0.15);
}

.category-header h1 {
    color: #00d4ff;
    margin-bottom: 8px;
}

.category-header p {
    color: #5a6a7e;
}

/* Footer */
.site-footer {
    background: rgba(10, 14, 26, 0.95);
    border-top: 1px solid rgba(0, 212, 255, 0.15);
    padding: 30px;
    text-align: center;
    color: #5a6a7e;
    font-size: 0.85em;
}

.footer-note {
    margin-top: 5px;
    font-size: 0.9em;
    opacity: 0.7;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-toggle { display: flex; }
    .nav-menu {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: rgba(10, 14, 26, 0.98);
        flex-direction: column;
        padding: 15px;
        gap: 2px;
        border-bottom: 1px solid rgba(0, 212, 255, 0.15);
    }
    .nav-menu.show { display: flex; }
    .nav-menu a { padding: 12px 16px; }
    .hero-title { font-size: 1.8em; }
    .article-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .card-cover { height: 100px; }
    .article-header h1 { font-size: 1.5em; }
    .container { padding: 25px 15px; }
    .sidebar-ad { display: none !important; }
}

/* Sidebar Floating Ad */
.sidebar-ad {
    position: fixed;
    left: 320px;
    top: 50%;
    transform: translateY(-50%);
    width: 200px;
    padding: 18px 16px;
    background: #111827;
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 10px;
    z-index: 900;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.sidebar-ad-title {
    font-size: 13px;
    font-weight: bold;
    color: #00d4ff;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-ad-text {
    color: #c8d6e5;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    margin-bottom: 10px;
}

.sidebar-ad-link {
    display: inline-block;
    padding: 6px 14px;
    background: rgba(0, 212, 255, 0.15);
    color: #00d4ff;
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 6px;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.2s;
}

.sidebar-ad-link:hover {
    background: rgba(0, 212, 255, 0.3);
    color: #74b9ff;
}

.sidebar-ad-close {
    position: absolute;
    top: 4px;
    right: 6px;
    background: none;
    border: none;
    color: #5a6a7e;
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 4px;
    transition: color 0.2s;
}

.sidebar-ad-close:hover {
    color: #ff6b6b;
}
