/* ==========================================================================
   腾讯文档收集表助手 —— 共用样式
   ========================================================================== */

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #f5f7fa;
  color: #303133;
  font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

[v-cloak] {
  display: none !important;
}

a {
  color: #409eff;
  text-decoration: none;
}

/* ---------------------------------------------------------------- 滚动条 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-thumb {
  background: #c8ccd4;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8adb8;
}

::-webkit-scrollbar-track {
  background: transparent;
}

/* ---------------------------------------------------------------- 登录页 */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: linear-gradient(135deg, #eef3fb 0%, #f7f9fc 45%, #eaf1fd 100%);
}

.login-card {
  width: 100%;
  max-width: 420px;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(31, 45, 61, 0.12);
}

.login-title {
  text-align: center;
  margin-bottom: 4px;
  font-size: 20px;
  font-weight: 600;
  color: #1f2d3d;
}

.login-sub {
  text-align: center;
  margin: 0 0 18px;
  color: #909399;
  font-size: 13px;
}

.login-footer {
  text-align: center;
  color: #c0c4cc;
  font-size: 12px;
  padding: 20px 0 8px;
}

/* ---------------------------------------------------------------- 布局 */
.layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  height: 58px;
  flex: 0 0 58px;
  display: flex;
  align-items: center;
  padding: 0 18px;
  background: #fff;
  border-bottom: 1px solid #e8eaef;
  box-shadow: 0 1px 4px rgba(31, 45, 61, 0.05);
  position: sticky;
  top: 0;
  z-index: 100;
}

.app-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 16px;
  font-weight: 600;
  color: #1f2d3d;
  white-space: nowrap;
}

.app-logo .dot {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: linear-gradient(135deg, #409eff, #2f7fe0);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
}

.app-header-spacer {
  flex: 1;
}

.app-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.quota-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 12px;
  border-radius: 15px;
  background: #ecf5ff;
  color: #409eff;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.quota-badge b {
  font-size: 15px;
}

.user-trigger {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  outline: none;
  color: #303133;
}

.user-trigger:hover {
  background: #f5f7fa;
}

.app-body {
  flex: 1;
  display: flex;
  min-height: 0;
}

.app-aside {
  width: 186px;
  flex: 0 0 186px;
  background: #fff;
  border-right: 1px solid #e8eaef;
}

.app-aside .el-menu {
  border-right: none;
}

.app-main {
  flex: 1;
  min-width: 0;
  padding: 18px;
}

.app-main-inner {
  max-width: 1320px;
  margin: 0 auto;
}

/* 移动端侧栏收起为横向菜单 */
.mobile-menu-bar {
  display: none;
  background: #fff;
  border-bottom: 1px solid #e8eaef;
  overflow-x: auto;
  white-space: nowrap;
  padding: 0 6px;
}

.mobile-menu-bar .el-menu {
  border-bottom: none;
}

/* ---------------------------------------------------------------- 卡片 */
.panel {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 6px rgba(31, 45, 61, 0.06);
  padding: 18px;
  margin-bottom: 16px;
}

.panel-title {
  font-size: 15px;
  font-weight: 600;
  color: #1f2d3d;
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-title .bar {
  width: 3px;
  height: 15px;
  border-radius: 2px;
  background: #409eff;
}

.panel-sub {
  color: #909399;
  font-size: 13px;
  font-weight: 400;
  margin-left: 4px;
}

.panel-desc {
  color: #909399;
  font-size: 13px;
  line-height: 1.7;
  margin: 0 0 14px;
}

.panel-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.panel-toolbar .grow {
  flex: 1;
  min-width: 160px;
}

/* ---------------------------------------------------------------- 统计卡 */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.stat-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 6px rgba(31, 45, 61, 0.06);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.stat-icon {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 21px;
  color: #fff;
}

.stat-icon.blue {
  background: linear-gradient(135deg, #66b1ff, #409eff);
}

.stat-icon.green {
  background: linear-gradient(135deg, #7bd88f, #52c41a);
}

.stat-icon.red {
  background: linear-gradient(135deg, #ff9a9a, #f56c6c);
}

.stat-icon.orange {
  background: linear-gradient(135deg, #ffc069, #fa8c16);
}

.stat-icon.purple {
  background: linear-gradient(135deg, #b39ddb, #7c4dff);
}

.stat-meta {
  min-width: 0;
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.15;
  color: #1f2d3d;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 13px;
  color: #909399;
  margin-top: 3px;
}

/* ---------------------------------------------------------------- 表单 */
.form-grid .el-form-item {
  margin-bottom: 14px;
}

.form-label-tip {
  color: #909399;
  font-weight: 400;
  font-size: 12px;
}

.q-list {
  margin: 0;
}

.question-item {
  padding: 13px 14px;
  border: 1px solid #ebeef5;
  border-radius: 8px;
  margin-bottom: 10px;
  background: #fcfdfe;
}

.question-item.is-missing {
  border-color: #fbc4c4;
  background: #fff8f8;
}

.q-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
}

.q-index {
  color: #909399;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.q-title {
  font-weight: 500;
  color: #303133;
  word-break: break-word;
}

.q-sub {
  color: #909399;
  font-size: 12px;
  margin: -3px 0 8px 20px;
}

.q-hint {
  color: #e6a23c;
  font-size: 12px;
  margin-top: 5px;
}

.q-body .el-radio-group,
.q-body .el-checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
}

.q-body .el-radio,
.q-body .el-checkbox {
  margin-right: 0;
  height: 30px;
}

.submit-bar {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed #e4e7ed;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 22px;
}

.submit-bar .lbl {
  color: #606266;
  font-size: 13px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 10px 18px;
}

.info-item {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 13px;
  min-width: 0;
}

.info-item .k {
  color: #909399;
  flex: 0 0 auto;
}

.info-item .v {
  color: #303133;
  word-break: break-all;
}

/* ---------------------------------------------------------------- 账号卡 */
.account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 14px;
}

.account-card {
  border: 1px solid #ebeef5;
  border-radius: 8px;
  padding: 15px;
  background: #fff;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.account-card:hover {
  border-color: #c6e2ff;
  box-shadow: 0 3px 12px rgba(64, 158, 255, 0.12);
}

.account-top {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 11px;
}

.account-plat {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
}

.account-plat.wechat {
  background: linear-gradient(135deg, #6fd06f, #22b14c);
}

.account-plat.qq {
  background: linear-gradient(135deg, #6ec6ff, #12b7f5);
}

.account-name {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  color: #1f2d3d;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-line {
  font-size: 12px;
  color: #909399;
  line-height: 1.9;
  word-break: break-all;
}

.account-actions {
  margin-top: 11px;
  display: flex;
  gap: 8px;
}

/* ---------------------------------------------------------------- 登录态失效全屏提醒 */
.expired-alert-dialog .el-dialog__header {
  display: none;
}

.expired-alert-dialog .el-dialog__body {
  padding: 0;
  height: 100%;
}

.expired-alert {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  background: #fff;
}

.expired-icon {
  font-size: 76px;
  color: #f56c6c;
  margin-bottom: 18px;
  animation: expired-pulse 1.6s ease-in-out infinite;
}

@keyframes expired-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.06); opacity: .82; }
}

.expired-alert h2 {
  margin: 0 0 14px;
  font-size: 26px;
  color: #303133;
}

.expired-alert .expired-sub {
  max-width: 560px;
  margin: 0 0 22px;
  color: #606266;
  font-size: 15px;
  line-height: 1.8;
}

.expired-alert .expired-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 22px;
}

.expired-alert .expired-tip {
  max-width: 520px;
  color: #909399;
  font-size: 13px;
  line-height: 1.7;
  margin: 0 0 30px;
}

.expired-alert .expired-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ---------------------------------------------------------------- 验证码行 */
.code-row {
  display: flex;
  gap: 10px;
  width: 100%;
}

.code-row .el-input {
  flex: 1;
}

.code-row .el-button {
  flex: 0 0 auto;
  min-width: 108px;
}

/* ---------------------------------------------------------------- 导入链接操作条 */
.import-url-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.import-url-tip {
  color: #909399;
  font-size: 12px;
  line-height: 1.5;
}

/* ---------------------------------------------------------------- 扫码弹窗 */
.qr-box {
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px;
  background: #fafbfc;
  border: 1px dashed #dcdfe6;
  border-radius: 8px;
}

.qr-box img {
  width: 260px;
  height: 260px;
  display: block;
  border-radius: 6px;
  background: #fff;
  image-rendering: -webkit-optimize-contrast;
  box-shadow: 0 1px 6px rgba(0, 0, 0, .06);
}

/* 可点击放大 */
.qr-zoomable {
  cursor: zoom-in;
  transition: transform .15s ease;
}

.qr-zoomable:hover {
  transform: scale(1.02);
}

.qr-hint {
  color: #909399;
  font-size: 12px;
  margin-top: 2px;
}

/* 放大查看层 */
.qr-zoom-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.qr-zoom-wrap img {
  width: 440px;
  height: 440px;
  display: block;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .1);
}

@media (max-width: 560px) {
  .qr-box img { width: 220px; height: 220px; }
  .qr-zoom-wrap img { width: 88vw; height: 88vw; }
}

.qr-text {
  color: #606266;
  font-size: 13px;
  text-align: center;
  line-height: 1.6;
}

.qr-status-tag {
  margin-bottom: 10px;
  text-align: center;
}

/* ---------------------------------------------------------------- 状态色 */
.status-success {
  color: #67c23a;
}

.status-failed {
  color: #f56c6c;
}

.status-running {
  color: #409eff;
}

.status-waiting {
  color: #e6a23c;
}

.status-idle {
  color: #909399;
}

.text-muted {
  color: #909399;
}

.text-mono {
  font-family: Consolas, Monaco, "Courier New", monospace;
  font-size: 12px;
}

.text-clip {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

.text-pre {
  white-space: pre-wrap;
  word-break: break-all;
  font-family: Consolas, Monaco, "Courier New", monospace;
  font-size: 12px;
  background: #f7f8fa;
  border-radius: 6px;
  padding: 10px;
  max-height: 260px;
  overflow: auto;
  margin: 0;
}

.el-table .cell-nowrap .cell {
  white-space: nowrap;
}

.table-empty {
  padding: 12px 0;
}

/* ---------------------------------------------------------------- 管理端 */
.admin-layout {
  min-height: 100vh;
  display: flex;
}

.admin-aside {
  width: 200px;
  flex: 0 0 200px;
  background: #1f2d3d;
  color: #fff;
  display: flex;
  flex-direction: column;
}

.admin-brand {
  height: 58px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 18px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: #1a2532;
  white-space: nowrap;
}

.admin-brand .dot {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: #409eff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex: 0 0 26px;
}

.admin-aside .el-menu {
  border-right: none;
  background: transparent;
  flex: 1;
}

.admin-aside .el-menu-item {
  color: #b8c2cc;
}

.admin-aside .el-menu-item:hover {
  background: #26374a;
  color: #fff;
}

.admin-aside .el-menu-item.is-active {
  background: #26374a;
  color: #409eff;
}

.admin-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: #f5f7fa;
}

.admin-header {
  height: 58px;
  flex: 0 0 58px;
  display: flex;
  align-items: center;
  padding: 0 18px;
  gap: 12px;
  background: #fff;
  border-bottom: 1px solid #e8eaef;
}

.admin-header h1 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  color: #1f2d3d;
}

.admin-content {
  flex: 1;
  min-height: 0;
  padding: 18px;
}

.admin-sidebar-toggle {
  display: none;
}

/* ---------------------------------------------------------------- 分页 */
.pager {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.pager-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---------------------------------------------------------------- 响应式 */
@media (max-width: 992px) {
  .app-aside {
    display: none;
  }

  .mobile-menu-bar {
    display: block;
  }

  .app-main {
    padding: 12px;
  }

  .panel {
    padding: 14px;
  }
}

@media (max-width: 768px) {
  .app-header {
    padding: 0 12px;
  }

  .app-logo span.name {
    display: none;
  }

  .stat-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
  }

  .stat-card {
    padding: 14px;
    gap: 10px;
  }

  .stat-icon {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    font-size: 18px;
  }

  .stat-value {
    font-size: 21px;
  }

  .account-grid {
    grid-template-columns: 1fr;
  }

  .admin-aside {
    position: fixed;
    z-index: 200;
    height: 100%;
    left: 0;
    top: 0;
    transform: translateX(-100%);
    transition: transform 0.25s;
  }

  .admin-aside.open {
    transform: translateX(0);
  }

  .admin-sidebar-toggle {
    display: inline-flex;
  }

  .admin-content {
    padding: 12px;
  }
}

/* 表格横向滚动容器 */
.table-scroll {
  width: 100%;
  overflow-x: auto;
}

.table-scroll .el-table {
  min-width: 760px;
}
