/* 基础重置和变量 */
:root {
    --primary-color: #3B82F6;
    --text-primary: #1F2937;
    --text-secondary: #4B5563;
    --text-muted: #9CA3AF;
    --bg-primary: #FFFFFF;
    --bg-secondary: #F9FAFB;
    --bg-tertiary: #F3F4F6;
    --border-color: #E5E7EB;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --border-radius: 12px;
    --transition: all 0.2s ease-in-out;
    --glass-bg: rgba(255, 255, 255, 0.6);
    --glass-border: rgba(255, 255, 255, 0.3);

    /* Agent-specific colors */
    --novice-teacher-color: #34D399; /* Green */
    --senior-teacher-color: #FBBF24; /* Amber */
    --researcher-color: #A78BFA; /* Violet */
    --highlight-color: #34D399;
    --improvement-color: #F59E0B;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
    line-height: 1.7;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    min-height: 100vh;
    overflow-x: hidden;
    font-size: 16px;
}

/* Background Decoration */
.bg-decoration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
    opacity: 0.5;
}

/* Glassmorphism Effect */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-md);
}

/* Navbar */
.navbar {
    position: sticky;
    top: 0;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    transition: var(--transition);
}

.nav-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.nav-links {
    display: flex;
    gap: 1rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
    color: var(--primary-color);
    background-color: rgba(59, 130, 246, 0.1);
}

/* Main Container */
.main-container {
    padding: 2rem 1rem;
    max-width: 1280px;
    margin: 0 auto;
}

/* Hero Section */
.hero-section {
    text-align: center;
    padding: 1.5rem 0; /* MODIFIED: Reduced vertical padding */
    margin-bottom: 1.5rem; /* MODIFIED: Reduced bottom margin */
}

.hero-title {
    font-size: 2.75rem;
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.2;
}
.gradient-text {
    background: linear-gradient(90deg, var(--primary-color), #9333ea);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}
.hero-features {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.feature-tag {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    background: var(--bg-primary);
    border-radius: 999px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 14px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

/* Input Section */
.input-section {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    padding: 1.5rem; /* MODIFIED: Reduced padding */
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem; /* MODIFIED: Reduced bottom margin */
    border: 1px solid var(--border-color);
}

.section-header {
    text-align: center;
    margin-bottom: 2rem; /* MODIFIED: Reduced bottom margin */
}
.section-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}
.section-header p {
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

.input-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem; /* MODIFIED: Reduced gap */
    margin-bottom: 2rem; /* MODIFIED: Reduced bottom margin */
}

.input-card {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}
.input-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

/* FIXED: Increased specificity for input card elements to avoid style collision */
.input-card .card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0;
    border: none;
    background: none;
}
.input-card .card-icon {
    width: 48px;
    height: 48px;
    background-color: var(--bg-primary);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 1.5rem;
    border: 1px solid var(--border-color);
    box-shadow: none;
}
.input-card .card-title h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}
.input-card .card-title p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

textarea {
    width: 100%;
    min-height: 150px; /* MODIFIED: Slightly reduced height */
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    transition: var(--transition);
    background-color: var(--bg-primary);
}
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}
.char-count {
    text-align: right;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* Upload Area */
.upload-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    height: 100%;
    background-color: var(--bg-primary);
}
.upload-area:hover, .upload-area.dragover {
    border-color: var(--primary-color);
    background-color: rgba(59, 130, 246, 0.05);
}
.upload-icon {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
}
.upload-text {
    color: var(--text-secondary);
    font-weight: 500;
}
.file-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background-color: var(--bg-tertiary);
    border-radius: var(--border-radius);
    width: 100%;
    border: 1px solid var(--border-color);
}
.file-info i { color: var(--primary-color); font-size: 1.25rem; }
.file-info span { flex-grow: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.remove-file-btn {
    background: transparent;
    border: none;
    font-size: 1.25rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}
.remove-file-btn:hover { color: var(--text-primary); }

/* Submit Area */
.submit-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
}
.submit-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 999px;
    padding: 1rem 2.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
    margin-bottom: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.submit-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background-color: #2563EB;
}
.submit-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.btn-content, .loading-spinner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
}
.submit-tip {
    color: var(--text-muted);
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--bg-tertiary);
    padding: 0.5rem 1rem;
    border-radius: 999px;
    margin-top: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- MODERN CARD LAYOUT STYLES (for Report Section) --- */
.report-container {
    margin-top: 2rem;
    animation: fadeIn 0.6s ease-out;
}

/* 核心卡片网格布局 */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

/* 全宽卡片布局 */
.full-width-cards {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* 现代化卡片样式 */
.card {
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    position: relative;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), #9333ea);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.card:hover::before {
    opacity: 1;
}

/* 卡片头部样式 (FIXED: Increased specificity) */
.card .card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem 1.5rem 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
}

.card .card-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-color), #3b82f6);
    color: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    flex-shrink: 0; /* Prevents icon from shrinking */
}

.card .card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

/* 卡片内容样式 */
.card-content {
    padding: 1.5rem;
}

/* 图表容器特殊样式 */
.chart-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

#myRadarChart {
    max-width: 100%;
    max-height: 350px;
}

/* Footer */
.footer {
    background-color: var(--bg-tertiary);
    color: var(--text-muted);
    text-align: center;
    padding: 2rem;
    margin-top: 2rem; /* MODIFIED: Reduced top margin */
    font-size: 0.875rem;
    border-top: 1px solid var(--border-color);
}

/* Utility & Animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .input-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .main-container {
    margin: 0 auto;
    padding: 0.75rem;
  }
    .hero-title { font-size: 2rem; }
    .input-section { padding: 1.5rem; }
    .cards-grid { grid-template-columns: 1fr; }
    #summary-card, #radar-chart-card { grid-column: 1 / -1; }
    .nav-links { display: none; }
}
/* 模型切换 */
.model-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .75rem;
    margin: -0.5rem 0 1rem; /* 贴近输入区，整体更紧凑 */
}

.model-label {
    color: var(--text-secondary);
    font-weight: 600;
    white-space: nowrap;
}

.model-segment {
    display: inline-flex;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 4px;
    box-shadow: var(--shadow-sm);
}

.model-segment .seg-option {
    appearance: none;
    background: transparent;
    border: 0;
    padding: .45rem .9rem;
    border-radius: 999px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.model-segment .seg-option:hover {
    background: rgba(59,130,246,.06);
    color: var(--text-primary);
}

.model-segment .seg-option.active {
    background: var(--primary-color);
    color: #fff;
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

/* 小屏优化 */
@media (max-width: 768px) {
    .model-row {
        justify-content: center;
        flex-wrap: wrap;
    }
}
/* ========== Mobile enhancements (append at end) ========== */

/* 通用可读性与断行 */
img, video { max-width: 100%; height: auto; }
p, .card-content, .hero-subtitle, .upload-text, .file-info span { word-break: break-word; }

/* 触控设备减少悬停动画抖动与性能消耗 */
@media (hover: none) {
  .card { box-shadow: var(--shadow-md); }
  .card:hover { transform: none; box-shadow: var(--shadow-md); }
}

/* iOS 刘海/安全区适配 */
.navbar { padding-top: env(safe-area-inset-top); }
.footer { padding-bottom: calc(2rem + env(safe-area-inset-bottom)); }

/* 细化 768↓ 的规则（在你已有的 768 媒体查询基础上再收紧） */
@media (max-width: 768px) {
  html, body { overscroll-behavior-y: none; }
  body { font-size: 16px; } /* 保持易读，不降字号 */

  .nav-container {
    padding: 0 .75rem;
    height: 56px;
  }

  .main-container { padding: .75rem; }

  .hero-section { padding: 1rem 0; margin-bottom: 1rem; }
  .hero-title { font-size: 1.75rem; line-height: 1.25; margin-bottom: .5rem; }
  .hero-subtitle { font-size: 1rem; margin-bottom: 1rem; padding: 0 .5rem; }

  /* 横向滚动标签，避免换行挤压 */
  .hero-features {
    justify-content: flex-start;
    gap: .5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    padding: 0 .5rem;
  }
  .feature-tag {
    font-size: .8125rem;
    padding: .375rem .75rem;
    scroll-snap-align: start;
    white-space: nowrap;
  }

  .input-section { padding: 1rem; margin-bottom: 1rem; }
  .input-card { padding: 1rem; }
  .input-grid { gap: 1rem; margin-bottom: 1rem; }

  textarea { min-height: 120px; padding: .75rem; }

  .upload-area { padding: 1rem; }
  .file-info {
    flex-direction: column;
    align-items: flex-start;
    gap: .5rem;
  }

  /* 提交区与按钮可点区域更大，单手友好 */
  .submit-area { gap: .5rem; width: 100%; }
  .submit-button {
    width: 100%;
    padding: .9rem 1rem;
    border-radius: 12px;
  }
  .submit-tip {
    width: 100%;
    justify-content: center;
  }

  /* 报告卡片更紧凑，减少滚动 */
  .cards-grid { grid-template-columns: 1fr; gap: 1rem; margin-bottom: 1rem; }
  .card .card-header { padding: 1rem 1rem .75rem; }
  .card-content { padding: 1rem; }

  /* 图表容器小屏高度收敛，避免首屏过高 */
  .chart-container { min-height: 220px; }
  #myRadarChart { max-height: 240px; }

  /* 模型切换区域在小屏更易点按 */
  .model-row { gap: .5rem; margin: 0 0 1rem; }
  .model-segment { padding: 3px; }
  .model-segment .seg-option {
    padding: .4rem .75rem;
    font-size: .9rem;
  }

  .footer {
    padding: 1.25rem;
    font-size: .75rem;
    margin-top: 1.25rem;
  }

  /* 背景装饰降低透明度，兼顾性能与对比度 */
  .bg-decoration { opacity: .35; }
}

/* 极小屏（≤360px）兜底：进一步压缩内边距与字号 */
@media (max-width: 360px) {
  .hero-title { font-size: 1.6rem; }
  .hero-subtitle { font-size: .9375rem; }
  .feature-tag { font-size: .75rem; }
  .input-section, .input-card, .card-content { padding: .75rem; }
}

/* 深色模式可选：若页面支持切换，可在此覆写变量
@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary:#0b0f14; --bg-secondary:#0e141b; --bg-tertiary:#101922;
    --text-primary:#e6edf3; --text-secondary:#9fb1c1; --text-muted:#6b7d8f;
    --border-color:#1f2a36;
  }
}
*/
