/**
 * Reference Website Style CSS - Modern Version
 * Based on 国家通用语言文字教学与研究杂志社官网
 * Modern implementation with enhanced styling
 */

/* ============================================
   CSS Variables - Modern Color Scheme
   ============================================ */
:root {
  --ref-primary: #1a73e8; /* Modern blue */
  --ref-primary-dark: #1557b0; /* Darker blue for hover */
  --ref-primary-light: #e8f0fe; /* Light blue background */
  --ref-secondary: #34a853; /* Green accent */
  --ref-accent: #ea4335; /* Red accent for important */
  --ref-text: #202124; /* Main text color */
  --ref-text-light: #5f6368; /* Secondary text */
  --ref-border: #dadce0; /* Border color */
  --ref-bg: #f8f9fa; /* Background */
  --ref-white: #ffffff;
  --ref-success: #1ca01a; /* Green for dates */
  --ref-shadow: rgba(60, 64, 67, 0.1);
  --ref-shadow-hover: rgba(60, 64, 67, 0.2);
}

/* ============================================
   Base Reset & Typography
   ============================================ */

body {
  margin: 0;
  padding: 0;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ref-text);
  background: var(--ref-bg);
}

a {
  color: var(--ref-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

img {
  border: 0;
  max-width: 100%;
  height: auto;
}

/* ============================================
   Layout Containers
   ============================================ */
.wrapper {
  max-width: 1200px;
  margin: 0 auto;
}

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

/* ============================================
   Header & Navigation
   ============================================ */
.header-top {
  width: 100%;
  border-bottom: 1px solid var(--ref-border);
  padding: 15px 0;
}

.header-top .inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
  height: 70px;
}

.header-logo {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.header-logo img {
  height: 70px;
  width: auto;
  transition: transform 0.3s ease;
}

.header-logo img:hover {
  transform: scale(1.02);
}

.header-tel {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ref-primary);
}

.header-tel .tel-label {
  font-size: 16px;
  color: var(--ref-primary);
  font-weight: 600;
  letter-spacing: 1px;
}

.header-tel .tel-number {
  font-size: 16px;
  font-weight: 600;
}

/* Navigation */
.nav-wrapper {
  width: 100%;
  background: linear-gradient(
    135deg,
    var(--ref-primary) 0%,
    var(--ref-primary-dark) 100%
  );
  position: relative;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(26, 115, 232, 0.3);
}

.nav-menu {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  flex-wrap: wrap;
  list-style: none;
}

.nav-menu li {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-menu > li > a {
  display: flex;
  align-items: center;
  padding: 0 24px;
  height: 50px;
  color: var(--ref-white);
  font-weight: 500;
  font-size: 15px;
  text-align: center;
  transition: all 0.3s ease;
  letter-spacing: 0.3px;
}

.nav-menu > li > a:hover,
.nav-menu > li.current > a {
  background: rgba(255, 255, 255, 0.15);
  text-decoration: none;
}

/* Dropdown Submenu */
.nav-menu li .submenu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 180px;
  background: var(--ref-white);
  border: none;
  border-radius: 8px;
  box-shadow: 0 4px 20px var(--ref-shadow-hover);
  display: none;
  z-index: 101;
  overflow: hidden;
}

.nav-menu li:hover .submenu {
  display: block;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.nav-menu li .submenu a {
  display: block;
  padding: 12px 20px;
  color: var(--ref-text);
  font-size: 14px;
  font-weight: 400;
  border-bottom: 1px solid #f0f0f0;
  transition: all 0.2s ease;
}

.nav-menu li .submenu a:last-child {
  border-bottom: none;
}

.nav-menu li .submenu a:hover {
  background: var(--ref-primary-light);
  color: var(--ref-primary);
  padding-left: 25px;
}

/* ============================================
   Main Body Layout
   ============================================ */
.main-body {
  max-width: 1200px;
  margin: 20px auto;
  padding: 0 20px;
  display: flex;
  gap: 25px;
}

/* Left Sidebar */
.sidebar-left {
  width: 260px;
  flex-shrink: 0;
}

/* Right Sidebar */
.sidebar-right {
  width: 300px;
  flex-shrink: 0;
}

.sidebar-box {
  border: 1px solid var(--ref-border);
  margin-bottom: 20px;
  background: var(--ref-white);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px var(--ref-shadow);
  transition: box-shadow 0.3s ease;
}

.sidebar-box:hover {
  box-shadow: 0 4px 12px var(--ref-shadow);
}

.sidebar-box .box-title {
  background: linear-gradient(135deg, #f8f9fa 0%, #e8eaed 100%);
  border-bottom: 1px solid var(--ref-border);
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ref-primary);
}

/* News list in sidebar */
.sidebar-news-list {
  padding: 10px 15px;
}

.sidebar-news-list dt {
  font-size: 12px;
  color: var(--ref-text-light);
  line-height: 18px;
  margin-top: 8px;
}

.sidebar-news-list dd {
  margin: 0;
  line-height: 28px;
  border-bottom: 1px dotted #eee;
  font-size: 13px;
}

.sidebar-news-list dd:last-child {
  border-bottom: none;
}

.sidebar-news-list dd a {
  color: var(--ref-text);
  display: block;
  padding: 5px 0;
  transition: all 0.2s ease;
}

.sidebar-news-list dd a:hover {
  color: var(--ref-primary);
  padding-left: 5px;
}

/* Search box */
.search-box {
  padding: 15px;
}

.search-box form {
  display: flex;
  gap: 8px;
}

.search-box input[type="text"] {
  flex: 1;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--ref-border);
  border-radius: 6px;
  font-size: 13px;
  transition: all 0.2s ease;
}

.search-box input[type="text"]:focus {
  outline: none;
  border-color: var(--ref-primary);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.search-box input[type="submit"] {
  height: 38px;
  padding: 0 16px;
  background: var(--ref-primary);
  border: none;
  border-radius: 6px;
  color: var(--ref-white);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.search-box input[type="submit"]:hover {
  background: var(--ref-primary-dark);
}

/* Main Content Area */
.main-content {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--ref-border);
  background: var(--ref-white);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px var(--ref-shadow);
}

/* Breadcrumb */
.breadcrumb {
  padding: 12px 20px;
  background: #f8f9fa;
  border-bottom: 1px solid var(--ref-border);
  font-size: 13px;
  color: var(--ref-text-light);
}

.breadcrumb a {
  color: var(--ref-text-light);
}

.breadcrumb a:hover {
  color: var(--ref-primary);
}

/* Article List */
.article-list {
  padding: 20px 25px;
}

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

.article-list td {
  line-height: 42px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 14px;
}

.article-list td.title {
  width: 85%;
}

.article-list td.title a {
  color: var(--ref-text);
  transition: color 0.2s ease;
}

.article-list td.title a:hover {
  color: var(--ref-primary);
}

.article-list td.date {
  width: 15%;
  text-align: right;
  font-size: 13px;
  color: var(--ref-text-light);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Pagination */
.pagination {
  padding: 20px;
  text-align: center;
  font-size: 13px;
}

.pagination a {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid var(--ref-border);
  margin: 0 3px;
  color: var(--ref-text);
  border-radius: 6px;
  transition: all 0.2s ease;
}

.pagination a:hover,
.pagination a.current {
  background: var(--ref-primary);
  border-color: var(--ref-primary);
  color: var(--ref-white);
  text-decoration: none;
}

/* Content Page */
.page-content {
  padding: 25px 30px;
  font-size: 14px;
  line-height: 1.8;
}

.page-content p {
  margin: 10px 0;
}

.page-content h1,
.page-content h2,
.page-content h3 {
  color: var(--ref-primary);
  margin: 18px 0 12px;
}

/* ============================================
   Query Form (用稿通知查询)
   ============================================ */
.query-section {
  padding: 25px;
}

.query-form {
  border: none;
  background: var(--ref-white);
  border-radius: 12px;
}

.query-form .form-group {
  display: flex;
  align-items: center;
  margin-bottom: 18px;
  padding: 12px 0;
}

.query-form label {
  width: 120px;
  text-align: right;
  padding-right: 18px;
  font-size: 14px;
  color: var(--ref-text);
  font-weight: 500;
}

.query-form input[type="text"] {
  flex: 1;
  max-width: 280px;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--ref-border);
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.2s ease;
}

.query-form input[type="text"]:focus,
.query-form input[type="email"]:focus {
  outline: none;
  border-color: var(--ref-primary);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.query-section input[type="text"]:focus {
  outline: none;
  border-color: var(--ref-primary);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.query-form input[type="submit"] {
  height: 44px;
  padding: 0 32px;
  background: linear-gradient(
    135deg,
    var(--ref-primary) 0%,
    var(--ref-primary-dark) 100%
  );
  border: none;
  border-radius: 8px;
  color: var(--ref-white);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(26, 115, 232, 0.3);
}

.query-form input[type="submit"]:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(26, 115, 232, 0.4);
}

/* Query Result Modal */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  backdrop-filter: blur(2px);
}

.modal-box {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 420px;
  background: var(--ref-white);
  border-radius: 16px;
  z-index: 1001;
  padding: 30px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.modal-box h3 {
  text-align: center;
  color: var(--ref-primary);
  font-size: 20px;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--ref-primary-light);
}

.modal-box p {
  line-height: 1.8;
  font-size: 15px;
  color: var(--ref-text);
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 18px;
  font-size: 24px;
  cursor: pointer;
  color: var(--ref-text-light);
  transition: color 0.2s ease;
}

.modal-close:hover {
  color: var(--ref-accent);
}

/* ============================================
   Contact Info
   ============================================ */
.contact-info {
  padding: 20px;
  font-size: 14px;
  line-height: 1.8;
}

.contact-info p {
  margin: 10px 0;
}

/* ============================================
   Guestbook Form
   ============================================ */
.guestbook-form {
  padding: 25px;
}

.guestbook-form table {
  width: 100%;
}

.guestbook-form td {
  padding: 10px 0;
  font-size: 14px;
}

.guestbook-form input[type="text"],
.guestbook-form input[type="email"],
.guestbook-form textarea {
  width: 100%;
  max-width: 400px;
  padding: 12px;
  border: 1px solid var(--ref-border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s ease;
}

.guestbook-form input[type="text"]:focus,
.guestbook-form input[type="email"]:focus,
.guestbook-form textarea:focus {
  outline: none;
  border-color: var(--ref-primary);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

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

.guestbook-form input[type="submit"] {
  padding: 12px 28px;
  background: linear-gradient(
    135deg,
    var(--ref-primary) 0%,
    var(--ref-primary-dark) 100%
  );
  border: none;
  border-radius: 8px;
  color: var(--ref-white);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(26, 115, 232, 0.3);
}

.guestbook-form input[type="submit"]:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(26, 115, 232, 0.4);
}

/* ============================================
   Footer
   ============================================ */
.footer {
  width: 100%;
  padding: 25px 0;
  background: linear-gradient(135deg, #2c3e50 0%, #1a252f 100%);
  text-align: center;
  font-size: 13px;
  color: #aab2bd;
  margin-top: 30px;
}

.footer a {
  color: #aab2bd;
}

.footer a:hover {
  color: var(--ref-white);
}

/* ============================================
   Modern Card Style
   ============================================ */
.modern-card {
  background: var(--ref-white);
  border-radius: 12px;
  box-shadow: 0 1px 3px var(--ref-shadow);
  transition: all 0.3s ease;
  overflow: hidden;
}

.modern-card:hover {
  box-shadow: 0 8px 25px var(--ref-shadow-hover);
  transform: translateY(-2px);
}

/* ============================================
   Modern Button
   ============================================ */
.modern-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  background: linear-gradient(
    135deg,
    var(--ref-primary) 0%,
    var(--ref-primary-dark) 100%
  );
  border: none;
  border-radius: 8px;
  color: var(--ref-white);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(26, 115, 232, 0.3);
}

.modern-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(26, 115, 232, 0.4);
  color: var(--ref-white);
}

/* ============================================
   Info Box
   ============================================ */
.info-box {
  background: var(--ref-primary-light);
  border-left: 4px solid var(--ref-primary);
  border-radius: 0 8px 8px 0;
  padding: 16px 20px;
  margin: 15px 0;
}

.info-box h4 {
  color: var(--ref-primary);
  margin: 0 0 8px 0;
  font-size: 15px;
}

.info-box p {
  margin: 0;
  font-size: 13px;
  color: var(--ref-text);
}

/* ============================================
   Utility Classes
   ============================================ */
.text-primary {
  color: var(--ref-primary);
}
.text-success {
  color: var(--ref-success);
}
.text-light {
  color: var(--ref-text-light);
}
.bg-light {
  background: var(--ref-primary-light);
}
.border-primary {
  border-color: var(--ref-primary);
}

.mt-10 {
  margin-top: 10px;
}
.mb-10 {
  margin-bottom: 10px;
}
.p-10 {
  padding: 10px;
}

/* Clear float */
.clearfix::after {
  content: " ";
  display: block;
  clear: both;
}

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

  .sidebar-left {
    width: 100%;
  }

  .nav-menu > li > a {
    padding: 0 15px;
    font-size: 14px;
  }
}
