/* ============================================================
   智学伴 - 全局样式 (参考 Moodle SCNU 风格)
   所有CSS本地化，不使用任何CDN
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: #333; background: #f0f2f5; line-height: 1.6; min-height: 100vh;
}
a { color: #1a6fb5; text-decoration: none; transition: color .2s; }
a:hover { color: #0d4f82; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
table { border-collapse: collapse; width: 100%; }
.clearfix::after { content: ""; display: table; clear: both; }
.text-center { text-align: center; }
.text-muted { color: #888; }
.hidden { display: none !important; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* HEADER */
.site-header {
  background: linear-gradient(135deg, #1a3a5c 0%, #1a6fb5 100%);
  color: #fff; position: sticky; top: 0; z-index: 1000;
  box-shadow: 0 2px 12px rgba(0,0,0,.15);
}
.header-top {
  max-width: 1200px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between; height: 64px;
}
.header-logo {
  display: flex; align-items: center; gap: 8px;
  font-size: 22px; font-weight: 700; color: #fff; text-decoration: none; white-space: nowrap;
}
.header-logo:hover { color: #fff; opacity: .9; }
.logo-icon { font-size: 28px; }
.admin-badge { font-size: 11px; background: rgba(255,255,255,.2); padding: 2px 8px; border-radius: 10px; margin-left: 8px; font-weight: 400; }
.header-nav { display: flex; gap: 4px; }
.header-nav a { color: rgba(255,255,255,.8); padding: 8px 16px; border-radius: 6px; font-size: 15px; transition: all .2s; white-space: nowrap; }
.header-nav a:hover, .header-nav a.active { color: #fff; background: rgba(255,255,255,.15); }
.header-user { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.user-avatar { width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.2); display: flex; align-items: center; justify-content: center; font-size: 18px; }
.user-name { font-size: 14px; }
.btn-logout { background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.3); color: #fff; padding: 4px 12px; border-radius: 4px; cursor: pointer; font-size: 13px; transition: all .2s; }
.btn-logout:hover { background: rgba(255,255,255,.25); }
.mobile-menu-btn { display: none; background: none; border: none; color: #fff; font-size: 24px; cursor: pointer; padding: 4px 8px; }

/* MOBILE NAV */
.mobile-nav-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.5); z-index: 2000; }
.mobile-nav-overlay.active { display: block; }
.mobile-nav-panel { position: fixed; top: 0; right: -280px; width: 280px; height: 100%; background: #fff; z-index: 2001; transition: right .3s ease; overflow-y: auto; }
.mobile-nav-panel.active { right: 0; }
.mobile-nav-header { padding: 20px; background: linear-gradient(135deg, #1a3a5c, #1a6fb5); color: #fff; display: flex; align-items: center; gap: 12px; }
.mobile-nav-header .user-avatar { width: 48px; height: 48px; font-size: 24px; background: rgba(255,255,255,.2); }
.mobile-nav-header .user-name { font-size: 16px; font-weight: 600; }
.mobile-nav-header .user-role { font-size: 12px; opacity: .8; }
.mobile-nav-close { margin-left: auto; background: none; border: none; color: #fff; font-size: 24px; cursor: pointer; }
.mobile-nav-links { padding: 12px 0; }
.mobile-nav-links a { display: flex; align-items: center; gap: 12px; padding: 14px 20px; color: #333; font-size: 15px; transition: background .2s; }
.mobile-nav-links a:hover { background: #f5f5f5; }
.mobile-nav-links a.active { color: #1a6fb5; background: #f0f7ff; font-weight: 600; }
.mobile-nav-links .nav-icon { font-size: 18px; width: 24px; text-align: center; }

/* BUTTONS */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 24px; border-radius: 6px; font-size: 14px; font-weight: 500; cursor: pointer; border: none; transition: all .2s; text-decoration: none; line-height: 1.5; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 14px 32px; font-size: 16px; }
.btn-primary { background: #1a6fb5; color: #fff; }
.btn-primary:hover { background: #155d99; color: #fff; }
.btn-success { background: #27ae60; color: #fff; }
.btn-success:hover { background: #219a52; color: #fff; }
.btn-warning { background: #f39c12; color: #fff; }
.btn-warning:hover { background: #d68910; color: #fff; }
.btn-danger { background: #e74c3c; color: #fff; }
.btn-danger:hover { background: #c0392b; color: #fff; }
.btn-ghost { background: transparent; color: #1a6fb5; border: 1px solid #1a6fb5; }
.btn-ghost:hover { background: #f0f7ff; }
.btn-white { background: #fff; color: #1a3a5c; border: 1px solid #ddd; }
.btn-white:hover { background: #f5f5f5; }
.btn-block { display: flex; width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* FORMS */
.form-group { margin-bottom: 16px; }
.form-label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 500; color: #555; }
.form-input, .form-select, .form-textarea { width: 100%; padding: 10px 14px; border: 1px solid #d0d5dd; border-radius: 6px; font-size: 14px; color: #333; background: #fff; transition: border-color .2s, box-shadow .2s; outline: none; }
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: #1a6fb5; box-shadow: 0 0 0 3px rgba(26,111,181,.1); }
.form-textarea { resize: vertical; min-height: 100px; }
.form-hint { font-size: 12px; color: #999; margin-top: 4px; }
.form-row { display: flex; gap: 16px; }
.form-row .form-group { flex: 1; }

/* CARDS */
.card { background: #fff; border-radius: 10px; box-shadow: 0 1px 4px rgba(0,0,0,.06); overflow: hidden; transition: box-shadow .2s, transform .2s; }
.card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.1); }
.card-header { padding: 16px 20px; border-bottom: 1px solid #f0f0f0; font-size: 16px; font-weight: 600; color: #333; display: flex; align-items: center; justify-content: space-between; }
.card-body { padding: 20px; }
.card-footer { padding: 12px 20px; border-top: 1px solid #f0f0f0; display: flex; align-items: center; justify-content: space-between; }

/* HERO CAROUSEL */
.hero-carousel { position: relative; width: 100%; overflow: hidden; background: linear-gradient(135deg, #1a3a5c 0%, #1a6fb5 50%, #2980b9 100%); min-height: 420px; }
.carousel-slides { display: flex; transition: transform .5s ease; height: 100%; }
.carousel-slide { min-width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; position: relative; padding: 60px 20px; }
.carousel-slide-bg { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background-size: cover; background-position: center; opacity: .3; }
.carousel-slide-content { position: relative; z-index: 1; text-align: center; color: #fff; max-width: 700px; }
.carousel-slide-content h1 { font-size: 42px; font-weight: 700; margin-bottom: 16px; text-shadow: 0 2px 8px rgba(0,0,0,.2); }
.carousel-slide-content p { font-size: 18px; opacity: .9; margin-bottom: 28px; line-height: 1.8; }
.carousel-dots { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; z-index: 2; }
.carousel-dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.4); cursor: pointer; transition: all .3s; border: none; }
.carousel-dot.active { background: #fff; width: 28px; border-radius: 5px; }
.carousel-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.2); border: none; color: #fff; font-size: 20px; cursor: pointer; z-index: 2; display: flex; align-items: center; justify-content: center; transition: background .2s; backdrop-filter: blur(4px); }
.carousel-arrow:hover { background: rgba(255,255,255,.35); }
.carousel-arrow.prev { left: 20px; }
.carousel-arrow.next { right: 20px; }

/* SECTION TITLES */
.section-title { text-align: center; margin-bottom: 40px; }
.section-title h2 { font-size: 28px; font-weight: 700; color: #1a3a5c; margin-bottom: 8px; }
.section-title p { font-size: 15px; color: #888; }
.section-title .title-line { width: 50px; height: 3px; background: #1a6fb5; margin: 12px auto 0; border-radius: 2px; }

/* FEATURES */
.features-section { padding: 80px 0; background: #fff; }
.features-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.feature-card { text-align: center; padding: 32px 20px; border-radius: 12px; background: #f8fafc; border: 1px solid #eef2f7; transition: all .3s; }
.feature-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,.08); border-color: #1a6fb5; }
.feature-icon { width: 64px; height: 64px; border-radius: 16px; background: linear-gradient(135deg, #e8f4fd, #d1ecf9); display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; font-size: 28px; }
.feature-card h3 { font-size: 17px; color: #1a3a5c; margin-bottom: 8px; }
.feature-card p { font-size: 13px; color: #888; line-height: 1.7; }

/* SUBJECTS */
.subjects-section { padding: 80px 0; background: #f8fafc; }
.subjects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.subject-tag { display: flex; align-items: center; gap: 10px; padding: 14px 18px; background: #fff; border-radius: 10px; border: 1px solid #eef2f7; cursor: pointer; transition: all .2s; }
.subject-tag:hover { border-color: #1a6fb5; background: #f0f7ff; }
.subject-tag .tag-icon { font-size: 22px; }
.subject-tag .tag-name { font-size: 14px; font-weight: 500; color: #333; }

/* RESOURCES */
.resources-section { padding: 80px 0; background: #fff; }
.resources-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.resource-card { background: #fff; border-radius: 10px; overflow: hidden; border: 1px solid #eef2f7; transition: all .3s; }
.resource-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,.1); }
.resource-card-img { height: 160px; background: linear-gradient(135deg, #e8f4fd, #d1ecf9); display: flex; align-items: center; justify-content: center; font-size: 48px; position: relative; overflow: hidden; }
.resource-card-img img { width: 100%; height: 100%; object-fit: cover; }
.resource-card-body { padding: 16px; }
.resource-card-body h3 { font-size: 15px; color: #333; margin-bottom: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.resource-card-body p { font-size: 13px; color: #999; margin-bottom: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.resource-card-footer { padding: 12px 16px; border-top: 1px solid #f0f0f0; display: flex; align-items: center; justify-content: space-between; }
.card-price { font-size: 20px; font-weight: 700; color: #e74c3c; }
.card-price .unit { font-size: 14px; }
.card-price-original { font-size: 13px; color: #ccc; text-decoration: line-through; margin-left: 6px; }
.card-tag { font-size: 11px; padding: 2px 8px; border-radius: 10px; background: #f0f7ff; color: #1a6fb5; }
.card-tag.tag-free { background: #e8f8ef; color: #27ae60; }
.card-tag.tag-hot { background: #fef3e8; color: #f39c12; }

/* STATS */
.stats-section { padding: 60px 0; background: linear-gradient(135deg, #1a3a5c, #1a6fb5); color: #fff; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.stat-item { text-align: center; }
.stat-number { font-size: 36px; font-weight: 700; margin-bottom: 4px; }
.stat-label { font-size: 14px; opacity: .8; }

/* ABOUT */
.about-section { padding: 80px 0; background: #f8fafc; }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.about-text h2 { font-size: 28px; color: #1a3a5c; margin-bottom: 16px; }
.about-text p { font-size: 15px; color: #666; line-height: 1.8; margin-bottom: 16px; }
.about-image { border-radius: 12px; overflow: hidden; background: linear-gradient(135deg, #e8f4fd, #d1ecf9); height: 300px; display: flex; align-items: center; justify-content: center; font-size: 80px; }

/* FOOTER */
.site-footer { background: #1a2332; color: rgba(255,255,255,.7); padding: 40px 0 20px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; margin-bottom: 32px; }
.footer-brand h3 { color: #fff; font-size: 18px; margin-bottom: 12px; }
.footer-brand p { font-size: 13px; line-height: 1.8; }
.footer-links h4 { color: #fff; font-size: 15px; margin-bottom: 12px; }
.footer-links a { display: block; font-size: 13px; color: rgba(255,255,255,.6); padding: 4px 0; transition: color .2s; }
.footer-links a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding-top: 20px; text-align: center; font-size: 13px; }

/* AUTH MODAL */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.5); z-index: 3000; align-items: center; justify-content: center; }
.modal-overlay.active { display: flex; }
.modal { background: #fff; border-radius: 12px; width: 420px; max-width: 90vw; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.2); animation: modalIn .3s ease; }
@keyframes modalIn { from { opacity: 0; transform: scale(.95) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal-header { padding: 20px 24px; border-bottom: 1px solid #f0f0f0; display: flex; align-items: center; justify-content: space-between; }
.modal-header h3 { font-size: 18px; color: #333; }
.modal-close { background: none; border: none; font-size: 20px; color: #999; cursor: pointer; padding: 4px; }
.modal-close:hover { color: #333; }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid #f0f0f0; text-align: center; font-size: 13px; color: #888; }
.modal-footer a { color: #1a6fb5; cursor: pointer; }
.auth-tabs { display: flex; border-bottom: 2px solid #f0f0f0; margin-bottom: 24px; }
.auth-tab { flex: 1; padding: 12px; text-align: center; font-size: 15px; color: #999; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all .2s; background: none; border-top: none; border-left: none; border-right: none; }
.auth-tab.active { color: #1a6fb5; border-bottom-color: #1a6fb5; font-weight: 600; }

/* DASHBOARD */
.dashboard { padding: 24px 0; min-height: calc(100vh - 64px); }
.dashboard-header { margin-bottom: 24px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.dashboard-header h1 { font-size: 24px; color: #1a3a5c; }
.dashboard-welcome { background: linear-gradient(135deg, #1a3a5c, #1a6fb5); color: #fff; border-radius: 12px; padding: 24px 28px; margin-bottom: 24px; }
.dashboard-welcome h2 { font-size: 20px; margin-bottom: 4px; }
.dashboard-welcome p { opacity: .85; font-size: 14px; }
.stats-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { background: #fff; border-radius: 10px; padding: 20px; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.stat-card .stat-label { font-size: 13px; color: #888; margin-bottom: 8px; }
.stat-card .stat-value { font-size: 28px; font-weight: 700; color: #1a3a5c; }
.stat-card .stat-sub { font-size: 12px; color: #999; margin-top: 4px; }

/* CHAT */
.chat-container { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.06); display: flex; flex-direction: column; height: 500px; }
.chat-header { padding: 16px 20px; background: linear-gradient(135deg, #1a3a5c, #1a6fb5); color: #fff; display: flex; align-items: center; gap: 12px; }
.chat-header .chat-avatar { width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.2); display: flex; align-items: center; justify-content: center; font-size: 20px; }
.chat-header .chat-info h3 { font-size: 15px; }
.chat-header .chat-info p { font-size: 12px; opacity: .8; }
.chat-messages { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.chat-msg { display: flex; gap: 10px; max-width: 80%; animation: msgIn .3s ease; }
@keyframes msgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.chat-msg.user { align-self: flex-end; flex-direction: row-reverse; }
.chat-msg .msg-avatar { width: 32px; height: 32px; border-radius: 50%; background: #e8f4fd; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.chat-msg.user .msg-avatar { background: #1a6fb5; color: #fff; }
.chat-msg .msg-bubble { padding: 10px 14px; border-radius: 12px; font-size: 14px; line-height: 1.6; word-break: break-word; }
.chat-msg.assistant .msg-bubble { background: #f0f2f5; color: #333; border-top-left-radius: 4px; }
.chat-msg.user .msg-bubble { background: #1a6fb5; color: #fff; border-top-right-radius: 4px; }
.chat-input-area { padding: 16px 20px; border-top: 1px solid #f0f0f0; display: flex; gap: 10px; align-items: flex-end; }
.chat-input-area textarea { flex: 1; padding: 10px 14px; border: 1px solid #d0d5dd; border-radius: 8px; resize: none; font-size: 14px; outline: none; min-height: 42px; max-height: 120px; transition: border-color .2s; }
.chat-input-area textarea:focus { border-color: #1a6fb5; }
.chat-send-btn { width: 42px; height: 42px; border-radius: 8px; background: #1a6fb5; color: #fff; border: none; cursor: pointer; font-size: 18px; display: flex; align-items: center; justify-content: center; transition: background .2s; flex-shrink: 0; }
.chat-send-btn:hover { background: #155d99; }
.chat-send-btn:disabled { opacity: .5; cursor: not-allowed; }

/* WRONG QUESTION */
.wrong-q-upload { background: #fff; border-radius: 12px; padding: 32px; text-align: center; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.wrong-q-upload .upload-icon { font-size: 48px; margin-bottom: 12px; }
.wrong-q-upload h3 { font-size: 18px; color: #333; margin-bottom: 8px; }
.wrong-q-upload p { font-size: 14px; color: #888; margin-bottom: 20px; }
.wrong-q-result { background: #fff; border-radius: 12px; padding: 24px; box-shadow: 0 1px 4px rgba(0,0,0,.06); margin-top: 20px; }
.wrong-q-result h3 { font-size: 16px; color: #1a3a5c; margin-bottom: 12px; }
.wrong-q-result .analysis-content { font-size: 14px; line-height: 1.8; color: #555; }

/* CAREER */
.career-form { background: #fff; border-radius: 12px; padding: 24px; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.career-result { background: #fff; border-radius: 12px; padding: 24px; box-shadow: 0 1px 4px rgba(0,0,0,.06); margin-top: 20px; }

/* ADMIN */
.admin-layout { display: flex; min-height: calc(100vh - 64px); }
.admin-sidebar { width: 240px; background: #fff; border-right: 1px solid #eef2f7; padding: 16px 0; flex-shrink: 0; }
.admin-sidebar-item { display: flex; align-items: center; gap: 10px; padding: 12px 20px; color: #555; cursor: pointer; transition: all .2s; font-size: 14px; border: none; background: none; width: 100%; text-align: left; }
.admin-sidebar-item:hover { background: #f5f7fa; color: #333; }
.admin-sidebar-item.active { background: #f0f7ff; color: #1a6fb5; font-weight: 600; border-right: 3px solid #1a6fb5; }
.admin-sidebar-item .sidebar-icon { font-size: 18px; width: 24px; text-align: center; }
.admin-content { flex: 1; padding: 24px; overflow-y: auto; background: #f0f2f5; }
.admin-panel { display: none; }
.admin-panel.active { display: block; }

/* DATA TABLE */
.data-table-wrapper { background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { padding: 12px 16px; text-align: left; font-size: 13px; font-weight: 600; color: #888; background: #fafbfc; border-bottom: 1px solid #f0f0f0; white-space: nowrap; }
.data-table td { padding: 12px 16px; font-size: 14px; color: #333; border-bottom: 1px solid #f5f5f5; }
.data-table tr:hover td { background: #fafbfc; }
.data-table .actions { display: flex; gap: 6px; }
.status-badge { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: 12px; font-weight: 500; }
.status-success { background: #e8f8ef; color: #27ae60; }
.status-pending { background: #fef3e8; color: #f39c12; }
.status-failed { background: #fde8e8; color: #e74c3c; }
.status-active { background: #e8f8ef; color: #27ae60; }
.status-inactive { background: #f5f5f5; color: #999; }

/* PAYMENT MODAL */
.payment-modal .modal { width: 480px; }
.payment-amount { text-align: center; padding: 20px 0; border-bottom: 1px solid #f0f0f0; }
.payment-amount .amount-label { font-size: 14px; color: #888; }
.payment-amount .amount-value { font-size: 36px; font-weight: 700; color: #e74c3c; margin-top: 4px; }
.payment-amount .amount-value .unit { font-size: 18px; }
.payment-methods { padding: 20px 0; display: flex; gap: 12px; justify-content: center; }
.payment-method { display: flex; align-items: center; gap: 8px; padding: 10px 20px; border: 2px solid #eef2f7; border-radius: 8px; cursor: pointer; transition: all .2s; font-size: 14px; }
.payment-method:hover { border-color: #1a6fb5; }
.payment-method.selected { border-color: #1a6fb5; background: #f0f7ff; }
.payment-method .method-icon { font-size: 20px; }
.payment-qrcode { text-align: center; padding: 20px; }
.payment-qrcode img { width: 200px; height: 200px; margin: 0 auto 12px; border: 1px solid #eee; border-radius: 8px; }
.payment-qrcode p { font-size: 13px; color: #888; }
.payment-status { text-align: center; padding: 20px; }
.payment-status .spinner { width: 32px; height: 32px; border: 3px solid #eef2f7; border-top-color: #1a6fb5; border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 12px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* TOAST */
.toast-container { position: fixed; top: 80px; right: 20px; z-index: 5000; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 12px 20px; border-radius: 8px; font-size: 14px; color: #fff; box-shadow: 0 4px 12px rgba(0,0,0,.15); animation: toastIn .3s ease; min-width: 200px; display: flex; align-items: center; gap: 8px; }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
.toast-success { background: #27ae60; }
.toast-error { background: #e74c3c; }
.toast-warning { background: #f39c12; }
.toast-info { background: #1a6fb5; }

/* LOADING */
.loading-spinner { display: flex; align-items: center; justify-content: center; padding: 40px; }
.spinner { width: 36px; height: 36px; border: 3px solid #eef2f7; border-top-color: #1a6fb5; border-radius: 50%; animation: spin 1s linear infinite; }

/* TABS */
.tabs { display: flex; border-bottom: 2px solid #f0f0f0; margin-bottom: 20px; overflow-x: auto; }
.tab { padding: 10px 20px; font-size: 14px; color: #888; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all .2s; white-space: nowrap; background: none; border-top: none; border-left: none; border-right: none; }
.tab:hover { color: #333; }
.tab.active { color: #1a6fb5; border-bottom-color: #1a6fb5; font-weight: 600; }

/* BINDINGS */
.bindings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.binding-card { background: #fff; border-radius: 10px; padding: 20px; box-shadow: 0 1px 4px rgba(0,0,0,.06); display: flex; align-items: center; gap: 16px; }
.binding-card .bind-avatar { width: 48px; height: 48px; border-radius: 50%; background: #e8f4fd; display: flex; align-items: center; justify-content: center; font-size: 24px; }
.binding-card .bind-info h3 { font-size: 15px; color: #333; }
.binding-card .bind-info p { font-size: 13px; color: #888; }

/* EMPTY STATE */
.empty-state { text-align: center; padding: 60px 20px; color: #aaa; }
.empty-state .empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state h3 { font-size: 18px; color: #888; margin-bottom: 8px; }
.empty-state p { font-size: 14px; }

/* UPLOAD */
.upload-area { border: 2px dashed #d0d0d0; border-radius: 10px; padding: 32px; text-align: center; cursor: pointer; transition: all .2s; background: #fafbfc; }
.upload-area:hover { border-color: #1a6fb5; background: #f0f7ff; }
.upload-area .upload-icon { font-size: 36px; color: #aaa; margin-bottom: 8px; }
.upload-area p { font-size: 14px; color: #888; }
.upload-preview { width: 100%; max-height: 200px; object-fit: cover; border-radius: 8px; margin-top: 12px; }

/* SCROLLBAR */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #aaa; }

/* RESPONSIVE TABLET */
@media (max-width: 1024px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-cards { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: 1fr; }
  .admin-sidebar { width: 200px; }
}

/* RESPONSIVE MOBILE */
@media (max-width: 768px) {
  .header-nav, .header-user { display: none; }
  .mobile-menu-btn { display: block; }
  .header-top { height: 56px; }
  .header-logo { font-size: 18px; }
  .hero-carousel { min-height: 300px; }
  .carousel-slide { padding: 40px 16px; }
  .carousel-slide-content h1 { font-size: 24px; }
  .carousel-slide-content p { font-size: 14px; }
  .carousel-arrow { display: none; }
  .features-grid { grid-template-columns: 1fr; }
  .subjects-grid { grid-template-columns: repeat(2, 1fr); }
  .resources-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-cards { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr; }
  .section-title h2 { font-size: 22px; }
  .section-title { margin-bottom: 24px; }
  .features-section, .subjects-section, .resources-section, .about-section { padding: 48px 0; }
  .dashboard { padding: 16px 0; }
  .dashboard-header h1 { font-size: 20px; }
  .dashboard-welcome { padding: 16px 20px; }
  .dashboard-welcome h2 { font-size: 17px; }
  .chat-container { height: 400px; }
  .chat-msg { max-width: 90%; }
  .admin-layout { flex-direction: column; }
  .admin-sidebar { width: 100%; border-right: none; border-bottom: 1px solid #eef2f7; padding: 8px 0; display: flex; overflow-x: auto; }
  .admin-sidebar-item { padding: 10px 14px; white-space: nowrap; font-size: 13px; border-right: none !important; border-bottom: 2px solid transparent; }
  .admin-sidebar-item.active { border-bottom-color: #1a6fb5; border-right: none !important; }
  .admin-content { padding: 16px; }
  .data-table-wrapper { overflow-x: auto; }
  .data-table th, .data-table td { padding: 10px 12px; font-size: 13px; }
  .modal { width: 95vw; max-height: 85vh; }
  .payment-modal .modal { width: 95vw; }
  .form-row { flex-direction: column; gap: 0; }
  .stat-number { font-size: 28px; }
}
@media (max-width: 480px) {
  .subjects-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stats-cards { grid-template-columns: 1fr 1fr; }
  .bindings-grid { grid-template-columns: 1fr; }
  .container { padding: 0 12px; }
}
