/* ============================================================
   提交页面 (submit.php) 样式修复
   ============================================================ */

/* 表单容器 */
.submit-form {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px 0;
}
.submit-form .form-group {
    margin-bottom: 18px;
}
.submit-form label {
    display: block;
    font-weight: 500;
    font-size: 14px;
    color: #2d3748;
    margin-bottom: 4px;
}
.submit-form label .required {
    color: #e53e3e;
    margin-left: 2px;
}
.submit-form input[type="text"],
.submit-form input[type="url"],
.submit-form textarea,
.submit-form select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #f7fafc;
    outline: none;
    color: #2d3748;
}
.submit-form input:focus,
.submit-form textarea:focus,
.submit-form select:focus {
    border-color: #4a6cf7;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.08);
}
.submit-form textarea {
    min-height: 80px;
    resize: vertical;
}
.submit-form .captcha-row {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}
.submit-form .captcha-row input {
    flex: 1;
    min-width: 150px;
}
.submit-form .captcha-row img {
    height: 42px;
    border-radius: 10px;
    cursor: pointer;
    border: 1px solid #e2e8f0;
    background: #f7fafc;
}
.submit-form .btn-submit {
    background: #4a6cf7;
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    width: 100%;
}
.submit-form .btn-submit:hover {
    background: #3a5cd9;
    transform: translateY(-1px);
}
.submit-form .btn-submit:active {
    transform: scale(0.98);
}
.submit-form .alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 14px;
    border: 1px solid transparent;
}
.submit-form .alert-success {
    background: #f0fff4;
    color: #22543d;
    border-color: #c6f6d5;
}
.submit-form .alert-error {
    background: #fff5f5;
    color: #9b2c2c;
    border-color: #fed7d7;
}

/* 提示信息 */
.submit-tips {
    background: #fffbeb;
    border-left: 4px solid #f6ad55;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #4a5568;
    line-height: 1.8;
}
.submit-tips p {
    margin: 0 0 4px 0;
}
.submit-tips p:last-child {
    margin-bottom: 0;
}
.submit-tips .tips-title {
    font-weight: 600;
    color: #1a202c;
}
.submit-tips a {
    color: #4a6cf7;
    text-decoration: none;
}
.submit-tips a:hover {
    text-decoration: underline;
}

/* 手机端适配 */
@media (max-width: 768px) {
    .submit-form {
        padding: 12px 0;
    }
    .submit-form .captcha-row {
        flex-wrap: wrap;
    }
    .submit-form .captcha-row img {
        width: 100%;
        height: 48px;
    }
    .submit-tips {
        padding: 12px 14px;
        font-size: 13px;
    }
}

/* 深色模式适配 */
body.dark-mode .submit-form label {
    color: #cbd5e0;
}
body.dark-mode .submit-form input[type="text"],
body.dark-mode .submit-form input[type="url"],
body.dark-mode .submit-form textarea,
body.dark-mode .submit-form select {
    background: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
}
body.dark-mode .submit-form input:focus,
body.dark-mode .submit-form textarea:focus,
body.dark-mode .submit-form select:focus {
    border-color: #4a6cf7;
    background: #3a4460;
}
body.dark-mode .submit-form .alert-success {
    background: #1a3a2a;
    color: #9ae6b4;
    border-color: #2f855a;
}
body.dark-mode .submit-form .alert-error {
    background: #3a1a1a;
    color: #fc8181;
    border-color: #9b2c2c;
}
body.dark-mode .submit-tips {
    background: #2a2a2a;
    border-left-color: #d69e2e;
    color: #cbd5e0;
}
body.dark-mode .submit-tips .tips-title {
    color: #e2e8f0;
}
/* ===== 提交页两栏布局 ===== */
.submit-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  align-items: start;
}
.submit-main { min-width: 0; }
.rank-side { position: sticky; top: 20px; }

/* ===== 排行榜卡片 ===== */
.rank-card {
  background: #fff;
  border: 1px solid #eef2f6;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,.03);
}
.rank-head { margin-bottom: 12px; }
.rank-title {
  font-size: 15px; font-weight: 700; color: #1a202c;
  display: flex; align-items: center; gap: 6px; margin-bottom: 12px;
}
.rank-title i { color: #ff6b3d; font-size: 17px; }

.rank-tabs {
  display: flex; gap: 4px;
  background: #f4f6fa; border-radius: 10px; padding: 3px;
}
.rank-tab {
  flex: 1; border: 0; background: none; cursor: pointer;
  padding: 7px 0; border-radius: 8px;
  font-size: 13px; color: #64748b; transition: .2s;
}
.rank-tab:hover { color: #4a6cf7; }
.rank-tab.active {
  background: #fff; color: #4a6cf7; font-weight: 600;
  box-shadow: 0 1px 4px rgba(74,108,247,.14);
}

.rank-panel { display: none; }
.rank-panel.active { display: block; }

.rank-list { list-style: none; margin: 0; padding: 0; }
.rank-list li { margin: 0; }
.rank-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 6px; border-radius: 10px;
  text-decoration: none; color: inherit;
  transition: background .18s;
}
.rank-item:hover { background: #f6f9ff; }

/* 排名徽章 */
.rank-no {
  flex: none;
  width: 22px; height: 22px; border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #94a3b8; background: #f1f5f9;
}
.rank-no.rn-1 {
  background: linear-gradient(135deg, #ffd666, #ff9f43);
  color: #fff; box-shadow: 0 2px 6px rgba(255,159,67,.35);
}
.rank-no.rn-2 {
  background: linear-gradient(135deg, #cfd8e8, #a8b6cc);
  color: #fff; box-shadow: 0 2px 6px rgba(168,182,204,.35);
}
.rank-no.rn-3 {
  background: linear-gradient(135deg, #f0b27a, #d98b4a);
  color: #fff; box-shadow: 0 2px 6px rgba(217,139,74,.35);
}

.rank-icon {
  flex: none; width: 30px; height: 30px; border-radius: 8px;
  object-fit: contain; background: #f8fafc; border: 1px solid #eef2f6; padding: 3px;
}

.rank-info {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.rank-name {
  display: block;
  width: 100%;
  max-width: 100%;
  font-size: 13.5px;
  font-weight: 500;
  color: #1a202c;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rank-cat {
  display: block;
  width: 100%;
  max-width: 100%;
  font-size: 11px;
  color: #a0aec0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rank-item {
  min-width: 0;
  overflow: hidden;
}
.rank-count {
  flex: 0 0 auto;
  white-space: nowrap;
}
.rank-count {
  flex: none; font-size: 13px; font-weight: 600; color: #4a6cf7;
  font-variant-numeric: tabular-nums;
}
.rank-count em { font-style: normal; font-size: 11px; color: #a0aec0; margin-left: 1px; }

.rank-empty {
  text-align: center; color: #a0aec0;
  font-size: 13px; padding: 30px 0;
}

.rank-note {
  margin-top: 10px; padding: 8px 10px;
  background: #f8fafd; border-radius: 8px;
  font-size: 11.5px; color: #94a3b8; line-height: 1.6;
}

.rank-foot {
  margin-top: 12px; padding-top: 12px;
  border-top: 1px solid #f1f5f9; text-align: center;
}
.rank-foot a {
  font-size: 13px; color: #4a6cf7; text-decoration: none;
  display: inline-flex; align-items: center; gap: 2px;
}
.rank-foot a:hover { text-decoration: underline; }

/* 暗色 */
body.dark-mode .rank-card { background: #1a2035; border-color: #26304a; }
body.dark-mode .rank-title { color: #e2e8f0; }
body.dark-mode .rank-tabs { background: #141a2e; }
body.dark-mode .rank-tab.active { background: #26304a; color: #8ba3ff; }
body.dark-mode .rank-name { color: #e2e8f0; }
body.dark-mode .rank-item:hover { background: #222b45; }
body.dark-mode .rank-no { background: #26304a; color: #94a3b8; }
body.dark-mode .rank-icon { background: #141a2e; border-color: #26304a; }
body.dark-mode .rank-foot { border-top-color: #26304a; }

/* 响应式 */
@media (max-width: 1100px) {
  .submit-layout { grid-template-columns: 1fr; }
  .rank-side { position: static; }
}
/* ============================================================
   榜单行防撑破（覆盖 page.css 的 .rank-list li display:flex）
   ============================================================ */
.rank-card .rank-list li {
    min-width: 0 !important;
    overflow: hidden !important;
}
.rank-card .rank-list li > .rank-item {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
}
.rank-card .rank-info {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    width: 100% !important;
    overflow: hidden !important;
}
.rank-card .rank-name,
.rank-card .rank-cat {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}
.rank-card .rank-count {
    flex: 0 0 auto !important;
    margin-left: auto !important;
    white-space: nowrap !important;
}