/* =========================================
   Amonic AI - Ethereal Tech Theme (清透科技版)
   ========================================= */
:root {
  /* 1. 色彩系统 */
  --bg-base: #f8fafc;
  
  /* 智性蓝紫渐变 (更鲜亮一点) */
  --accent-primary: #6366f1; /* Indigo */
  --accent-secondary: #8b5cf6; /* Violet */
  --accent-cyan: #06b6d4; /* Cyan (增加一点科技蓝) */
  
  --accent-glow: rgba(99, 102, 241, 0.15);
  --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #06b6d4 100%);
  
  /* 玻璃卡片 */
  --card-bg: rgba(255, 255, 255, 0.75);
  --card-border: 1px solid rgba(255, 255, 255, 0.8);
  /* 增加一点彩色的漫反射阴影 */
  --glass-shadow: 
    0 20px 40px -10px rgba(99, 102, 241, 0.1), 
    0 0 2px rgba(0,0,0,0.05),
    inset 0 0 0 1px rgba(255, 255, 255, 0.5);
  
  /* 文字 */
  --text-main: #0f172a;
  --text-sub: #64748b;
  --text-placeholder: #94a3b8;

  /* 圆角与间距 */
  --radius-card: 24px;
  --radius-input: 12px;
  --anim-speed: 0.4s cubic-bezier(0.25, 1, 0.5, 1); /* 更顺滑的贝塞尔曲线 */
}

* { box-sizing: border-box; outline: none; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-main);
  background-color: var(--bg-base);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 20px;
  position: relative;
  overflow-x: hidden;
}

/* =========================================
   特效 1：背景呼吸网格 & 极光
   ========================================= */
.aurora-bg {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  z-index: -1;
  overflow: hidden;
}

/* 极光层 */
.aurora-bg::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0, transparent 50%), 
    radial-gradient(at 100% 0%, rgba(6, 182, 212, 0.1) 0, transparent 50%), 
    radial-gradient(at 50% 50%, rgba(139, 92, 246, 0.1) 0, transparent 50%);
  animation: flow 15s ease-in-out infinite alternate;
}

/* 科技网格层 (Grid) */
.aurora-bg::after {
  content: '';
  position: absolute;
  width: 200%; height: 200%;
  top: -50%; left: -50%;
  background-image: 
    linear-gradient(rgba(99, 102, 241, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 102, 241, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  transform: perspective(500px) rotateX(60deg); /* 3D 透视效果 */
  animation: gridMove 20s linear infinite;
  mask-image: linear-gradient(to bottom, transparent, black 40%, black 90%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, transparent, black 40%, black 90%, transparent);
}

@keyframes flow {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-2%, -2%) scale(1.05); }
}
@keyframes gridMove {
  0% { transform: perspective(500px) rotateX(60deg) translateY(0); }
  100% { transform: perspective(500px) rotateX(60deg) translateY(60px); }
}

/* =========================================
   头部样式
   ========================================= */
.page-header {
  text-align: center;
  max-width: 800px;
  margin-bottom: 48px;
  animation: slideDown 0.8s var(--anim-speed);
  position: relative;
}

.brand-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  color: var(--accent-primary);
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(4px);
  padding: 6px 14px;
  border-radius: 20px;
  margin-bottom: 16px;
  letter-spacing: 2px;
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(255,255,255,0.5);
}

.page-header h1 {
  margin: 0 0 12px;
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: -1px;
  /* 文字流光特效 */
  background: linear-gradient(135deg, #1e293b 30%, #6366f1 70%, #06b6d4 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: textShine 5s linear infinite alternate;
}

@keyframes textShine {
  to { background-position: 200% center; }
}

.subtitle {
  color: var(--text-sub);
  font-size: 1rem;
}

/* =========================================
   特效 2：卡片流光玻璃
   ========================================= */
.card {
  width: 100%;
  max-width: 860px;
  background: var(--card-bg);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: var(--card-border);
  border-radius: var(--radius-card);
  box-shadow: var(--glass-shadow);
  padding: 48px;
  animation: slideUp 0.8s var(--anim-speed);
  position: relative;
  overflow: hidden; /* 必须加上，防止流光溢出 */
}

/* 卡片表面的流光扫过效果 */
.card::before {
  content: '';
  position: absolute;
  top: 0; left: -150%;
  width: 100%; height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  transform: skewX(-25deg);
  animation: sheen 6s infinite; /* 6秒扫一次 */
  pointer-events: none;
}

@keyframes sheen {
  0%, 80% { left: -150%; } /* 停顿时间长一点 */
  100% { left: 150%; }
}

/* =========================================
   布局系统
   ========================================= */
.section { margin-bottom: 48px; position: relative; }
.section:last-child { margin-bottom: 0; }

.section h2 {
  font-size: 1.1rem;
  color: var(--text-main);
  margin: 0 0 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  display: flex;
  align-items: center;
  gap: 10px;
}
/* 标题前面的小装饰点 */
.section h2::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--accent-primary);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent-primary);
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
@media (max-width: 768px) {
  .grid { grid-template-columns: 1fr; }
  .card { padding: 24px; }
}

.field { display: flex; flex-direction: column; gap: 8px; position: relative; }
.field.full { grid-column: 1 / -1; }

label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-sub);
  margin-left: 2px;
}
.req { color: #f43f5e; margin-left: 4px; }

/* =========================================
   特效 3：输入框能量条动效
   ========================================= */
input[type="text"],
input[type="url"],
input[type="number"],
textarea {
  width: 100%;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-input);
  font-size: 0.95rem;
  color: var(--text-main);
  font-family: inherit;
  transition: all var(--anim-speed);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.01);
}

input::placeholder, textarea::placeholder { color: var(--text-placeholder); opacity: 0.8; }

/* 聚焦：背景变白，阴影浮起 */
input:focus, textarea:focus {
  background: #fff;
  border-color: transparent; /* 隐藏原生边框，用阴影代替 */
  box-shadow: 
    0 4px 20px rgba(0,0,0,0.03),
    0 0 0 2px rgba(99, 102, 241, 0.1); /* 淡淡的紫色光环 */
  transform: translateY(-2px);
}

/* 使用伪元素做底部的“能量条” */
.field::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 0%; 
  height: 2px;
  background: var(--gradient-primary);
  transition: width 0.4s ease;
  border-radius: 0 0 4px 4px; /* 稍微带点圆角 */
  z-index: 2;
  left: 50%; /* 从中间向两边展开 */
  transform: translateX(-50%);
}
.field:focus-within::after {
  width: 100%; /* 聚焦时展开 */
}

textarea { resize: vertical; min-height: 120px; }
small { font-size: 0.75rem; color: var(--text-placeholder); }
.counter { text-align: right; font-size: 12px; color: var(--text-sub); margin-top: 4px; }

/* =========================================
   可折叠区域 (Details/Summary)
   ========================================= */
.example-details {
  margin-top: 16px;
}

.example-details summary {
  cursor: pointer;
  padding: 10px 16px;
  border-radius: var(--radius-input);
  background-color: rgba(241, 245, 249, 0.7);
  color: var(--text-sub);
  font-weight: 500;
  transition: background-color 0.3s ease;
  list-style: none; /* 隐藏默认箭头 */
  position: relative;
  padding-left: 36px;
}

.example-details summary:hover {
  background-color: rgba(226, 232, 240, 0.8);
}

/* 自定义箭头 */
.example-details summary::before {
  content: '＋';
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-weight: bold;
  color: var(--accent-primary);
}

.example-details[open] > summary::before {
  content: '－';
}

.example-details .example-box {
  margin-top: 12px;
  border-top: 1px solid #e2e8f0;
  padding-top: 16px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  background: rgba(255,255,255,0.6);
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-input);
  padding: 8px;
  min-height: 50px;
  transition: var(--anim-speed);
}
.chips:focus-within {
  background: #fff;
  box-shadow: 0 4px 20px rgba(0,0,0,0.03);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #e0e7ff, #ede9fe);
  color: var(--accent-primary);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 2px 5px rgba(99, 102, 241, 0.1);
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chip button {
  background: none; border: none;
  color: var(--accent-primary);
  cursor: pointer; padding: 0;
  font-size: 16px; opacity: 0.5;
  transition: 0.2s;
}
.chip button:hover { opacity: 1; transform: scale(1.2); }

.chips input {
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
  padding: 4px !important;
  min-width: 100px;
  flex: 1;
  transform: none !important; /* 防止input上浮动效 */
}

/* =========================================
   辅助与上传
   ========================================= */
.example-box {
  margin-top: 12px;
  padding: 20px;
  background: rgba(248, 250, 252, 0.8);
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  max-height: 300px;
  overflow-y: auto;
}
.example-box:hover { border-color: var(--accent-primary); background: #eff6ff; }

.example-box p { margin: 0 0 8px; font-size: 0.8rem; color: var(--text-sub); font-weight: 600; }
.example-box pre {
  white-space: pre-wrap;
  word-wrap: break-word;
  font-size: 0.85rem;
  line-height: 1.6;
  color: #475569;
}

/* =========================================
   数据列表页 (list.php)
   ========================================= */
.list-container {
    padding: 40px 20px;
}

.search-form {
    display: flex;
    gap: 16px;
    margin-bottom: 32px;
}

.search-form .search-input {
    flex-grow: 1;
}

.pager {
    text-align: center;
    margin-bottom: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
    color: var(--text-sub);
}
.pager a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}
.pager a:hover {
    background-color: rgba(99, 102, 241, 0.1);
}

.card-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 24px;
}

@media (min-width: 1200px) {
    .card-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .card-list {
        grid-template-columns: 1fr;
    }
}

.data-card {
    background: var(--card-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: var(--card-border);
    border-radius: var(--radius-card);
    box-shadow: var(--glass-shadow);
    padding: 24px 32px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: popIn 0.5s var(--anim-speed) backwards;
    display: flex;
    flex-direction: column;
}

.data-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 30px 50px -15px rgba(99, 102, 241, 0.2);
}

.data-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding-bottom: 16px;
    margin-bottom: 16px;
}

.company-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}

.timestamp {
    font-size: 0.8rem;
    color: var(--text-sub);
    font-weight: 500;
    white-space: nowrap;
    padding-top: 4px;
}

.data-card-body {
    flex-grow: 1;
}

.data-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px 20px;
    margin-bottom: 20px;
}

.data-grid-secondary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px 20px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(0,0,0,0.05);
}

.data-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.data-label {
    font-size: 0.75rem;
    color: var(--text-sub);
    font-weight: 600;
}

.data-value {
    font-size: 0.9rem;
    color: var(--text-main);
}

.data-value a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 600;
}
.data-value a:hover { text-decoration: underline; }

.data-section {
    margin-top: 20px;
}

.data-section-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-section p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #334155;
}

.empty-state.card {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px;
}

.data-card-footer {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid rgba(0,0,0,0.05);
    display: flex;
    justify-content: flex-end;
}

/* =========================================
   文件上传区域
   ========================================= */
.upload-box input[type="file"] {
  font-size: 0.9rem;
  padding: 10px;
  border-radius: var(--radius-input);
  border: 1px dashed #cbd5e1;
  background: #f8fafc;
  cursor: pointer;
}
.upload-box input[type="file"]:hover {
  border-color: var(--accent-primary);
}

/* =========================================
   按钮样式
   ========================================= */
.actions { 
  display: flex; 
  justify-content: flex-end; 
  gap: 16px; 
  margin-top: 32px; 
  border-top: 1px solid rgba(0,0,0,0.05);
  padding-top: 32px;
}

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-input);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.btn-primary {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: 0 8px 20px -5px var(--accent-glow);
}
.btn-primary:hover { box-shadow: 0 12px 25px -5px rgba(99, 102, 241, 0.4); transform: translateY(-2px); }

.btn-ghost {
  background: transparent;
  color: var(--text-sub);
  border: 1px solid #e2e8f0;
}
.btn-ghost:hover { background: #f8fafc; color: var(--text-main); }

.btn-danger {
    background: #ef4444;
    color: #fff;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -5px rgba(239, 68, 68, 0.4);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* =========================================
   消息提示框
   ========================================= */
.msg {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translate(-50%, -150%);
  padding: 14px 24px;
  border-radius: 12px;
  font-weight: 600;
  color: #fff;
  z-index: 1000;
  transition: transform 0.5s var(--anim-speed);
  box-shadow: 0 10px 20px rgba(0,0,0,0.1);
  backdrop-filter: blur(10px);
}
.msg.show { transform: translate(-50%, 0); }
.msg.success { background: rgba(22, 163, 74, 0.8); }
.msg.error { background: rgba(220, 38, 38, 0.8); }

/* 动画定义 */
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes popIn {
  from { opacity: 0; transform: scale(0.5); }
  to { opacity: 1; transform: scale(1); }
}

/* =========================================
   登录页 (Login Page)
   ========================================= */
.login-container {
    max-width: 420px;
    margin: 10vh auto; /* 垂直居中，距离顶部有一定距离 */
    padding: 48px;
}

.login-container h1 {
    margin-bottom: 32px;
    text-align: center;
    font-size: 1.8rem;
    font-weight: 700;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form .btn {
    width: 100%;
    margin-top: 12px;
}

.error-message {
    color: var(--accent-primary);
    text-align: center;
    margin-top: 20px;
    font-weight: 500;
    animation: popIn 0.3s;
}

/* =========================================
   输入框扩展
   ========================================= */
input[type="password"],
input[type="search"] {
  width: 100%;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-input);
  font-size: 0.95rem;
  color: var(--text-main);
  font-family: inherit;
  transition: all var(--anim-speed);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.01);
}

input[type="password"]:focus,
input[type="search"]:focus {
  background: #fff;
  border-color: transparent;
  box-shadow: 
    0 4px 20px rgba(0,0,0,0.03),
    0 0 0 2px rgba(99, 102, 241, 0.1);
  transform: translateY(-2px);
}

/* =========================================
   表格单元格特殊样式
   ========================================= */
.intro-cell .intro-content {
  max-height: 150px; /* 限制最大高度 */
  overflow-y: auto; /* 超出部分显示滚动条 */
  padding-right: 10px; /* 为滚动条留出空间 */
  font-size: 0.8rem;
  line-height: 1.6;
}
