/* 工具页面公共样式 - 支持PC和移动设备 */

/* ========== 全局变量 ========== */
:root { --primary-color: #273747; --secondary-color: #3a506b; --text-color: #2c3e50; --text-light: #6c757d; --border-color: #e9ecef; --background-light: #f8f9fa; --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1); --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.1); --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.15); --border-radius: 8px; --transition: all 0.3s ease; --container-max-width: 1200px; }

/* ========== 全局重置和基础样式 ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; line-height: 1.6; color: var(--text-color); background-color: var(--background-light); max-width: 1220px; margin: 0 auto; box-shadow: 2px 0px 8px 1px rgb(0 0 0 / 50%); padding: 0px 10px; }

/* ========== 头部样式 ========== */
.tool-header { background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%); color: white; box-shadow: var(--shadow-md); position: sticky; z-index: 1000; transition: var(--transition); -webkit-position: sticky; -webkit-top: 0; -webkit-backface-visibility: hidden; backface-visibility: hidden; -webkit-transform: translateZ(0); transform: translateZ(0); }
.tool-header-container { max-width: var(--container-max-width); margin: 0 auto; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; height: 70px; }

/* 固定导航栏的备用方案 - 为不支持 sticky 的浏览器 */
@supports not (position: sticky) { .tool-header { position: fixed; width: 100%; } body { padding-top: 70px; } body .tool-main { margin-top: 0; } }
.tool-header-brand { display: flex; align-items: center; }
.tool-header-logo { display: flex; align-items: center; color: white; text-decoration: none; font-size: 1.5rem; font-weight: 700; transition: opacity 0.3s ease; }
.tool-header-logo:hover { opacity: 0.9; }
.tool-header-logo svg { margin-right: 10px; flex-shrink: 0; }
.tool-header-title { font-weight: 700; }

/* 导航样式 */
.tool-header-nav { display: flex; align-items: center; }
.tool-header-nav-list { display: flex; list-style: none; gap: 8px; align-items: center; }
.tool-header-nav-item { display: flex; align-items: center; }
.tool-header-nav-link { color: white; text-decoration: none; padding: 10px 16px; border-radius: var(--border-radius); transition: var(--transition); font-weight: 500; white-space: nowrap; }
.tool-header-nav-link:hover { background: rgba(255, 255, 255, 0.1); transform: translateY(-1px); }
.tool-header-nav-link.active { background: rgba(255, 255, 255, 0.2); color: white; transform: translateY(-1px); }

/* 移动端菜单按钮 */
.tool-header-menu-btn { display: none; background: none; border: none; cursor: pointer; padding: 8px; border-radius: 4px; transition: var(--transition); z-index: 1001; }
.tool-header-menu-btn:hover { background: rgba(255, 255, 255, 0.1); }
.tool-header-menu-btn span { display: block; width: 25px; height: 3px; background: white; margin: 3px 0; transition: var(--transition); border-radius: 2px; }



/* ========== 工具页面头部 ========== */
.tool-page-header { background: linear-gradient(135deg, rgba(39, 55, 71, 0.1) 0%, rgba(58, 80, 107, 0.1) 100%); border-bottom: 1px solid rgba(255, 255, 255, 0.1); padding: 40px 0; }
.tool-page-container { max-width: var(--container-max-width); margin: 0 auto; padding: 0 20px; text-align: center; }
.tool-page-title { font-size: 2.5rem; font-weight: 700; color: white; margin-bottom: 15px; text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3); }
.tool-page-subtitle { font-size: 1.1rem; color: rgba(255, 255, 255, 0.8); max-width: 600px; margin: 0 auto; line-height: 1.6; }

/* ========== 主要内容区域 ========== */
.tool-main { min-height: calc(100vh - 70px); background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%); }
.tool-content-container { max-width: var(--container-max-width); margin: 0 auto; padding: 40px 20px; }

/* ========== 底部样式 ========== */
.tool-footer { background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%); color: white; box-shadow: var(--shadow-md); position: sticky; transition: var(--transition); width: 100%; min-height: 60px; -webkit-position: sticky; -webkit-bottom: 0; -webkit-backface-visibility: hidden; backface-visibility: hidden; -webkit-transform: translateZ(0); transform: translateZ(0); }
.tool-footer-container { max-width: var(--container-max-width); margin: 0 auto; padding: 40px 20px; display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 40px; }
.tool-footer-section { display: flex; flex-direction: column; }
.tool-footer-title { font-size: 1.2rem; font-weight: 600; margin-bottom: 20px; color: white; position: relative; padding-bottom: 10px; }
.tool-footer-title::after { content: ''; position: absolute; bottom: 0; left: 0; width: 40px; height: 2px; background: var(--primary-color); border-radius: 1px; }

/* 底部导航 */
.tool-footer-nav { display: flex; flex-direction: column; gap: 12px; }
.tool-footer-link { color: rgba(255, 255, 255, 0.8); text-decoration: none; transition: var(--transition); font-size: 0.95rem; }
.tool-footer-link:hover { color: white; transform: translateX(5px); }

/* 底部联系信息 */
.tool-footer-contact { display: flex; flex-direction: column; gap: 8px; }
.tool-footer-contact p { margin: 4px 0; color: rgba(255, 255, 255, 0.8); font-size: 0.95rem; }

/* 底部关于 */
.tool-footer-about { text-align: center; }
.tool-footer-about p { margin: 8px 0; color: rgba(255, 255, 255, 0.8); font-size: 0.95rem; line-height: 1.6; }

/* 底部版权信息 */
.tool-footer-bottom { background: rgba(0, 0, 0, 0.2); padding: 20px 0; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.tool-footer-bottom-container { max-width: var(--container-max-width); margin: 0 auto; padding: 0 20px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 20px; }
.tool-footer-copyright { display: flex; flex-direction: column; gap: 4px; }
.tool-footer-copyright p { margin: 0; color: rgba(255, 255, 255, 0.6); font-size: 0.9rem; }
.tool-footer-links { display: flex; gap: 20px; flex-wrap: wrap; }

/* ========== 返回顶部按钮 ========== */
.back-to-top { position: fixed; bottom: 30px; right: 30px; width: 50px; height: 50px; background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%); border: none; border-radius: 50%; color: white; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-lg); transition: var(--transition); opacity: 0; visibility: hidden; transform: translateY(20px); z-index: 1000; }
.back-to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { transform: translateY(-2px) scale(0.98); box-shadow: var(--shadow-lg); }
.back-to-top:active { transform: translateY(0) scale(0.95); }

/* ========== 响应式设计 ========== */
/* 平板设备 */
@media (max-width: 768px) { .tool-header { z-index: 1000; } .tool-header-container { height: 60px; padding: 0 15px; } .tool-header-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%); box-shadow: var(--shadow-lg); flex-direction: column; padding: 20px; } .tool-header-nav.active { display: flex; } .tool-header-nav-list { flex-direction: column; gap: 8px; width: 100%; } .tool-header-nav-link { padding: 12px 16px; text-align: center; border-radius: var(--border-radius); } .tool-header-menu-btn { display: block; } .tool-header-menu-btn.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); } .tool-header-menu-btn.active span:nth-child(2) { opacity: 0; } .tool-header-menu-btn.active span:nth-child(3) { transform: rotate(-45deg) translate(7px, -6px); } .tool-page-header { padding: 30px 0; } .tool-page-title { font-size: 2rem; } .tool-page-subtitle { font-size: 1rem; } .tool-content-container { padding: 30px 15px; } .tool-footer-container { grid-template-columns: 1fr; gap: 30px; padding: 30px 15px; } .tool-footer-bottom-container { flex-direction: column; text-align: center; gap: 15px; padding: 0 15px; } .tool-footer-links { justify-content: center; } .back-to-top { width: 45px; height: 45px; bottom: 20px; right: 20px; } }
/* 手机设备 */
@media (max-width: 480px) { .tool-header { z-index: 1000; } .tool-header-container { height: 55px; padding: 0 12px; } .tool-header-logo { font-size: 1.3rem; } .tool-header-logo svg { width: 28px; height: 28px; margin-right: 8px; } .tool-header-nav-list { gap: 6px; } .tool-header-nav-link { padding: 8px 12px; font-size: 0.9rem; } .tool-page-header { padding: 20px 0; } .tool-page-title { font-size: 1.8rem; } .tool-page-subtitle { font-size: 0.9rem; } .tool-content-container { padding: 20px 12px; } .tool-footer-container { padding: 20px 12px; gap: 25px; } .tool-footer-section { text-align: center; } .tool-footer-nav { align-items: center; gap: 15px; } .tool-footer-contact { text-align: center; gap: 6px; } .tool-footer-bottom-container { padding: 0 12px; font-size: 0.85rem; } .tool-footer-links { gap: 15px; font-size: 0.9rem; } .back-to-top { width: 40px; height: 40px; bottom: 15px; right: 15px; } }
/* 超小屏幕设备 */
@media (max-width: 360px) { .tool-header-container { padding: 0 10px; } .tool-header-logo { font-size: 1.2rem; } .tool-header-menu-btn { padding: 6px; } .tool-header-menu-btn span { width: 22px; height: 2px; } .tool-footer-container { padding: 15px 10px; } .tool-footer-title { font-size: 1.1rem; } .back-to-top { width: 35px; height: 35px; bottom: 10px; right: 10px; } }

/* ========== 打印样式 ========== */
@media print { .tool-header, .tool-footer, .back-to-top { display: none; } .tool-main { margin-top: 0; background: white; color: black; } }

/* ========== 无障碍支持 ========== */
@media (prefers-reduced-motion: reduce) { * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; } }

/* ========== 高对比度模式 ========== */
@media (prefers-contrast: high) { :root { --primary-color: #0D4F0D; --secondary-color: #1B5E20; --text-color: #000000; --border-color: #000000; } }

/* ========== 深色模式支持 ========== */
@media (prefers-color-scheme: dark) { :root { --text-color: #ffffff; --text-light: #b3b3b3; --border-color: #404040; --background-light: #1a1a1a; } }

/* ========== 固定底部样式兼容性 ========== */
/* 不支持 sticky 的浏览器的备用方案 */
@supports not (position: sticky) { .tool-footer { position: fixed; bottom: 0; width: 100%; } body { padding-bottom: 60px !important; } @media (max-width: 768px) { body { padding-bottom: 50px !important; } } @media (max-width: 480px) { body { padding-bottom: 45px !important; } } }

/* 移动端固定底部适配 */
@media (max-width: 768px) { .tool-footer { min-height: 50px; } }
@media (max-width: 480px) { .tool-footer { min-height: 45px; } }

/* 打印时隐藏固定底部 */
@media print { .tool-footer { position: static !important; display: none; } body { padding-bottom: 0 !important; } }

/* ========== 股票导航栏样式 ========== */
.gupiao-nav { background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%); padding: 5px 0; margin-bottom: 5px; border-radius: 0; }
.gupiao-nav-container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

.gupiao-nav-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }
.gupiao-nav-link { background: rgba(255, 255, 255, 0.1); color: white; padding: 3px 5px; border-radius: 20px; text-decoration: none; font-size: 14px; font-weight: 500; transition: all 0.3s ease; border: 1px solid rgba(255, 255, 255, 0.2); }
.gupiao-nav-link:hover { background: rgba(255, 255, 255, 0.2); transform: translateY(-1px); box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2); }
.gupiao-nav-link.active { background: white; color: var(--primary-color); border-color: white; }

/* 股票导航栏响应式设计 */
@media (max-width: 768px) { .gupiao-nav-links { gap: 8px; } .gupiao-nav-link { font-size: 13px; padding: 6px 12px; } }

/* ========== 移动端菜单样式 ========== */
@media (max-width: 768px) { .tool-header-nav { position: absolute; top: 100%; left: 0; right: 0; background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%); box-shadow: var(--shadow-lg); z-index: 998; padding: 20px; } .tool-header-nav.active { display: flex; } }

/* ========== 通用动画样式 ========== */
@keyframes slideIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.slide-in { animation: slideIn 0.3s ease-out; }
.slide-in-delay { animation: slideIn 0.3s ease-out 0.1s both; }

/* ========== 通用工具组件样式 ========== */
.calc-btn { background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%); color: white; border: none; border-radius: var(--border-radius); padding: 10px 20px; cursor: pointer; font-size: 14px; font-weight: 500; transition: var(--transition); text-decoration: none; display: inline-block; text-align: center; }
.calc-btn:hover { background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%); transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.calc-btn:active { transform: translateY(0); box-shadow: var(--shadow-md); }