/* Page-specific styles — core styles in design-system.css + components.css + layouts.css */

.app-container {
  display: flex;
  height: calc(100vh - 120px);
}

/* 控件行覆盖 */
.ctrl-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.ctrl-row label {
  font-size: 12px;
  color: #334155;
  font-weight: 700;
}

.ctrl-row textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px;
  font-size: 12px;
  outline: none;
  font-family: inherit;
  line-height: 1.5;
}

.ctrl-row textarea:focus,
.ctrl-row input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}

.ctrl-row input[type="number"] {
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
  outline: none;
}

.hint {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 4px;
}

/* 复选框 */
.checkbox-row {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  line-height: 1.4;
}

.checkbox-label input[type="checkbox"] {
  margin-top: 2px;
  width: 16px;
  height: 16px;
  accent-color: var(--primary-color);
  flex-shrink: 0;
}

/* 进度条 */
.progress-bar-wrap {
  width: 100%;
  height: 6px;
  background: #f1f5f9;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 4px;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #4f46e5, #06b6d4);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.status-text {
  font-size: 12px;
  color: #64748b;
  margin-top: 8px;
  line-height: 1.4;
}

/* 统计网格 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.stat-item {
  text-align: center;
  padding: 8px 4px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
}

.stat-value {
  display: block;
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
}

.stat-label {
  display: block;
  font-size: 10px;
  color: #94a3b8;
  margin-top: 2px;
}

/* 右侧主区域 */
main {
  background: #f8fafc;
  overflow: auto;
}

.result-container {
  padding: 18px;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* 空状态 */
.empty-state {
  flex: 1;
  background: #fff;
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  color: #64748b;
}

.empty-state i {
  font-size: 36px;
  margin-bottom: 12px;
  color: #cbd5e1;
}

.empty-state p {
  margin: 0;
  font-size: 14px;
}

.empty-state .hint {
  margin-top: 6px;
}

/* 表格区域 */
.table-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  overflow: hidden;
}

.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.table-header h3 {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
}

.table-count {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 600;
}

.table-scroll {
  flex: 1;
  overflow: auto;
}

/* 文章表格 */
#articleTable {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

#articleTable thead {
  position: sticky;
  top: 0;
  z-index: 2;
}

#articleTable th {
  background: #f8fafc;
  padding: 10px 14px;
  text-align: left;
  font-weight: 700;
  color: #64748b;
  font-size: 12px;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}

#articleTable td {
  padding: 10px 14px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  vertical-align: middle;
}

#articleTable tbody tr:hover {
  background: #f8fafc;
}

/* 列宽 */
.col-num { width: 40px; text-align: center; }
.col-title { min-width: 260px; }
.col-time { width: 140px; white-space: nowrap; }
.col-type { width: 60px; text-align: center; }
.col-status { width: 70px; text-align: center; }
.col-link { width: 50px; text-align: center; }
.col-read, .col-like, .col-looking, .col-share, .col-collect, .col-comment {
  width: 70px;
  text-align: right;
}

/* 表格内样式 */
.article-title {
  font-weight: 600;
  color: #0f172a;
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.article-title:hover {
  color: var(--primary-color);
}

.article-type {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.article-type.original { background: #dbeafe; color: #1e40af; }
.article-type.repost { background: #fef3c7; color: #92400e; }
.article-type.normal { background: #f1f5f9; color: #64748b; }

.article-status {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.article-status.normal { background: #dcfce7; color: #166534; }
.article-status.deleted { background: #fef2f2; color: #991b1b; }

.article-link {
  color: var(--primary-color);
  text-decoration: none;
  font-size: 16px;
}

.article-link:hover {
  color: var(--primary-hover);
}

.engagement-loading {
  color: #94a3b8;
  font-size: 12px;
}

.engagement-num {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* 表格行加载动画 */
.row-fetching {
  animation: rowPulse 1.5s ease-in-out infinite;
}

@keyframes rowPulse {
  0%, 100% { background: #fff; }
  50% { background: #f0f9ff; }
}

/* 响应式 */
@media (max-width: 768px) {
  .app-container {
    flex-direction: column;
    height: auto;
  }

  aside {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #e2e8f0;
  }

  .scroll-area {
    max-height: 50vh;
  }

  main {
    min-height: 50vh;
  }
}
