/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f0f2f5;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a {
    color: #1890ff;
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: #40a9ff;
    text-decoration: none;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-fluid {
    max-width: 100%;
    margin: 0;
    padding: 0 12px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 20px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    background: #fff;
    color: #333;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.3s;
    gap: 6px;
}

.btn:hover {
    border-color: #1890ff;
    color: #1890ff;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #1890ff 0%, #096dd9 100%);
    color: #fff;
    border: none;
    box-shadow: 0 2px 8px rgba(24,144,255,0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #40a9ff 0%, #1890ff 100%);
    box-shadow: 0 4px 12px rgba(24,144,255,0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #ff4d4f 0%, #cf1322 100%);
    color: #fff;
    border: none;
    box-shadow: 0 2px 8px rgba(255,77,79,0.3);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #ff7875 0%, #ff4d4f 100%);
}

.btn-success {
    background: linear-gradient(135deg, #52c41a 0%, #389e0d 100%);
    color: #fff;
    border: none;
    box-shadow: 0 2px 8px rgba(82,196,26,0.3);
}

.btn-warning {
    background: linear-gradient(135deg, #faad14 0%, #d48806 100%);
    color: #fff;
    border: none;
}

.btn-small {
    padding: 4px 12px;
    font-size: 12px;
}

.btn-block {
    display: flex;
    width: 100%;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s;
    background: #fff;
}

.form-group input[type="color"] {
    width: 48px !important;
    padding: 2px !important;
    cursor: pointer;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #1890ff;
    box-shadow: 0 0 0 3px rgba(24,144,255,0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.content-type-row {
    display: flex;
    gap: 16px;
}

.form-group .content-type-option {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    cursor: pointer;
    padding: 10px 14px;
    border: 2px solid #d9d9d9;
    border-radius: 6px;
    font-size: 11px;
    flex: 0 0 auto;
    /* Override .form-group label */
    width: auto;
    margin-bottom: 0;
}

.form-group .content-type-option span {
    line-height: 1.5;
}

.form-group .content-type-option small,
.form-group .content-type-option span small {
    color: #8c8c8c;
    font-size: 11px !important;
    line-height: 1;
    margin-left: 4px;
}

.form-group .content-type-option input[type="radio"] {
    flex-shrink: 0;
    margin-top: 2px;
    width: auto;
}

.form-actions {
    margin-top: 0;
    display: flex;
    gap: 12px;
    padding: 4px 0 10px 10px;
    border: none;
}

.form-container {
    background: #fff;
    padding: 20px 20px 10px 20px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

/* Tables */
.table-container {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    overflow: hidden;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

.table th {
    background: #fafafa;
    font-weight: 600;
    color: #333;
}

.table tbody tr:hover {
    background: #f5f7fa;
}

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

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-draft {
    background: #f0f0f0;
    color: #8c8c8c;
}

.badge-published {
    background: #f6ffed;
    color: #52c41a;
    border: 1px solid #b7eb8f;
}

.badge-pending {
    background: #fff7e6;
    color: #fa8c16;
    border: 1px solid #ffd591;
}

.badge-approved {
    background: linear-gradient(135deg, #52c41a 0%, #389e0d 100%);
    color: #fff;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-rejected {
    background: #fff2f0;
    color: #ff4d4f;
    border: 1px solid #ffccc7;
}

.badge-inactive {
    background: #fff2f0;
    color: #ff4d4f;
    border: 1px solid #ffccc7;
}

.badge-top {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 24px;
    padding: 0 8px;
    background: #ff4d4f;
    color: #fff;
    border-radius: 2px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    flex-shrink: 0;
}

/* Alerts */
.alert {
    padding: 14px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-error {
    background: #fff2f0;
    color: #cf1322;
    border: 1px solid #ffccc7;
}

.alert-success {
    background: #f6ffed;
    color: #389e0d;
    border: 1px solid #b7eb8f;
}

/* ==================== Admin Layout ==================== */
.admin-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #001529 0%, #002140 100%);
    color: #fff;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.sidebar .logo {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar .logo h2 {
    font-size: 18px;
    color: #fff;
    font-weight: 600;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    padding: 12px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 14px 24px;
    color: rgba(255,255,255,0.65);
    transition: all 0.3s;
    font-size: 14px;
    gap: 10px;
    margin: 4px 12px;
    border-radius: 8px;
}

.nav-item:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
    text-decoration: none;
}

.nav-item.active {
    background: #1890ff;
    color: #fff;
}

.user-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.2);
}

.user-info p {
    font-size: 13px;
    color: rgba(255,255,255,0.85);
}

.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 14px 18px;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 4px;
    border-bottom: 1px solid #f0f0f0;
}

.page-header h1 {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}

.stat-card {
    background: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.stat-label {
    color: #8c8c8c;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}

.stat-number {
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, #1890ff 0%, #722ed1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-sub {
    font-size: 10px;
    color: #ff4d4f;
    margin-left: 6px;
    white-space: nowrap;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.dashboard-section {
    background: #fff;
    padding: 10px 12px;
    border-radius: 6px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.06);
}

.dashboard-section h2 {
    font-size: 13px;
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
    font-weight: 600;
}

.dashboard-section .table th,
.dashboard-section .table td {
    padding: 5px 8px;
    font-size: 12px;
}

/* Filter Bar */
.filter-bar {
    margin-bottom: 20px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
    padding: 16px;
    background: #fff;
    border-radius: 8px;
}

.pagination a,
.pagination span {
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 14px;
}

.pagination a:hover {
    background: #f0f0f0;
}

/* Login Page */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-box {
    background: #fff;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.login-box h1 {
    text-align: center;
    color: #333;
    margin-bottom: 8px;
    font-size: 28px;
}

.login-box h2 {
    text-align: center;
    color: #8c8c8c;
    font-size: 14px;
    margin-bottom: 32px;
    font-weight: 400;
}

/* ==================== Front Header ==================== */
.header {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    position: sticky;
    top: 0;
    z-index: 100;
    flex-shrink: 0;
}

.header .container {
    display: flex;
    align-items: center;
    height: 64px;
}

.logo {
    font-size: 20px;
    font-weight: 700;
    color: #1890ff;
    display: inline-flex;
    align-items: center;
    margin-right: 10px;
    white-space: nowrap;
}

.logo span::before {
    content: "\2302";
    display: inline-block;
    margin-right: 5px;
    color: #333;
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
    vertical-align: -1px;
}

.nav {
    display: flex;
    align-items: center;
    gap: 0;
    flex: 1;
    height: 100%;
}

.nav-link {
    color: #333;
    font-weight: 500;
    white-space: nowrap;
    padding: 6px 4px;
    border-radius: 6px;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.nav-link:hover {
    color: #1890ff;
    background: #e6f7ff;
}

.nav-link.active {
    color: #1890ff;
    background: transparent;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.header-right:has(.user-menu-wrap) {
    gap: 4px;
}

.auth-group {
    display: flex;
    align-items: center;
    gap: 2px;
}

.auth-group .nav-link {
    padding: 6px 7px;
}

.auth-group .nav-divider {
    color: #d9d9d9;
}

.header-right .nav-link {
    color: #666;
}

.header-right .nav-link:hover {
    color: #1890ff;
}

.nav-divider {
    color: #d9d9d9;
    margin: 0;
    padding: 0;
}

/* User Menu */
.user-menu-wrap {
    position: relative;
    display: inline-block;
}

.user-menu-trigger {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 6px 4px;
    border-radius: 8px;
    transition: background 0.3s;
}

.user-menu-trigger:hover {
    background: #f5f5f5;
}

.user-avatar {
    font-size: 20px;
    margin-right: 8px;
}

.user-name {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.user-arrow {
    font-size: 10px;
    margin-left: 6px;
    color: #8c8c8c;
}

.user-menu-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    box-shadow: 0 6px 24px rgba(0,0,0,0.12);
    border-radius: 8px;
    z-index: 1000;
    padding: 4px 0;
    margin-top: 8px;
}

.user-menu-dropdown::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 0;
    right: 0;
    height: 8px;
}

.user-menu-item {
    display: block;
    padding: 8px 16px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    line-height: 1.5;
    white-space: nowrap;
    transition: background 0.3s;
}

.user-menu-item:hover {
    background: #f5f5f5;
    color: #1890ff;
}

.logout-btn {
    color: #333;
    font-size: 14px;
    padding: 6px 4px;
    border-radius: 6px;
    transition: all 0.3s;
}

.logout-btn:hover {
    color: #ff4d4f;
    background: #fff2f0;
}

button.logout-btn,
button.mobile-nav-link,
button.sidebar-menu-item,
button.nav-item {
    font: inherit;
    cursor: pointer;
}

button.logout-btn,
button.mobile-nav-link,
button.sidebar-menu-item {
    border: 0;
    background: transparent;
}

button.mobile-nav-link,
button.sidebar-menu-item {
    width: 100%;
    text-align: left;
}

button.nav-item {
    width: 100%;
}

/* Search Box */
.search-box {
    display: flex;
    align-items: center;
    background: transparent;
    border-radius: 20px;
    padding: 0 12px;
    margin-right: 16px;
    border: 1px solid #d9d9d9;
    transition: all 0.3s;
}

.search-box:focus-within {
    background: transparent;
    border-color: #1890ff;
    box-shadow: 0 0 0 3px rgba(24,144,255,0.1);
}

.search-input {
    border: none;
    background: transparent;
    padding: 8px 10px;
    font-size: 14px;
    outline: none;
    width: 180px;
}

.search-input::placeholder {
    color: #bfbfbf;
}

.search-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: #8c8c8c;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-btn:hover {
    color: #1890ff;
}

.search-icon {
    width: 18px;
    height: 18px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.search-clear {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: #bfbfbf;
    padding: 5px;
    transition: color 0.3s;
}

.search-clear:hover {
    color: #333;
}

/* Dropdown Menu */
.nav-dropdown {
    position: relative;
    margin: 0;
    padding: 0;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    box-shadow: 0 6px 24px rgba(0,0,0,0.12);
    border-radius: 8px;
    z-index: 1000;
    padding: 4px 0;
    margin-top: 8px;
}

.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 0;
    right: 0;
    height: 8px;
}

.dropdown-item {
    display: block;
    padding: 8px 16px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
    white-space: nowrap;
    transition: all 0.3s;
}

.dropdown-item:hover {
    background: #f5f5f5;
    color: #1890ff;
}

/* ==================== Front Main ==================== */
.main {
    min-height: calc(100vh - 128px);
    padding: 10px 0;
}

/* Article List */
.article-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    width: 100%;
    max-width: 985px;
    margin: 0 auto;
}

.front-pagination {
    width: 100%;
    max-width: 985px;
    margin: 10px auto 0;
    padding: 10px 0 24px;
    background: #f6f6f6;
}

.front-pagination-desktop {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.front-pagination-mobile {
    display: none;
}

.front-page-number,
.front-page-prev,
.front-page-next {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 38px;
    padding: 0 12px;
    border-radius: 5px;
    background: #ececec;
    color: #777;
    font-size: 14px;
    text-decoration: none;
}

.front-page-number:hover,
.front-page-prev:hover,
.front-page-next:hover {
    color: #1890ff;
    text-decoration: none;
}

.front-page-number.is-active {
    background: #0d86ff;
    color: #fff;
}

.front-page-number.is-gap {
    min-width: 34px;
    background: transparent;
    cursor: default;
}

.front-page-prev,
.front-page-next {
    min-width: 74px;
    background: #0d86ff;
    color: #fff;
}

.front-page-prev {
    margin-right: 14px;
}

.front-page-next {
    margin-left: 14px;
}

.front-page-prev:hover,
.front-page-next:hover {
    background: #0877e5;
    color: #fff;
}

.front-page-prev.is-disabled,
.front-page-next.is-disabled {
    background: #ececec;
    color: #aaa;
    cursor: default;
    pointer-events: none;
}

.front-page-total {
    margin-left: 14px;
    color: #999;
    font-size: 14px;
}

.front-page-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: calc(100% - 96px);
    min-height: 46px;
    margin: 0 auto;
    border-radius: 10px;
    background: #e9e9e9;
    color: #777;
    font-size: 18px;
    text-decoration: none;
}

.front-page-btn:hover {
    color: #1890ff;
    text-decoration: none;
}

.front-page-btn.is-primary {
    background: #0d86ff;
    color: #fff;
}

.front-page-btn.is-primary:hover {
    color: #fff;
    background: #0877e5;
}

.front-page-btn.is-disabled {
    color: #777;
    cursor: default;
    pointer-events: none;
}

.category-title {
    width: 100%;
    box-sizing: border-box;
    max-width: 985px;
    margin: 0 auto;
    padding: 10px 16px 12px;
    background: #fff;
    border-bottom: 1px solid #e8e8e8;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.category-title h2 {
    margin: 0;
    font-size: 20px;
    line-height: 1.2;
    color: #1a1a1a;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.category-title-icon {
    display: inline-flex;
    align-items: center;
}

/* New Article Card - Horizontal Layout */
.article-card-new {
    background: #fff;
    border-radius: 0;
    box-shadow: none;
    border-bottom: 1px solid #f0f0f0;
    overflow: visible;
    display: flex;
    flex-direction: row;
    transition: none;
    width: 100%;
    min-height: 160px;
}

.article-card-new:hover {
    box-shadow: none;
    transform: none;
}

.article-thumb {
    width: 181px;
    height: 124px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    background: transparent;
    display: flex;
    align-items: center;
    align-self: center;
}

.thumb-inner {
    margin-left: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: calc(100% - 20px);
    height: 100%;
}

.article-thumb img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s;
}

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

.article-thumb .thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 56px;
    color: #fff;
    width: 100%;
    height: 100%;
}



.article-content {
    flex: 1;
    padding: 6px 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.article-like {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 20px;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 60px;
}

.article-like:hover {
    background: #f0f5ff;
}

.like-icon {
    font-size: 24px;
    transition: transform 0.3s;
}

.like-count {
    font-size: 14px;
    color: #666;
    margin-top: 4px;
    font-weight: 500;
}

.article-card-new .like-meta.is-zero,
.article-detail-like-count.is-zero {
    display: none;
}

 

.article-like.is-zero .like-count {
    display: none;
}

.article-like:hover .like-icon {
    transform: scale(1.2);
}

.article-title {
    margin: 0;
    font-size: 18px;
    line-height: 1.5;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.article-title a {
    color: #1a1a1a;
    text-decoration: none;
    transition: color 0.3s;
}

.article-title a:hover {
    color: #1890ff;
}

.article-summary {
    color: #666;
    font-size: 14px;
    line-height: 20px;
    margin: 4px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 0 0 40px;
    height: 40px;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 2px;
    font-size: 13px;
    color: #8c8c8c;
}

.meta-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.meta-icon {
    font-size: 14px;
}

.meta-link {
    color: inherit;
    text-decoration: none;
}

.meta-link:hover {
    color: #1890ff;
}

.page-like-meta {
    margin-left: auto;
    border: 0;
    background: transparent;
    padding: 0;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.page-like-meta:hover,
.page-like-meta.is-liked {
    color: #1890ff;
}

/* Legacy Article Card - keep for compatibility */
.article-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.3s;
}

.article-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.article-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.article-info {
    padding: 20px;
}

.article-info h3 {
    margin-bottom: 12px;
    font-size: 18px;
}

.article-info h3 a {
    color: #1a1a1a;
}

.article-info h3 a:hover {
    color: #1890ff;
}

.article-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #8c8c8c;
}

.article-meta .category-icon {
    display: inline-flex;
    align-items: center;
    margin-right: 6px;
}

.article-meta .category {
    background: #e6f7ff;
    color: #1890ff;
    padding: 3px 10px;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s;
}

.article-meta .category:hover {
    background: #1890ff;
    color: #fff;
}

.article-meta .rating {
    color: #faad14;
}

/* Front Sidebar */
.front-sidebar {
    position: sticky;
    top: 84px;
    align-self: flex-start;
}

/* Sidebar Widget */
.widget {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.widget h3 {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 16px;
}

.category-list {
    list-style: none;
}

.category-list li {
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
}

.category-list li:last-child {
    border-bottom: none;
}

/* Article Detail */
.article-breadcrumb {
    max-width: 1000px;
    margin: 0 auto 8px;
    padding: 0 2px;
    color: #8c8c8c;
    font-size: 12px;
    line-height: 22px;
}

.article-breadcrumb a {
    color: #1890ff;
}

.breadcrumb-separator {
    margin: 0 6px;
    color: #bfbfbf;
}

.article-detail {
    max-width: 1000px;
    margin: 0 auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    overflow: hidden;
}

.article-header {
    margin-bottom: 0;
    padding: 0 24px;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
}

.article-header h1 {
    margin: 0;
    padding: 14px 0 8px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 26px;
    line-height: 1.35;
    color: #1a1a1a;
}

.article-header .article-meta {
    justify-content: center;
    gap: 16px;
    margin-top: 0;
    padding: 8px 0;
    color: #666;
    font-size: 13px;
}

.article-meta-like {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    border: 0;
    background: transparent;
    padding: 0;
    line-height: 1;
    font: inherit;
    color: inherit;
    cursor: pointer;
}

.article-meta-like .meta-icon {
    margin-right: 1px;
}

.article-meta-like-count {
    display: inline;
}

.article-meta-like:hover,
.article-meta-like.is-liked {
    color: #1890ff;
}

.article-cover {
    width: 100%;
    border-radius: 12px;
    margin-bottom: 30px;
}

.article-content {
    background: #fff;
    padding: 32px;
    border-radius: 0;
    box-shadow: none;
    margin-bottom: 24px;
    line-height: 1.9;
}

.article-detail .article-content,
.page-content {
    background: #fff;
    padding: 11px 32px 32px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    margin-bottom: 24px;
    line-height: 1.9;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.article-detail .article-content {
    border-radius: 0;
    box-shadow: none;
}

.article-detail .article-content > :first-child,
.page-content > :first-child {
    margin-top: 0 !important;
}

.article-detail .article-content a,
.page-content a {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.article-actions {
    margin: 30px 0;
    text-align: center;
}

.article-action-count,
.article-action-comment {
    margin-left: 8px;
    color: #333;
    font-size: 16px;
    font-weight: 400;
}

.article-action-comment {
    margin-left: 16px;
}

.article-content figure.image,
.page-content figure.image {
    display: table;
    margin: 16px auto;
    text-align: center;
}

.article-content figure.image img,
.page-content figure.image img {
    display: block;
    max-width: 100%;
    height: auto;
}

.article-content figure.image-style-align-left,
.page-content figure.image-style-align-left {
    margin-left: 0;
    margin-right: auto;
}

.article-content figure.image-style-align-right,
.page-content figure.image-style-align-right {
    margin-left: auto;
    margin-right: 0;
}

.article-content figure.image-style-align-center,
.page-content figure.image-style-align-center {
    margin-left: auto;
    margin-right: auto;
}

/* Override for new article card style */
.article-card-new .article-content {
    background: #fff;
    border-radius: 0;
    box-shadow: none;
    padding: 20px 24px;
    margin-bottom: 0;
}

/* Software Info */
.software-info {
    background: #fff;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    margin-bottom: 24px;
}

.software-info h3 {
    margin-bottom: 16px;
    font-size: 16px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.info-item label {
    font-weight: 500;
    margin-right: 10px;
    color: #8c8c8c;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    font-size: 16px;
    border-radius: 8px;
}

/* Rating Section */
.rating-section {
    background: #fff;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    margin-bottom: 24px;
}

.rating-display {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.average-rating {
    font-size: 28px;
    font-weight: 700;
    color: #faad14;
}

.rating-count {
    color: #8c8c8c;
}

.stars {
    display: flex;
    gap: 6px;
}

.star {
    font-size: 28px;
    color: #d9d9d9;
    cursor: pointer;
    transition: color 0.2s;
}

.star:hover,
.star.active {
    color: #faad14;
}

/* Comments Section */
.comments-section {
    background: #fff;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.comments-section h3 {
    margin-bottom: 20px;
    font-size: 16px;
    padding-left: 10px;
    border-left: 4px solid #1890ff;
}

.comment-form {
    margin-bottom: 24px;
}

.comment-form-main {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.comment-avatar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    width: 40px;
}

.comment-form-username {
    max-width: 64px;
    color: #666;
    font-size: 12px;
    line-height: 1.2;
    text-align: center;
    word-break: break-all;
}

.avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 40px;
    height: 40px;
    background: #f7f8fa;
    border: 1px solid #e5e7eb;
    border-radius: 50%;
    font-size: 0;
    color: transparent;
}

.avatar-placeholder::before {
    content: "";
    position: absolute;
    top: 9px;
    left: 50%;
    width: 11px;
    height: 11px;
    border: 2px solid #b8bec8;
    border-radius: 50%;
    transform: translateX(-50%);
    box-sizing: border-box;
}

.avatar-placeholder::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 8px;
    width: 19px;
    height: 10px;
    border: 2px solid #b8bec8;
    border-bottom: 0;
    border-radius: 12px 12px 0 0;
    transform: translateX(-50%);
    box-sizing: border-box;
}

.avatar-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.comment-input-wrap {
    flex: 1;
    position: relative;
}

.comment-input-wrap textarea {
    width: 100%;
    padding: 12px 116px 52px 12px;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    resize: vertical;
    font-size: 14px;
    transition: border-color 0.3s;
    min-height: 80px;
    box-sizing: border-box;
}

.comment-input-wrap textarea:focus {
    outline: none;
    border-color: #1890ff;
}

.comment-submit-btn {
    position: absolute;
    right: 12px;
    bottom: 12px;
}

.comment-form-info {
    display: flex;
    gap: 12px;
    margin-left: 52px;
}

.comment-info-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    font-size: 13px;
    transition: border-color 0.3s;
}

.comment-info-input:focus {
    outline: none;
    border-color: #1890ff;
}

.comments-list {
    margin-top: 24px;
}

.comment-thread {
    border-bottom: 1px solid #f5f5f5;
}

.comment-thread:last-child {
    border-bottom: none;
}

.comment {
    display: flex;
    gap: 12px;
    padding: 16px 0;
    position: relative;
}

.comment-replies {
    margin-left: 52px;
    padding-left: 14px;
    border-left: 2px solid #f0f0f0;
}

.comment-reply {
    padding: 12px 0;
}

.comment-reply .avatar-placeholder,
.comment-reply .avatar-img {
    width: 32px;
    height: 32px;
}

.comment-reply .avatar-placeholder::before {
    top: 7px;
    width: 9px;
    height: 9px;
}

.comment-reply .avatar-placeholder::after {
    bottom: 6px;
    width: 15px;
    height: 8px;
}

.comment-body {
    flex: 1;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.comment-author {
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.comment-date {
    color: #bfbfbf;
    font-size: 12px;
}

.comment-content {
    font-size: 14px;
    line-height: 1.6;
    color: #333;
}

.comment-actions {
    margin-top: 8px;
}

.comment-reply-btn {
    border: 0;
    background: none;
    padding: 0;
    color: #8c8c8c;
    cursor: pointer;
    font-size: 12px;
    font-family: inherit;
    text-decoration: none;
    transition: color 0.3s;
}

.comment-reply-btn:hover {
    color: #1890ff;
}

.comment-floor {
    position: absolute;
    right: 0;
    top: 16px;
    color: #bfbfbf;
    font-size: 12px;
}

.reply-form {
    margin-top: 12px;
    padding: 12px;
    background: #fafafa;
    border-radius: 8px;
}

.reply-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    font-size: 13px;
    resize: vertical;
    margin-bottom: 8px;
    box-sizing: border-box;
}

.reply-form textarea:focus {
    outline: none;
    border-color: #1890ff;
}

.reply-form-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.reply-form-actions .comment-info-input {
    width: 120px;
    flex: none;
}

/* Auth Pages */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 128px);
}

.auth-box {
    width: 100%;
    max-width: 420px;
    background: #fff;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.auth-box h1 {
    text-align: center;
    margin-bottom: 32px;
    font-size: 24px;
    color: #1a1a1a;
}

.auth-link {
    text-align: center;
    margin-top: 24px;
    color: #8c8c8c;
}

/* Footer */
.footer {
    background: #f0f2f5;
    color: #8c8c8c;
    padding: 14px 0 24px;
    text-align: center;
    font-size: 13px;
    flex-shrink: 0;
}

.footer-inner {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.footer-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 4px 20px;
    line-height: 1.7;
    box-sizing: border-box;
}

.footer-link {
    color: inherit;
    text-decoration: none;
    padding: 0 4px;
    border-radius: 4px;
}

a.footer-link:hover {
    color: #1890ff;
}

/* ==================== Search Results Page ==================== */
.search-results-page .main {
    flex: 1;
    padding: 20px 0;
}

.search-results-page .home-page {
    background: transparent;
}

/* Responsive */
@media (max-width: 768px) {
    .admin-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }

    .main-content {
        margin-left: 0;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .article-card-new {
        flex-direction: column;
    }

    .article-thumb {
        width: 100%;
        height: 180px;
    }

    .header .container {
        flex-wrap: wrap;
        height: auto;
        padding: 12px 20px;
    }

    .nav {
        display: none;
    }

    .search-box {
        order: 3;
        width: 100%;
        margin: 8px 0 0 0;
    }

    .search-input {
        width: 100%;
    }
}

/* ==================== Mobile Menu ==================== */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
    color: #333;
    line-height: 1;
    margin-left: auto;
    margin-right: 4px;
}

.mobile-nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 998;
}

.mobile-nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    max-width: 80vw;
    height: 100vh;
    height: 100dvh;
    background: #fff;
    z-index: 999;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.mobile-nav.active {
    transform: translateX(0);
}

.mobile-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    background: #fafafa;
    position: sticky;
    top: 0;
    z-index: 1;
}

.mobile-nav-header span {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.mobile-nav-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #666;
    padding: 4px;
    line-height: 1;
}

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

.mobile-nav-item {
    border-bottom: 1px solid #f5f5f5;
}

.mobile-nav-link {
    display: block;
    padding: 14px 20px;
    color: #333;
    text-decoration: none;
    font-size: 15px;
    transition: background 0.2s;
}

.mobile-nav-link:hover {
    background: #e6f7ff;
    color: #1890ff;
}

.mobile-submenu-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    background: none;
    border: none;
    padding: 14px 20px;
    font-size: 15px;
    color: #333;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s;
    font-family: inherit;
}

.mobile-submenu-toggle:hover {
    background: #e6f7ff;
}

.submenu-arrow {
    font-size: 12px;
    transition: transform 0.3s;
    color: #8c8c8c;
}

.mobile-submenu-toggle.active .submenu-arrow {
    transform: rotate(180deg);
}

.mobile-submenu {
    display: none;
    background: #fafafa;
}

.mobile-submenu.active {
    display: block;
}

.mobile-submenu a {
    display: block;
    padding: 11px 20px 11px 36px;
    color: #666;
    text-decoration: none;
    font-size: 14px;
    border-top: 1px solid #f0f0f0;
}

.mobile-submenu a:hover {
    color: #1890ff;
    background: #e6f7ff;
}

.mobile-nav-divider {
    height: 1px;
    background: #f0f0f0;
    margin: 8px 0;
}

.mobile-user-section,
.mobile-auth-section {
    background: #fafafa;
}

.mobile-user-greeting {
    padding: 12px 20px;
    font-size: 14px;
    color: #8c8c8c;
    border-bottom: 1px solid #f0f0f0;
}

.mobile-logout {
    color: #ff4d4f !important;
}

/* ==================== Responsive: Front-end ==================== */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }

    .header .container {
        flex-wrap: wrap;
        height: auto;
        padding: 8px 16px;
        gap: 4px;
    }

    .logo {
        font-size: 15px;
        margin-right: 2px;
        max-width: 140px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .logo img {
        max-height: 18px;
    }

    .logo span {
        font-size: 13px;
        max-width: 100px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        display: inline-block;
        vertical-align: middle;
    }

    .nav {
        display: none;
    }

    .header-right {
        width: 100%;
        margin-left: 0;
        gap: 6px;
        flex-wrap: wrap;
    }

    .search-box {
        order: 3;
        width: 100%;
        margin: 0;
    }

    .search-input {
        width: 100%;
    }

    .article-list {
        width: 100%;
        max-width: 985px;
        margin: 0 auto;
        padding: 0;
    }

    .front-pagination {
        margin-top: 0;
        padding: 26px 0 34px;
    }

    .front-pagination-desktop {
        display: none;
    }

    .front-pagination-mobile {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .front-page-btn {
        width: calc(100% - 48px);
        min-height: 50px;
        border-radius: 10px;
        font-size: 18px;
    }

    .category-title {
        width: 100%;
        max-width: 985px;
        margin: 0 auto;
        padding: 10px 12px;
    }

    .category-title h2 {
        font-size: 18px;
    }

    .article-card-new {
        width: 100%;
        flex-direction: column;
        min-height: auto;
    }

    .article-thumb {
        width: 100%;
        height: 180px;
    }

    .article-content {
        padding: 12px 16px;
    }

    .article-like {
        flex-direction: row;
        padding: 10px 16px;
        gap: 4px;
        min-width: auto;
        border-top: 1px solid #f0f0f0;
    }

    .article-title {
        font-size: 16px;
    }

    .article-summary {
        font-size: 13px;
        flex: none;
        height: auto;
        margin: 4px 0 8px;
    }

    .article-meta {
        gap: 8px;
        font-size: 12px;
        flex-wrap: wrap;
    }

    

    .main {
        padding: 0;
    }

    .footer {
        padding: 10px 0 20px;
    }

    .user-center {
        flex-direction: column;
        gap: 16px;
    }

    .user-sidebar {
        width: 100%;
    }

    .user-sidebar-menu {
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .sidebar-menu-item {
        flex-shrink: 0;
        border-bottom: none;
        border-right: 1px solid #eee;
        white-space: nowrap;
    }

    .sidebar-menu-item:last-child {
        border-right: none;
    }

    .auth-box {
        padding: 24px 20px;
    }

    .login-box {
        padding: 30px 20px;
    }

    .article-cover {
        max-height: 250px;
        object-fit: cover;
    }

    .article-detail .article-content {
        padding: 7px 20px 20px;
    }

    .comments-section {
        padding: 16px;
        scroll-margin-bottom: 46vh;
    }

    .comments-section h3 {
        margin-bottom: 10px;
    }

    .comments-section:focus-within {
        padding-bottom: 42vh;
    }

    .comment-form {
        margin-bottom: 18px;
    }

    .comment-form-main {
        display: block;
        margin-bottom: 8px;
    }

    .comment-form > form > .comment-form-main > .comment-avatar {
        width: 100%;
        margin-bottom: 5px;
    }

    .comment-form > form > .comment-form-main > .comment-avatar .avatar-placeholder,
    .comment-form > form > .comment-form-main > .comment-avatar .avatar-img {
        width: 34px;
        height: 34px;
    }

    .avatar-placeholder::before {
        top: 7px;
        width: 9px;
        height: 9px;
    }

    .avatar-placeholder::after {
        bottom: 6px;
        width: 16px;
        height: 8px;
    }

    .comment-input-wrap {
        width: 100%;
    }

    .comment-input-wrap textarea {
        display: block;
        min-height: 136px;
        padding: 12px 14px 54px;
        border-color: #e0e0e0;
        border-radius: 6px;
        resize: none;
        font-size: 15px;
        line-height: 1.35;
    }

    .comment-submit-btn {
        right: 10px;
        bottom: 10px;
        width: 96px;
        height: 36px;
        padding: 0;
        border-radius: 6px;
        box-shadow: none;
        font-size: 14px;
    }

    .comment-input-wrap textarea,
    .comment-info-input,
    .reply-form textarea {
        scroll-margin-bottom: 46vh;
    }

    .comment-form-info {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        margin-left: 0;
        margin-top: 8px;
        gap: 8px;
    }

    .comment-form-info .comment-info-input {
        width: 100%;
        min-width: 0;
        height: 44px;
        box-sizing: border-box;
        padding: 0 14px;
        border-color: #e0e0e0;
        border-radius: 6px;
        font-size: 15px;
    }

    .comment-form-info .comment-info-input[type="url"] {
        grid-column: 1 / -1;
    }

    .comment-replies {
        margin-left: 20px;
        padding-left: 10px;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .rating-display {
        flex-wrap: wrap;
        gap: 8px;
    }

    .forgot-wrapper {
        padding: 0 12px;
    }

    .forgot-card {
        padding: 24px 16px;
    }

    .step-bar {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .header .container {
        padding: 8px 12px;
    }

    .logo {
        font-size: 16px;
    }

    .article-thumb {
        height: 160px;
    }

    .article-title {
        font-size: 15px;
    }

    .article-meta {
        font-size: 11px;
        gap: 6px;
    }

    .auth-box {
        padding: 20px 16px;
    }

    .login-box {
        padding: 24px 16px;
    }

    .forgot-card {
        padding: 20px 12px;
    }

    .article-detail .article-content {
        padding: 5px 16px 16px;
    }

    .comment-avatar {
        width: 30px;
    }

    .comment-form > form > .comment-form-main > .comment-avatar {
        width: 100%;
    }

    .avatar-placeholder,
    .avatar-img {
        width: 30px;
        height: 30px;
    }

    .comment-form > form > .comment-form-main > .comment-avatar .avatar-placeholder,
    .comment-form > form > .comment-form-main > .comment-avatar .avatar-img {
        width: 34px;
        height: 34px;
    }

    .avatar-placeholder::before {
        top: 6px;
        width: 8px;
        height: 8px;
    }

    .avatar-placeholder::after {
        bottom: 5px;
        width: 14px;
        height: 7px;
    }

    .comment-form-username {
        font-size: 11px;
        max-width: 48px;
    }

    .btn {
        padding: 6px 14px;
        font-size: 13px;
    }
}
