:root {
    --primary: #2d6a4f;
    --primary-dark: #1b4332;
    --primary-light: #40916c;
    --accent: #d4a373;
    --bg: #f8f9fa;
    --text: #212529;
    --muted: #6c757d;
    --border: #dee2e6;
    --white: #ffffff;
    --danger: #dc3545;
    --success: #198754;
    --warning: #ffc107;
}

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

body {
    font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

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

/* Header */
.top-bar {
    background: var(--primary-dark);
    color: #fff;
    font-size: 13px;
    padding: 6px 0;
}

.top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.main-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    padding: 20px 0;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 24px;
}

.journal-logo {
    width: 72px;
    height: 72px;
    background: rgba(255,255,255,0.2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: bold;
}

.journal-title h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}

.journal-title p {
    font-size: 14px;
    opacity: 0.9;
}

/* Navigation */
.main-nav {
    background: var(--white);
    border-bottom: 2px solid var(--primary);
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}

.nav-list {
    display: flex;
    list-style: none;
    flex-wrap: wrap;
}

.nav-list li a {
    display: block;
    padding: 14px 18px;
    color: var(--text);
    font-size: 15px;
    transition: all 0.2s;
}

.nav-list li a:hover,
.nav-list li a.active {
    background: var(--primary);
    color: #fff;
    text-decoration: none;
}

/* Portal buttons */
.portal-section {
    background: #e9f5ee;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

.portal-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.portal-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.portal-btn.author { background: var(--primary); color: #fff; }
.portal-btn.reviewer { background: #495057; color: #fff; }
.portal-btn.editor { background: var(--accent); color: #fff; }
.portal-btn.submit { background: var(--primary-dark); color: #fff; }

.portal-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    text-decoration: none;
    color: #fff;
}

/* Main layout */
.main-content {
    flex: 1;
    padding: 24px 0 40px;
}

.grid-2-1 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

/* Cards */
.card {
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    overflow: hidden;
    margin-bottom: 20px;
}

.card-header {
    background: var(--primary);
    color: #fff;
    padding: 12px 16px;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-body {
    padding: 16px;
}

/* Announcements */
.announcement-list {
    list-style: none;
}

.announcement-list li {
    padding: 10px 0;
    border-bottom: 1px dashed var(--border);
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

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

.badge-pin {
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 3px;
    flex-shrink: 0;
}

/* Article list */
.article-list {
    list-style: none;
}

.article-list li {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

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

.article-title {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.article-meta {
    font-size: 13px;
    color: var(--muted);
}

.article-links a {
    margin-right: 12px;
    font-size: 13px;
}

/* Sidebar info */
.info-table {
    width: 100%;
    font-size: 14px;
}

.info-table td {
    padding: 6px 0;
    vertical-align: top;
}

.info-table td:first-child {
    color: var(--muted);
    width: 90px;
    white-space: nowrap;
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(45,106,79,0.15);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

.form-error {
    color: var(--danger);
    font-size: 13px;
    margin-top: 4px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-secondary { background: #6c757d; color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }

.btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn + .btn {
    margin-left: 8px;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-success { background: #d1e7dd; color: #0f5132; border: 1px solid #badbcc; }
.alert-danger { background: #f8d7da; color: #842029; border: 1px solid #f5c2c7; }
.alert-warning { background: #fff3cd; color: #664d03; border: 1px solid #ffecb5; }
.alert-info { background: #cff4fc; color: #055160; border: 1px solid #b6effb; }

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table th,
.table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.table th {
    background: #f1f3f5;
    font-weight: 600;
}

.table tr:hover {
    background: #f8f9fa;
}

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.status-draft { background: #e9ecef; color: #495057; }
.status-submitted { background: #cff4fc; color: #055160; }
.status-under_review { background: #fff3cd; color: #664d03; }
.status-revision { background: #ffe5d0; color: #984c0c; }
.status-accepted { background: #d1e7dd; color: #0f5132; }
.status-rejected { background: #f8d7da; color: #842029; }

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--white);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.stat-number {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 13px;
    color: var(--muted);
    margin-top: 4px;
}

/* Footer */
.site-footer {
    background: var(--primary-dark);
    color: rgba(255,255,255,0.85);
    padding: 24px 0;
    font-size: 13px;
    margin-top: auto;
}

.site-footer a {
    color: rgba(255,255,255,0.9);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

/* Auth pages */
.auth-container {
    max-width: 480px;
    margin: 40px auto;
}

.auth-card {
    background: var(--white);
    border-radius: 8px;
    padding: 32px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.auth-card h2 {
    text-align: center;
    margin-bottom: 24px;
    color: var(--primary-dark);
}

.portal-login-card {
    position: relative;
    padding-top: 40px;
}

.portal-login-badge {
    position: absolute;
    top: -1px;
    left: 20px;
    background: var(--primary);
    color: #fff;
    padding: 8px 20px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 0 0 6px 6px;
}

/* Page content */
.page-content {
    background: var(--white);
    border-radius: 8px;
    padding: 32px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.page-content h2 {
    color: var(--primary-dark);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary);
}

.page-content h3 {
    margin: 20px 0 10px;
    color: var(--primary);
}

.page-content p {
    margin-bottom: 12px;
}

.page-content ul {
    margin: 12px 0 12px 24px;
}

/* Search box on homepage */
.search-box {
    background: rgba(255,255,255,0.15);
    border-radius: 8px;
    padding: 16px;
    margin-top: 16px;
}

.search-box input {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    .grid-2-1, .grid-2, .stats-grid {
        grid-template-columns: 1fr;
    }

    .header-content {
        flex-direction: column;
        text-align: center;
    }

    .nav-list {
        justify-content: center;
    }

    .portal-buttons {
        flex-direction: column;
        align-items: stretch;
    }
}
