/**
 *Copyright (C), 2025, GOSUN CL
 *file: forms.css
 *brief: 视评图说主题
 *Theme URI: https://faq7777.com
 *author: 视评图说
 *date: 2025年7月7日
 *version: 7.7.0
 */

/* 项目修复：新增全局盒模型重置，统一尺寸计算 */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* forms module: inputs, buttons, labels, general form layout */
input,
textarea,
select,
button {
  font-family: inherit;
  font-size: 1em;
  border-radius: 4px;
}

/* 表格基础样式 */
table {
  background-color: transparent;
  border-spacing: 0;
  border-collapse: collapse;
  width: 100%;
  border-top: solid 1px #e4e4e4;
  border-left: solid 1px #e4e4e4;
}

table th {
  background-color: #f9f9f9;
  text-align: center;
}

table td,
table th {
  padding: 10px 1%;
  border: 1px solid #e4e4e4;
}

/* 图片对齐样式 */
img.alignleft {
  float: left;
  margin: 0 1em 1em 0;
}

img.aligncenter {
  display: block;
  margin: 0 auto;
}

img.alignright {
  float: right;
  margin: 0 0 1em 1em;
}

/* 基础按钮样式 */
button,
.submit,
input[type="submit"] {
  background: var(--spt-primary);
  color: #fff;
  border: none;
  padding: 10px 14px;
  cursor: pointer;
  border-radius: 4px;
}

button:hover,
.submit:hover,
input[type="submit"]:hover {
  opacity: 0.95;
}

input[type="text"],
input[type="email"],
input[type="url"],
textarea {
  border: 1px solid #e4e4e4;
  padding: 8px 10px;
  background: #fff;
  color: var(--text-main);
}

.form-row {
  margin-bottom: 12px;
}

label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  color: #444;
}

/* 评论表单样式 */
#respond {
  position: relative;
  overflow: hidden;
}

/* 项目修复：增加清除浮动样式，修复布局塌陷 */
#respond::after {
  content: "";
  display: table;
  clear: both;
}

#respond .item {
  margin-bottom: 2%;
  position: relative;
}

#respond label {
  display: block;
  font-size: 14px;
  line-height: 1.75em;
  color: #555;
  margin-bottom: 5px;
}

#respond label i {
  font-style: normal;
  color: #f00;
  font-size: 12px;
  margin-left: 5px;
}

#respond .input {
  border: 1px solid #e4e4e4;
  overflow: hidden;
  border-radius: 4px;
}

/* 项目修复：移除独立字体设置，继承主题全局字体 */
#respond .text {
  font-size: 14px;
  line-height: 24px;
  padding: 5px 5%;
  width: 90%;
  display: block;
  border: none;
  border-radius: 3px;
  color: #555;
}

#respond textarea.text {
  height: 110px;
  resize: vertical;
  padding: 5px 1.5%;
  width: 97%;
}

/* 项目修复：修正宽度为 100%，杜绝布局溢出 */
#respond .inp {
  width: 100%;
  overflow: hidden;
}

#respond .inp .item {
  float: left;
  width: 31.333%;
  padding-right: 2%;
}

#respond .verify {
  width: 130px;
  float: left;
  margin-bottom: 0;
}

#respond .verify img {
  display: block;
  cursor: pointer;
  height: 36px;
  width: auto;
  position: absolute;
  left: 110%;
  bottom: 0;
}

#respond .btn {
  overflow: hidden;
  padding-top: 30.5px;
}

#respond .submit {
  float: right;
  background-color: #006abe;
  border: none;
  width: 100px;
  height: 35px;
  color: #fff;
  font-size: 14px;
  border-radius: 3px;
  cursor: pointer;
}

#respond .submit:hover {
  opacity: .85;
}

#cancel-comment-reply-link {
  font-size: 12px;
  color: #999;
  line-height: 2em;
}

@media (max-width: 768px) {
  input[type="text"],
  textarea {
    width: 100%;
  }
  
  .form-row {
    margin-bottom: 10px;
  }
  
  /* 响应式表单适配 */
  #respond .inp .item {
    float: none;
    width: 100%;
    padding-right: 0;
    margin-bottom: 15px;
  }
  
  #respond .verify img {
    position: relative;
    left: 0;
    top: 10px;
    margin-bottom: 10px;
  }
}

/* 搜索表单样式 */
#search form {
  border-radius: 14px;
}

#search .input {
  border-radius: 14px 0 0 14px;
}

#search .text {
  height: 40px;
  line-height: 40px;
  padding: 4px 2% 4px 12px;
  font-size: 14px;
}

#search .submit {
  height: 25px;
  background-size: 44% auto;
}

#search .submit {
  background: transparent;
  background-image: url("../images/search_blue.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 28% auto;
  box-shadow: none;
}

/* 头部搜索区域 - 样式已移至 header.css */
#header #search .submit {
  height: 40px;
}

/* 项目修复：修复颜色语法不兼容，替换为标准 rgba() 语法 */
#header #search .submit {
  background: var(--spt-grad);
  box-shadow: 0 6px 14px rgba(47, 134, 255, 0.35);
}

#header #search .submit:hover {
  filter: brightness(.98);
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(15, 92, 170, 0.45);
}

/* 项目修复：清理重复样式，删除无效的透明覆盖 */
#header #search .submit {
  background-image: url("../images/search_blue.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 28% auto;
}

/* 搜索表单响应式设计 */
@media (width <= 1280px) {
  #header #search form {
    width: 100%;
  }
}

@media (width <= 1024px) {
  #header #search {
    right: 3.125%;
    width: 360px;
  }
  
  #header #search .input {
    margin-right: 52px;
  }
  
  #header #search .text {
    height: 40px;
    line-height: 40px;
  }
  
  #header #search .submit {
    width: 48px;
    height: 48px;
    background-size: 44% auto;
  }
}

@media (width <= 768px) {
  #header #search {
    width: 50%;
    margin: 0 auto;
    background: transparent;
  }
  
  #header #search form {
    border-radius: 14px;
    height: 24px;
  }
  
  #header #search .input {
    border-radius: 14px 0 0 14px;
  }
  
  #search .text {
    height: 40px;
    line-height: 40px;
    padding: 4px 3%;
  }
  
  #search .submit {
    height: 16px;
    background-size: 20% auto;
  }
  
  #header #search .text {
    height: 40px;
    line-height: 40px;
  }
  
  #header #search .submit {
    height: 16px;
    background-size: 20% auto;
  }
}

/* 项目修复：删除所有无效的透明覆盖样式，代码臃肿 */
/* 按钮系统（变量 + 变体） */
/* =================== BUTTON SYSTEM (Variable + Variants) ===================
   目标：建立统一的按钮系统（primary / ghost / icon），并映射现有按钮选择器
   注意：不影响头部搜索按钮（#header #search .submit 拥有更高特异性）
*/

/* Vars */
:root {
  /* 项目修复：补全缺失的 CSS 变量定义 */
  --text-main: #555;
  --btn-radius: 14px;
  --btn-height: 36px;
  --btn-px: 14px;
  --btn-font-size: 14px;
  --btn-shadow: 0 6px 14px rgba(var(--spt-primary-rgb), 0.25);
}

/* Base */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: var(--btn-height);
  padding: 0 var(--btn-px);
  border-radius: var(--btn-radius);
  font-size: var(--btn-font-size);
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform .16s ease, filter .16s ease, box-shadow .16s ease;
}

/* Variants */
.btn-primary {
  background: #f8f9fa;
  color: #495057;
  border: none;
  box-shadow: none;
}

.btn-primary:hover,
.btn-primary.active {
  background: #007bff;
  color: #fff;
  transform: translateY(-1px);
  filter: brightness(.98);
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.4);
}

.btn-ghost {
  background: transparent;
  color: var(--spt-primary);
  border: 1px solid rgba(var(--spt-primary-rgb), 0.45);
}

.btn-ghost:hover {
  background: rgba(var(--spt-primary-rgb), 0.10);
}

.btn-icon {
  width: var(--btn-height);
  height: var(--btn-height);
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--spt-grad);
  color: #fff;
  border: none;
  box-shadow: var(--btn-shadow);
}

.btn-icon:hover {
  transform: translateY(-1px);
  filter: brightness(.98);
  box-shadow: 0 10px 20px rgba(var(--spt-primary-rgb), 0.35);
}

/* Mapping existing selectors to primary style (exclude header search submit by specificity) */
.submit,
.wp-element-button,
input[type='submit'],
input[type='button'],
input[type='reset'] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: var(--btn-height);
  padding: 0 var(--btn-px);
  border-radius: var(--btn-radius);
  font-size: var(--btn-font-size);
  font-weight: 600;
  cursor: pointer;
  background: var(--spt-grad);
  color: #fff;
  border: none;
  box-shadow: var(--btn-shadow);
  transition: transform .16s ease, filter .16s ease, box-shadow .16s ease;
}

.submit:hover,
.wp-element-button:hover,
input[type='submit']:hover,
input[type='button']:hover,
input[type='reset']:hover {
  transform: translateY(-1px);
  filter: brightness(.98);
  box-shadow: 0 10px 20px rgba(var(--spt-primary-rgb), 0.35);
}

/* 强调按钮增强效果 */
.btn-emphasis {
  height: 40px;
  padding: 0 18px;
  border-radius: 18px;
  font-size: 15px;
  background: var(--spt-grad);
  color: #fff;
  border: none;
  box-shadow: 0 10px 20px rgba(var(--spt-primary-rgb), 0.35);
}

.btn-emphasis:hover {
  transform: translateY(-1px);
  filter: brightness(.98);
  box-shadow: 0 14px 28px rgba(var(--spt-primary-rgb), 0.45);
}

/* 按钮尺寸辅助类 */
.btn-sm {
  height: 30px;
  padding: 0 10px;
  border-radius: 12px;
  font-size: 13px;
}

.btn-lg {
  height: 42px;
  padding: 0 16px;
  border-radius: 18px;
  font-size: 15px;
}

/* 验证码样式 */
.yzm {
  position: relative;
}

.yzm img {
  position: absolute;
  right: 0;
  top: 0;
  height: 34px;
}

/* 焦点可见性样式 - 已禁用 */
a:focus-visible,
button:focus-visible,
.submit:focus-visible,
.wp-element-button:focus-visible,
input[type='submit']:focus-visible,
input[type='button']:focus-visible,
input[type='reset']:focus-visible {
  outline: none;
}
