:root {
  --navy: #0d2137;
  --navy-light: #1a3a5c;
  --blue: #2c6faa;
  --blue-light: #e8f0f8;
  --gold: #b89434;
  --gold-light: #f5e6c8;
  --white: #ffffff;
  --gray-50: #f8f9fa;
  --gray-100: #f0f1f3;
  --gray-200: #e2e4e7;
  --gray-300: #cdd0d4;
  --gray-600: #6b7280;
  --gray-800: #333333;
  --text: #2d3748;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 25px rgba(0,0,0,.1);
  --transition: 0.2s ease;
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text); line-height: 1.7; background: var(--white);
}

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--navy); }

/* ── Navigation ── */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 100; background: rgba(13,33,55,.95); backdrop-filter: blur(10px); padding: 0 2rem; height: 64px; display: flex; align-items: center; justify-content: space-between; }
.nav-logo { font-size: 1.1rem; font-weight: 700; color: var(--white); text-decoration: none; letter-spacing: .5px; }
.nav-logo:hover { color: var(--gold); }
.nav-links { display: flex; align-items: center; gap: 1rem; list-style: none; }
.nav-links a { color: rgba(255,255,255,.85); text-decoration: none; font-size: .9rem; padding: .4rem .75rem; border-radius: 4px; transition: all .2s; }
.nav-links a:hover { color: var(--white); background: rgba(255,255,255,.1); }
.nav-links a.btn-nav { background: var(--gold); color: var(--navy); font-weight: 600; padding: .5rem 1.2rem; border-radius: var(--radius); }
.nav-links a.btn-nav:hover { background: #cfaa3e; }
.lang-toggle { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); color: var(--white); padding: .35rem .75rem; border-radius: var(--radius); cursor: pointer; font-size: .85rem; font-family: inherit; transition: all .2s; }
.lang-toggle:hover { background: rgba(255,255,255,.2); }
.menu-toggle { display: none; background: none; border: none; color: var(--white); font-size: 1.5rem; cursor: pointer; }
.nav-user { display: flex; align-items: center; gap: .5rem; }
.nav-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--blue); color: var(--white); display: flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 600; }

/* ── Footer ── */
.footer { background: var(--navy); color: rgba(255,255,255,.7); text-align: center; padding: 2rem; font-size: .85rem; }
.footer a { color: var(--gold); text-decoration: none; }
.footer a:hover { text-decoration: underline; }

/* ── Buttons ── */
.btn { display: inline-block; padding: .65rem 1.5rem; border-radius: var(--radius); text-decoration: none; font-weight: 600; font-size: .9rem; transition: all var(--transition); cursor: pointer; border: none; font-family: inherit; }
.btn-primary { background: var(--gold); color: var(--navy); }
.btn-primary:hover { background: #cfaa3e; transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.btn-outline { background: transparent; color: var(--white); border: 2px solid rgba(255,255,255,.4); }
.btn-outline:hover { border-color: var(--white); background: rgba(255,255,255,.08); }
.btn-sm { padding: .35rem .85rem; font-size: .8rem; }
.btn-danger { background: #c0392b; color: var(--white); }
.btn-danger:hover { background: #a93226; }
.btn-ghost { background: transparent; color: var(--gray-600); border: 1px solid var(--gray-300); }
.btn-ghost:hover { background: var(--gray-50); }

/* ── Forms ── */
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-size: .85rem; font-weight: 600; color: var(--navy); margin-bottom: .35rem; }
.form-input { width: 100%; padding: .65rem .85rem; border: 1px solid var(--gray-300); border-radius: var(--radius); font-size: .9rem; font-family: inherit; transition: border-color var(--transition); background: var(--white); color: var(--text); }
.form-input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(44,111,170,.12); }
textarea.form-input { min-height: 400px; font-family: "SF Mono", "Fira Code", "Consolas", monospace; font-size: .85rem; line-height: 1.6; resize: vertical; }
.form-select { width: 100%; padding: .65rem .85rem; border: 1px solid var(--gray-300); border-radius: var(--radius); font-size: .9rem; font-family: inherit; background: var(--white); color: var(--text); }

/* ── Messages ── */
.messages { max-width: 800px; margin: 0 auto; padding: 1rem 2rem; }
.msg { padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: .5rem; font-size: .9rem; }
.msg-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.msg-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.msg-info { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }

/* ── Hero ── */
.hero { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 50%, #1a4d73 100%); text-align: center; padding: 6rem 2rem 4rem; position: relative; overflow: hidden; }
.hero::before { content: ""; position: absolute; top: -50%; right: -50%; width: 100%; height: 100%; background: radial-gradient(circle, rgba(255,255,255,.03) 0%, transparent 70%); transform: rotate(-20deg); }
.hero-content { position: relative; z-index: 1; max-width: 800px; }
.hero h1 { font-size: 2.8rem; font-weight: 800; color: var(--white); margin-bottom: .75rem; letter-spacing: 1px; }
.hero .subtitle { font-size: 1.15rem; color: rgba(255,255,255,.75); margin-bottom: .5rem; font-weight: 400; }
.hero .university { font-size: .95rem; color: var(--gold); margin-bottom: 2rem; font-weight: 500; letter-spacing: 1px; }
.hero-buttons { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ── Sections ── */
.section { padding: 5rem 2rem; }
.section-alt { background: var(--gray-50); }
.section-header { text-align: center; margin-bottom: 3rem; }
.section-header h2 { font-size: 2rem; font-weight: 700; color: var(--navy); margin-bottom: .5rem; }
.section-header .en-title { font-size: .85rem; color: var(--gold); font-weight: 500; text-transform: uppercase; letter-spacing: 2px; }
.section-header .divider { width: 50px; height: 3px; background: var(--gold); margin: 1rem auto 0; border-radius: 2px; }
.container { max-width: 1100px; margin: 0 auto; }

/* ── About ── */
.about-content { max-width: 800px; margin: 0 auto; text-align: center; font-size: 1.05rem; line-height: 1.9; color: var(--gray-600); }
.about-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.5rem; margin-top: 3rem; }
.about-card { background: var(--white); padding: 2rem 1.5rem; border-radius: var(--radius); box-shadow: var(--shadow); text-align: center; transition: transform .2s, box-shadow .2s; }
.about-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.about-card .icon { font-size: 2.2rem; margin-bottom: .75rem; }
.about-card h3 { font-size: 1.05rem; color: var(--navy); margin-bottom: .4rem; }
.about-card p { font-size: .9rem; color: var(--gray-600); }

/* ── Research ── */
.research-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; }
.research-card { background: var(--white); padding: 2rem; border-radius: var(--radius); box-shadow: var(--shadow); border-left: 4px solid var(--blue); transition: transform .2s, box-shadow .2s; }
.research-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.research-card h3 { font-size: 1.1rem; color: var(--navy); margin-bottom: .5rem; }
.research-card p { font-size: .9rem; color: var(--gray-600); line-height: 1.7; }

/* ── Team ── */
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 2rem; }
.team-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 2rem 1.5rem; text-align: center; transition: transform .2s, box-shadow .2s; }
.team-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.team-card.faculty { border-top: 3px solid var(--gold); }
.avatar { width: 100px; height: 100px; border-radius: 50%; margin: 0 auto 1rem; display: flex; align-items: center; justify-content: center; font-size: 2rem; font-weight: 700; color: var(--white); background: var(--blue); overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.team-card.faculty .avatar { width: 120px; height: 120px; font-size: 2.5rem; background: var(--navy); }
.team-name { font-size: 1.05rem; font-weight: 700; color: var(--navy); margin-bottom: .2rem; }
.team-role { font-size: .85rem; color: var(--gold); font-weight: 500; margin-bottom: .4rem; }
.team-research { font-size: .8rem; color: var(--gray-600); margin-bottom: .5rem; }
.team-email { font-size: .8rem; color: var(--blue); text-decoration: none; word-break: break-all; }
.team-email:hover { text-decoration: underline; }

/* ── Contact ── */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.5rem; }
.contact-card { background: var(--white); padding: 2rem; border-radius: var(--radius); box-shadow: var(--shadow); text-align: center; }
.contact-card .c-icon { font-size: 2rem; margin-bottom: .5rem; }
.contact-card h3 { font-size: 1rem; color: var(--navy); margin-bottom: .3rem; }
.contact-card p, .contact-card a { font-size: .9rem; color: var(--gray-600); text-decoration: none; }
.contact-card a:hover { color: var(--blue); }

/* ── Auth Pages ── */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--gray-50); }
.auth-card { background: var(--white); padding: 2.5rem; border-radius: var(--radius); box-shadow: var(--shadow-lg); width: 100%; max-width: 420px; }
.auth-card h2 { font-size: 1.5rem; color: var(--navy); text-align: center; margin-bottom: 1.5rem; }

/* ── Article List ── */
.page-header { padding: 5rem 2rem 2rem; background: var(--navy); text-align: center; }
.page-header h1 { color: var(--white); font-size: 2rem; margin-bottom: .5rem; }
.page-header p { color: rgba(255,255,255,.7); font-size: .95rem; }

.article-filters { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; padding: 1rem 1.5rem; border-bottom: 1px solid var(--gray-200); background: var(--white); position: sticky; top: 64px; z-index: 10; }
.filter-search { flex: 1; min-width: 200px; }
.filter-search input {
  width: 100%; padding: .5rem .75rem;
  border: 1.5px solid var(--gray-300); border-radius: 24px;
  font-size: .85rem; outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.filter-search input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(44,111,170,.08);
}
.tag-filter { display: flex; gap: .4rem; flex-wrap: wrap; }
/* old tag-pill overridden by modern styles below */

.article-list { max-width: 800px; margin: 0 auto; padding: 2rem; }
.article-item { padding: 1.5rem; border-bottom: 1px solid var(--gray-200); transition: background var(--transition); position: relative; }
.article-item:hover { background: var(--gray-50); }
.article-item .a-meta { font-size: .8rem; color: var(--gray-600); margin-bottom: .35rem; display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.article-item .a-visibility { display: inline-block; padding: .1rem .5rem; border-radius: 3px; font-size: .7rem; font-weight: 600; }
.vis-public { background: #d4edda; color: #155724; }
.vis-internal { background: var(--gold-light); color: var(--navy); }
.article-item .a-title { font-size: 1.2rem; font-weight: 700; color: var(--navy); margin-bottom: .35rem; display: block; }
.article-item .a-title:hover { color: var(--blue); }
.article-item .a-desc { font-size: .9rem; color: var(--gray-600); line-height: 1.5; }
.article-item .a-tags { display: flex; gap: .4rem; margin-top: .5rem; flex-wrap: wrap; }
.a-tag { font-size: .75rem; padding: .15rem .55rem; border-radius: 3px; background: var(--blue-light); color: var(--blue); }
.a-bookmark { position: absolute; top: 1.5rem; right: 1.5rem; background: none; border: none; font-size: 1.2rem; cursor: pointer; opacity: .3; transition: opacity var(--transition); }
.a-bookmark:hover, .a-bookmark.bookmarked { opacity: 1; }

/* ── Article Detail ── */
.article-detail { max-width: 800px; margin: 0 auto; padding: 2rem; }
.article-detail .ad-header { margin-bottom: 2rem; }
.article-detail .ad-title { font-size: 2rem; font-weight: 800; color: var(--navy); margin-bottom: .75rem; }
.article-detail .ad-meta { font-size: .85rem; color: var(--gray-600); display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; margin-bottom: .75rem; }
.article-detail .ad-tags { display: flex; gap: .5rem; flex-wrap: wrap; }
.article-detail .ad-content { font-size: 1rem; line-height: 1.9; color: var(--text); }
.article-detail .ad-content h1, .ad-content h2, .ad-content h3 { color: var(--navy); margin-top: 2rem; margin-bottom: .75rem; }
.article-detail .ad-content h1 { font-size: 1.8rem; border-bottom: 2px solid var(--gray-200); padding-bottom: .5rem; }
.article-detail .ad-content h2 { font-size: 1.4rem; border-bottom: 1px solid var(--gray-100); padding-bottom: .4rem; }
.article-detail .ad-content h3 { font-size: 1.15rem; }
.article-detail .ad-content p { margin-bottom: 1rem; }
.article-detail .ad-content code { background: var(--gray-100); padding: .15rem .4rem; border-radius: 3px; font-size: .85em; }
.article-detail .ad-content pre { background: var(--navy); color: #e0e0e0; padding: 1.2rem; border-radius: var(--radius); overflow-x: auto; margin-bottom: 1rem; line-height: 1.5; }
.article-detail .ad-content pre code { background: none; padding: 0; color: inherit; }
.article-detail .ad-content blockquote { border-left: 4px solid var(--gold); padding-left: 1rem; color: var(--gray-600); margin: 1rem 0; }
.article-detail .ad-content table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; }
.article-detail .ad-content th, .ad-content td { border: 1px solid var(--gray-200); padding: .6rem .8rem; text-align: left; }
.article-detail .ad-content th { background: var(--gray-50); font-weight: 600; }
.article-detail .ad-content img { max-width: 100%; border-radius: var(--radius); }
.article-detail .ad-content ul, .ad-content ol { margin-bottom: 1rem; padding-left: 1.5rem; }

/* ── Mask overlay ── */
.mask-overlay { position: relative; }
.mask-overlay::after { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.7); border-radius: var(--radius); z-index: 5; pointer-events: none; }
.mask-notice { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 6; }
.mask-card { background: var(--white); padding: 2rem 2.5rem; border-radius: var(--radius); text-align: center; box-shadow: var(--shadow-lg); max-width: 450px; }
.mask-card .m-icon { font-size: 2.5rem; margin-bottom: .75rem; }
.mask-card h3 { font-size: 1.2rem; color: var(--navy); margin-bottom: .5rem; }
.mask-card p { font-size: .9rem; color: var(--gray-600); margin-bottom: 1.25rem; }
.mask-card .m-email { color: var(--blue); font-size: .85rem; }

/* ── Comments ── */
.comments-section { max-width: 800px; margin: 0 auto; padding: 2rem; border-top: 1px solid var(--gray-200); }
.comments-section h3 { font-size: 1.2rem; color: var(--navy); margin-bottom: 1.25rem; }
.comment { padding: 1rem; border-bottom: 1px solid var(--gray-100); }
.comment .c-author { font-weight: 700; color: var(--navy); font-size: .9rem; margin-bottom: .25rem; }
.comment .c-time { font-size: .75rem; color: var(--gray-600); margin-left: .5rem; }
.comment .c-content { font-size: .9rem; color: var(--text); margin: .4rem 0; }
.comment .c-reply-btn { font-size: .8rem; color: var(--blue); cursor: pointer; background: none; border: none; }
.comment .c-reply-btn:hover { text-decoration: underline; }
.comment-replies { margin-left: 2rem; border-left: 2px solid var(--gold-light); padding-left: 1rem; }
.comment-replies .comment { border-bottom: none; padding: .75rem 0; }
.comment-form { margin-top: 1.5rem; }
.comment-form textarea { width: 100%; min-height: 80px; padding: .65rem; border: 1px solid var(--gray-300); border-radius: var(--radius); font-family: inherit; font-size: .85rem; resize: vertical; }
.comment-form textarea:focus { outline: none; border-color: var(--blue); }
.comment-form-buttons { display: flex; gap: .5rem; justify-content: flex-end; margin-top: .5rem; }

/* ── User Center Sidebar V1 ── */
.uc-layout { display: flex; min-height: calc(100vh - 64px); margin-top: 64px; }
.uc-sidebar { width: 270px; background: var(--navy); color: var(--white); flex-shrink: 0; display: flex; flex-direction: column; overflow-y: auto; }
.uc-sidebar-header { padding: 1.5rem 1.25rem; text-align: center; border-bottom: 1px solid rgba(255,255,255,.08); }
.uc-avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--blue); margin: 0 auto .5rem; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; font-weight: 700; overflow: hidden; }
.uc-avatar img { width: 100%; height: 100%; object-fit: cover; }
.uc-name { font-size: 1rem; font-weight: 700; }
.uc-role { font-size: .8rem; color: var(--gold); margin-top: .15rem; }
.uc-research { font-size: .75rem; color: rgba(255,255,255,.5); margin-top: .25rem; }
.uc-edit { font-size: .75rem; color: var(--gold-light); margin-top: .4rem; display: inline-block; }
.uc-edit:hover { color: var(--gold); }

/* Create button */
.btn-create { display: flex; align-items: center; justify-content: center; gap: .35rem; margin: 1.25rem; padding: .75rem 0; width: calc(100% - 2.5rem); background: var(--gold); color: var(--navy); border: none; border-radius: 8px; font-size: .9rem; font-weight: 700; cursor: pointer; transition: background-color .18s; -webkit-tap-highlight-color: transparent; }
.btn-create:hover { background: #cfaa3e; }
.btn-create:active { background: #a8832a; }
.btn-create-arrow { font-size: .55rem; transition: transform .25s; }
.uc-create-dropdown { display: none; background: var(--navy-light); border-radius: var(--radius); margin: -.25rem 1.25rem .5rem; overflow: hidden; }
.uc-create-dropdown.show { display: block; }
.uc-create-dropdown a { display: block; padding: .65rem 1rem; color: var(--white); font-size: .85rem; }
.uc-create-dropdown a:hover { background: rgba(255,255,255,.1); }

/* Nav: ul-based */
.uc-nav { flex: 1; overflow-y: auto; padding: .5rem 0; }
.uc-nav ul { list-style: none; }
.nav-link { display: flex; align-items: center; gap: 12px; padding: .7rem 1.25rem; color: rgba(255,255,255,.78); text-decoration: none; font-size: .9rem; transition: background-color .18s, border-color .18s; border-left: 3px solid transparent; -webkit-tap-highlight-color: transparent; }
.nav-link:hover { color: var(--white); background: rgba(255,255,255,.06); }
.nav-link:active { background: rgba(255,255,255,.08); color: var(--white); }
.nav-link.active { color: var(--white); background: rgba(255,255,255,.08); border-left-color: var(--gold); font-weight: 600; }
.nav-link .ico { font-size: 1rem; width: 22px; text-align: center; flex-shrink: 0; }
.nav-link .label { flex: 1; }
.badge { font-size: .72rem; background: rgba(255,255,255,.15); color: #fff; padding: .1rem .5rem; border-radius: 10px; font-weight: 600; line-height: 1.4; }

/* Accordion */
.nav-acc-header { display: flex; align-items: center; gap: 12px; padding: .7rem 1.25rem; color: rgba(255,255,255,.78); font-size: .9rem; cursor: pointer; user-select: none; transition: background-color .18s, border-color .18s; border-left: 3px solid transparent; -webkit-tap-highlight-color: transparent; }
.nav-acc-header:hover { color: var(--white); background: rgba(255,255,255,.06); }
.nav-acc-header:active { background: rgba(255,255,255,.08); color: var(--white); }
.nav-acc-header.open { color: var(--gold); }
.nav-acc-header.open:active { color: var(--gold); background: rgba(255,255,255,.08); }
.nav-acc-header .ico { font-size: 1rem; width: 22px; text-align: center; flex-shrink: 0; }
.nav-acc-header .label { flex: 1; }
.nav-acc-header .arrow { font-size: .55rem; transition: transform .25s ease; color: rgba(255,255,255,.35); }
.nav-acc-header.open .arrow { transform: rotate(90deg); }
.nav-acc-body { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.nav-acc-body a { display: block; padding: .5rem 1.25rem .5rem 3.6rem; color: rgba(255,255,255,.6); font-size: .83rem; text-decoration: none; transition: background-color .15s, color .15s; -webkit-tap-highlight-color: transparent; }
.nav-acc-body a:hover { color: var(--white); background: rgba(255,255,255,.04); }
.nav-acc-body a:active { color: var(--white); background: rgba(255,255,255,.08); }
.nav-acc-body a.active { color: var(--gold); background: rgba(255,255,255,.06); }
.nav-acc-body a.active:active { color: var(--gold); background: rgba(255,255,255,.08); }
.badge-alert { background: #e74c3c !important; color: #fff !important; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .5; } }

.uc-sidebar-footer { padding: 1rem 1.25rem; border-top: 1px solid rgba(255,255,255,.08); }
.uc-sidebar-footer a { color: rgba(255,255,255,.4); font-size: .8rem; text-decoration: none; }
.uc-sidebar-footer a:hover { color: var(--white); }

.uc-main { flex: 1; background: var(--gray-50); padding: 2rem; overflow-y: auto; }
.uc-main .uc-panel { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 2rem; max-width: 100%; }
.uc-main .uc-panel h2 { font-size: 1.4rem; color: var(--navy); margin-bottom: 1.5rem; padding-bottom: .75rem; border-bottom: 2px solid var(--gray-200); }

/* ── Editor ── */
.editor-layout { display: flex; height: calc(100vh - 64px); overflow: hidden; margin-top: 64px; }
.editor-sidebar { width: 240px; background: var(--navy); color: var(--white); display: flex; flex-direction: column; flex-shrink: 0; }
.editor-sidebar h3 { font-size: .85rem; text-transform: uppercase; color: rgba(255,255,255,.5); letter-spacing: 1px; }
.sidebar-scroll { flex: 1; overflow-y: auto; padding: 1.5rem 1rem 0; display: flex; flex-direction: column; gap: 1rem; }
.sidebar-tags { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .25rem; }
.sidebar-actions { flex-shrink: 0; padding: 1.25rem 1.25rem 1.5rem; display: flex; flex-direction: column; align-items: center; gap: .75rem; border-top: 1px solid rgba(255,255,255,.1); background: var(--navy); }
.sidebar-actions .btn { width: 180px; text-align: center; }
.editor-main { flex: 1; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.editor-meta { display: flex; gap: 1rem; padding: .75rem 1.25rem; background: var(--gray-50); border-bottom: 1px solid var(--gray-200); align-items: center; flex-wrap: wrap; flex-shrink: 0; }
.editor-meta .em-field { display: flex; align-items: center; gap: .4rem; flex: 1; }
.editor-meta label { font-size: .8rem; font-weight: 600; color: var(--gray-600); white-space: nowrap; }
.editor-meta input { padding: .35rem .55rem; border: 1px solid var(--gray-300); border-radius: 4px; font-size: .85rem; flex: 1; min-width: 200px; }
.editor-meta select { padding: .35rem .55rem; border: 1px solid var(--gray-300); border-radius: 4px; font-size: .85rem; }

/* ── Drive ── */
.drive-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; }
.drive-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; text-align: center; transition: all var(--transition); }
.drive-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.drive-card .d-icon { font-size: 2rem; margin-bottom: .5rem; }
.drive-card .d-name { font-size: .85rem; color: var(--navy); font-weight: 600; word-break: break-all; margin-bottom: .25rem; }
.drive-card .d-size { font-size: .75rem; color: var(--gray-600); }
.drive-card .d-actions { display: flex; gap: .35rem; justify-content: center; margin-top: .5rem; }
.drive-upload-zone { border: 2px dashed var(--gray-300); border-radius: var(--radius); padding: 2rem; text-align: center; margin-bottom: 1.5rem; transition: all var(--transition); cursor: pointer; }
.drive-upload-zone:hover { border-color: var(--blue); background: var(--blue-light); }

/* ── Token list ── */
.token-card { background: var(--white); border-radius: var(--radius); padding: 1.25rem; margin-bottom: .75rem; box-shadow: var(--shadow); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }
.token-card .t-info { font-size: .85rem; }
.token-card .t-url { font-family: monospace; font-size: .8rem; background: var(--gray-100); padding: .25rem .5rem; border-radius: 3px; color: var(--blue); word-break: break-all; }
.token-card .t-meta { font-size: .8rem; color: var(--gray-600); }
.token-status { font-size: .75rem; padding: .2rem .55rem; border-radius: 10px; font-weight: 600; }
.t-valid { background: #d4edda; color: #155724; }
.t-expired { background: #f8d7da; color: #721c24; }

/* ── Empty state ── */
.empty-state { text-align: center; padding: 3rem 2rem; color: var(--gray-600); }
.empty-state .e-icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state h3 { font-size: 1.1rem; color: var(--navy); margin-bottom: .5rem; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .menu-toggle { display: block; }
  .hero h1 { font-size: 2rem; }
  .hero .subtitle { font-size: 1rem; }
  .section { padding: 3rem 1rem; }
  .team-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem; }
  .research-grid { grid-template-columns: 1fr; }
  .editor-panes { flex-direction: column; }
  .editor-pane-left { border-right: none; border-bottom: 1px solid var(--gray-200); min-height: 300px; }
  .uc-layout { flex-direction: column; }
  .uc-sidebar { width: 100%; }
  .article-filters { flex-direction: column; align-items: stretch; }
}

/* ── Admin Article Management: Shared ── */
.admin-badge {
  display: inline-block; padding: .15rem .55rem; border-radius: 3px;
  font-size: .72rem; font-weight: 600; white-space: nowrap;
}
.admin-badge--public { background: #d4edda; color: #155724; }
.admin-badge--internal { background: var(--gold-light); color: var(--navy); }
.admin-badge--published { background: #d4edda; color: #155724; }
.admin-badge--draft { background: #fff3cd; color: #856404; }
.admin-action--danger { color: #c0392b !important; }
.admin-action--danger:hover { color: #a93226 !important; background: #fdf2f2; }

.admin-nav__header {
  display: flex; align-items: center; gap: 1rem; margin-bottom: .75rem; flex-wrap: wrap;
}
.admin-nav__title { font-size: 1.4rem; color: var(--navy); margin: 0; }
.admin-nav__count { font-size: .85rem; color: var(--gray-600); }

.admin-nav__view-switch {
  display: flex; gap: .25rem; margin-left: auto;
}
.admin-nav__view-switch a {
  padding: .25rem .55rem; font-size: .75rem; border: 1px solid var(--gray-300);
  border-radius: 4px; color: var(--gray-600); text-decoration: none;
  transition: all var(--transition);
}
.admin-nav__view-switch a.is-active,
.admin-nav__view-switch a:hover {
  background: var(--navy); color: var(--white); border-color: var(--navy);
}

/* ── V1: Data Table ── */
.admin-nav--top {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: .75rem; padding-bottom: 1rem;
  border-bottom: 2px solid var(--gray-200); margin-bottom: 0;
}
.admin-nav__tabs {
  display: flex; list-style: none; gap: .25rem;
}
.admin-nav__tab a {
  display: block; padding: .4rem .9rem; font-size: .82rem;
  color: var(--gray-600); text-decoration: none; border-radius: var(--radius);
  transition: all var(--transition);
}
.admin-nav__tab a:hover { background: var(--gray-100); }
.admin-nav__tab.is-active a {
  background: var(--navy); color: var(--white); font-weight: 600;
}

.admin-table { margin-top: 1rem; }
.admin-table__head {
  display: grid;
  grid-template-columns: 100px 100px 80px 70px 1fr 120px;
  gap: .5rem; padding: .6rem .75rem;
  background: var(--gray-50); border-radius: var(--radius);
  font-size: .78rem; font-weight: 700; color: var(--gray-600);
  text-transform: uppercase; letter-spacing: .5px;
}
.admin-table__body { list-style: none; margin: 0; padding: 0; }
.admin-table__row {
  display: grid;
  grid-template-columns: 100px 100px 80px 70px 1fr 120px;
  gap: .5rem; padding: .7rem .75rem;
  border-bottom: 1px solid var(--gray-100); align-items: center;
  font-size: .85rem; transition: background var(--transition);
}
.admin-table__row:hover { background: var(--gray-50); }
.admin-table__col--title a {
  color: var(--navy); font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: block; text-decoration: none;
}
.admin-table__col--title a:hover { color: var(--blue); }
.admin-table__col--actions {
  display: flex; gap: .35rem;
}

/* ── V2: Card Grid ── */
.admin-nav--toolbar {
  padding-bottom: 1rem; border-bottom: 2px solid var(--gray-200);
  margin-bottom: 1.5rem;
}
.admin-nav__pills {
  display: flex; list-style: none; gap: .4rem; flex-wrap: wrap;
  padding: 0; margin: 0 0 .75rem 0;
}
.admin-nav__pill a {
  display: block; padding: .35rem .85rem; font-size: .8rem;
  border: 1px solid var(--gray-300); border-radius: 20px;
  color: var(--gray-600); text-decoration: none;
  transition: all var(--transition);
}
.admin-nav__pill a:hover,
.admin-nav__pill.is-active a {
  background: var(--blue); color: var(--white); border-color: var(--blue);
}

.admin-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}
.admin-card {
  background: var(--white); border: 1px solid var(--gray-200);
  border-radius: var(--radius); padding: 1.25rem;
  box-shadow: var(--shadow); transition: all var(--transition);
  display: flex; flex-direction: column; gap: .75rem;
}
.admin-card:hover {
  box-shadow: var(--shadow-md); transform: translateY(-2px);
  border-color: var(--blue);
}
.admin-card__meta {
  display: flex; align-items: center; gap: .5rem; font-size: .78rem;
  color: var(--gray-600);
}
.admin-card__author-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--navy); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem; font-weight: 600; flex-shrink: 0;
}
.admin-card__author-name { font-weight: 600; }
.admin-card__date { margin-left: auto; }
.admin-card__title { font-size: 1.05rem; margin: 0; line-height: 1.4; }
.admin-card__title a { color: var(--navy); text-decoration: none; }
.admin-card__title a:hover { color: var(--blue); }
.admin-card__badges { display: flex; gap: .4rem; }
.admin-card__tags { display: flex; gap: .3rem; flex-wrap: wrap; }
.admin-card__tag {
  display: inline-block; padding: .1rem .45rem;
  background: var(--gray-100); color: var(--gray-600);
  border-radius: 3px; font-size: .7rem;
}
.admin-card__actions {
  display: flex; gap: .5rem; list-style: none;
  margin: 0; padding: .5rem 0 0 0;
  border-top: 1px solid var(--gray-100);
}

/* ── V3: Compact List ── */
.admin-panel--v3 {
  display: flex; gap: 0; padding: 0;
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
  min-height: 500px;
}
.admin-nav--sidebar {
  width: 180px; background: var(--gray-50); padding: 1.5rem 1rem;
  border-right: 1px solid var(--gray-200); flex-shrink: 0;
}
.admin-nav__sb-header h3 {
  font-size: .72rem; text-transform: uppercase; letter-spacing: 1px;
  color: var(--gray-600); margin: 0 0 .75rem 0; font-weight: 700;
}
.admin-nav__sb-list { list-style: none; padding: 0; margin: 0; }
.admin-nav__sb-item a {
  display: block; padding: .4rem .6rem; font-size: .8rem;
  color: var(--gray-600); text-decoration: none; border-radius: 4px;
  transition: all var(--transition);
}
.admin-nav__sb-item a:hover { background: var(--gray-200); }
.admin-nav__sb-item.is-active a {
  background: var(--blue); color: var(--white); font-weight: 600;
}
.admin-nav__sb-divider {
  height: 1px; background: var(--gray-200); margin: .75rem 0;
}

.admin-compact-main { flex: 1; padding: 1.5rem; min-width: 0; }
.admin-compact__header {
  display: flex; align-items: center; gap: 1rem;
  margin-bottom: 1rem; flex-wrap: wrap;
}
.admin-compact__header h2 { font-size: 1.15rem; color: var(--navy); margin: 0; }
.admin-compact-list { list-style: none; padding: 0; margin: 0; }
.admin-compact-item {
  display: flex; align-items: center; gap: 1rem; padding: .6rem .25rem;
  border-bottom: 1px solid var(--gray-100); font-size: .84rem;
  transition: background var(--transition);
}
.admin-compact-item:hover { background: var(--gray-50); padding-left: .5rem; padding-right: .5rem; }
.admin-compact-item__left {
  display: flex; align-items: center; gap: .5rem; width: 115px; flex-shrink: 0;
}
.admin-compact-item__date { font-size: .78rem; color: var(--gray-600); white-space: nowrap; }
.admin-compact-item__center { flex: 1; min-width: 0; }
.admin-compact-item__title {
  color: var(--navy); font-weight: 600; display: block;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-decoration: none;
}
.admin-compact-item__title:hover { color: var(--blue); }
.admin-compact-item__author { font-size: .75rem; color: var(--gray-600); }
.admin-compact-item__right {
  display: flex; align-items: center; gap: .6rem; flex-shrink: 0;
}
.admin-compact-item__right a {
  font-size: .78rem; color: var(--blue); text-decoration: none;
}
.admin-compact-item__right a:hover { text-decoration: underline; }

/* ── Admin Pagination ── */
.admin-pagination {
  margin-top: 2rem; padding-top: 1rem;
  border-top: 1px solid var(--gray-200);
}
.admin-pagination__list {
  display: flex; list-style: none; gap: .3rem; justify-content: center;
  padding: 0; margin: 0;
}
.admin-pagination__item a,
.admin-pagination__item span {
  display: block; padding: .35rem .7rem; font-size: .82rem;
  border: 1px solid var(--gray-300); border-radius: 4px;
  color: var(--gray-600); text-decoration: none;
  transition: all var(--transition);
}
.admin-pagination__item a:hover { background: var(--gray-100); }
.admin-pagination__item.is-active span {
  background: var(--navy); color: var(--white); border-color: var(--navy);
  font-weight: 600;
}
.admin-pagination__item.is-disabled span {
  color: var(--gray-300); border-color: var(--gray-100);
}

@media (max-width: 768px) {
  .admin-panel--v3 { flex-direction: column; }
  .admin-nav--sidebar {
    width: 100%; display: flex; gap: 1rem; align-items: center;
    padding: .75rem 1rem; flex-wrap: wrap;
  }
  .admin-nav__sb-list { display: flex; gap: .25rem; }
  .admin-nav__sb-divider { display: none; }
  .admin-nav__sb-header h3 { margin: 0 .5rem 0 0; }
  .admin-table__head,
  .admin-table__row {
    grid-template-columns: 80px 70px 60px 60px 1fr 80px;
    font-size: .75rem; gap: .25rem;
  }
  .admin-card-grid { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════
   Tag Search UI — Modern polished design
   ══════════════════════════════════════════ */

/* ── Tag Mode Switcher (test paths only) ── */
.tag-mode-switcher {
  display: flex; gap: .15rem; background: var(--gray-200);
  border-radius: 20px; padding: .15rem;
}
.tag-mode-btn {
  padding: .3rem .75rem; font-size: .75rem; border: none;
  background: transparent; color: var(--gray-600);
  border-radius: 18px; cursor: pointer; transition: all .2s;
  font-family: inherit; white-space: nowrap;
}
.tag-mode-btn:hover { color: var(--navy); }
.tag-mode-btn.active {
  background: var(--white); color: var(--navy);
  font-weight: 600; box-shadow: var(--shadow);
}

/* ═══ Chip Filter (Modern) ═══ */

.tag-chips-panel {
  display: flex; gap: .35rem; flex-wrap: wrap; align-items: center;
}

.tag-pill {
  position: relative; display: inline-flex; align-items: center; gap: .3rem;
  padding: .4rem 1rem; border-radius: 28px; font-size: .78rem;
  font-weight: 500; cursor: pointer; user-select: none;
  border: 1.5px solid var(--gray-300);
  background: var(--white); color: var(--gray-600);
  white-space: nowrap;
  transition: all .3s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
  letter-spacing: .01em;
}
.tag-pill::before {
  content: '';
  position: absolute; inset: -1px; border-radius: 28px;
  background: linear-gradient(135deg, var(--blue), #764ba2, var(--blue));
  opacity: 0; z-index: -1; transition: opacity .3s;
}
.tag-pill:hover {
  border-color: var(--blue);
  color: var(--navy);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(44,111,170,.12);
}
.tag-pill:active { transform: scale(.93); transition: transform .1s; }

.tag-pill.active {
  background: linear-gradient(135deg, #2c6faa 0%, #1e5799 100%);
  color: #fff; border-color: transparent;
  font-weight: 600;
  box-shadow: 0 4px 18px rgba(44,111,170,.4),
              0 0 0 1px rgba(44,111,170,.3),
              inset 0 1px 0 rgba(255,255,255,.25);
  transform: translateY(-1px);
  text-shadow: 0 1px 2px rgba(0,0,0,.15);
}

.tag-pill-all {
  font-weight: 600;
  border-color: var(--gray-300);
  background: var(--gray-50);
}
.tag-pill-all:hover { border-color: var(--gray-600); }
.tag-pill-all.active {
  background: linear-gradient(135deg, var(--navy) 0%, #1a3045 100%);
  border-color: transparent;
  font-weight: 600;
}

.tag-pill-clear {
  color: #e74c3c;
  border: 1.5px dashed #e74c3c;
  background: rgba(231,76,60,.04);
  font-size: .73rem;
  padding: .35rem .7rem;
  font-weight: 600;
  opacity: .85;
  margin-left: .25rem;
}
.tag-pill-clear:hover {
  color: #fff;
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  border-color: transparent;
  opacity: 1;
  box-shadow: 0 4px 14px rgba(231,76,60,.35);
  transform: translateY(-2px);
}

/* Chip filter entrance animation */
.tag-pill {
  animation: pillEnter .35s ease backwards;
}
@keyframes pillEnter {
  from { opacity: 0; transform: translateY(6px) scale(.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Tag count badge */
.tag-pill .pill-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; border-radius: 9px;
  background: rgba(255,255,255,.25);
  font-size: .65rem; font-weight: 700;
  margin-left: .15rem; padding: 0 .25rem;
}
.tag-pill.active .pill-count { background: rgba(255,255,255,.3); }

/* ── Design 2: Active Filter Bar ── */
.active-filter-bar {
  display: flex; align-items: center; gap: .5rem;
  padding: .5rem .75rem;
  background: linear-gradient(135deg, var(--blue-light) 0%, #dce8f4 100%);
  border: 1px solid rgba(44,111,170,.15);
  border-radius: var(--radius);
  animation: slideDown .3s cubic-bezier(.4,0,.2,1);
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
.afb-label { font-size: .8rem; color: var(--navy); font-weight: 600; }
.afb-tag {
  font-size: .8rem; padding: .2rem .65rem;
  background: var(--blue); color: white; border-radius: 14px;
  font-weight: 600;
}
.afb-clear {
  font-size: .75rem; background: none; border: none;
  color: var(--gray-600); cursor: pointer; margin-left: auto;
  padding: .2rem .5rem; border-radius: 4px;
  transition: all .15s;
}
.afb-clear:hover { color: #c0392b; background: rgba(192,57,43,.08); }

/* ── Design 2: Clickable article tags ── */
.a-tag-clickable {
  cursor: pointer;
  transition: transform .2s, box-shadow .2s, background .2s, color .2s;
}
.a-tag-clickable:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(44,111,170,.25);
  background: var(--blue); color: white;
}

/* ── Design 3: Dropdown ── */
.tag-dropdown { position: relative; min-width: 240px; }
.tag-dropdown-input {
  display: flex; align-items: center;
  border: 1.5px solid var(--gray-300); border-radius: 28px;
  padding: .3rem .4rem; background: var(--white);
  gap: .25rem; cursor: text; flex-wrap: wrap;
  transition: all .25s cubic-bezier(.4,0,.2,1);
}
.tag-dropdown-input:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(44,111,170,.08),
              0 2px 12px rgba(44,111,170,.12);
  transform: translateY(-1px);
}
.tag-dropdown-chips {
  display: flex; gap: .2rem; flex-wrap: wrap;
}
.dropdown-chip {
  font-size: .75rem; padding: .2rem .45rem .2rem .55rem;
  background: linear-gradient(135deg, var(--blue) 0%, #1a5f9e 100%);
  color: white;
  border-radius: 16px; display: flex; align-items: center; gap: .25rem;
  animation: chipPop .2s cubic-bezier(.4,0,.2,1);
  font-weight: 500;
}
@keyframes chipPop {
  from { transform: scale(.7); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.dropdown-chip .chip-remove {
  cursor: pointer; font-size: .65rem; opacity: .6; transition: opacity .15s;
}
.dropdown-chip .chip-remove:hover { opacity: 1; }
.tag-dropdown-search {
  border: none; outline: none; font-size: .8rem;
  min-width: 80px; flex: 1; padding: .2rem;
  font-family: inherit; color: var(--text);
}
.tag-dropdown-toggle {
  background: none; border: none; cursor: pointer;
  color: var(--gray-600); font-size: .7rem; padding: .2rem .3rem;
  border-radius: 50%; transition: background .15s;
}
.tag-dropdown-toggle:hover { background: var(--gray-100); }
.tag-dropdown-menu {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--white); border: 1px solid var(--gray-200);
  border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.12),
                                  0 4px 12px rgba(0,0,0,.06);
  max-height: 220px; overflow-y: auto; z-index: 20;
  animation: menuDrop .2s cubic-bezier(.4,0,.2,1);
  padding: .35rem;
}
@keyframes menuDrop {
  from { opacity: 0; transform: translateY(-6px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.tag-dropdown-item {
  display: block; padding: .55rem .85rem; font-size: .8rem;
  cursor: pointer; transition: all .15s;
  color: var(--text); border-radius: 10px;
}
.tag-dropdown-item:hover {
  background: var(--blue-light); color: var(--navy);
}
.tag-dropdown-item.selected {
  background: linear-gradient(135deg, var(--blue) 0%, #1a5f9e 100%);
  color: white; font-weight: 600;
}

/* ── Article filter animation ── */
.article-list.filtering .article-item {
  animation: articleFilterIn .4s cubic-bezier(.4,0,.2,1);
}
@keyframes articleFilterIn {
  from { opacity: .4; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Utility ── */
.hidden { display: none !important; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .tag-mode-switcher { order: -1; width: 100%; overflow-x: auto; }
  .tag-mode-btn { font-size: .7rem; padding: .25rem .5rem; }
  .tag-dropdown { min-width: 100%; }
  .tag-pill { font-size: .73rem; padding: .3rem .7rem; }
}
