/* 全局样式重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f5f7fa;
  overflow-x: hidden;
}

/* 布局容器 */
.layout-container {
  display: flex;
  min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
  width: 280px;
  background: linear-gradient(180deg, #2c3e50 0%, #34495e 100%);
  color: white;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.sidebar-header {
  padding: 2rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  text-align: center;
}

.sidebar-header h1 {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
  background: linear-gradient(135deg, #3498db, #9b59b6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-header p {
  font-size: 0.9rem;
  opacity: 0.8;
  color: #bdc3c7;
}

.sidebar-nav {
  padding: 1rem 0;
}

.nav-category {
  margin-bottom: 1.5rem;
}

.nav-category h3 {
  padding: 0.8rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: #ecf0f1;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.nav-links {
  list-style: none;
}

.nav-links li {
  margin-bottom: 0.2rem;
}

.nav-links a {
  display: block;
  padding: 0.8rem 1.5rem;
  color: #bdc3c7;
  text-decoration: none;
  transition: all 0.3s ease;
  border-left: 3px solid transparent;
  font-size: 0.95rem;
}

.nav-links a:hover {
  background: rgba(52, 152, 219, 0.1);
  color: #3498db;
  border-left-color: #3498db;
  padding-left: 2rem;
}

.nav-links a.active {
  background: rgba(52, 152, 219, 0.2);
  color: #3498db;
  border-left-color: #3498db;
  font-weight: 500;
}

/* 主内容区 */
.main-content {
  flex: 1;
  margin-left: 280px;
  min-height: 100vh;
  background: #f5f7fa;
}

/* 头部 */
.content-header {
  background: white;
  padding: 2rem 2.5rem;
  border-bottom: 1px solid #e1e8ed;
  box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

.content-header h1 {
  font-size: 2.2rem;
  color: #2c3e50;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.content-header p {
  color: #7f8c8d;
  font-size: 1.1rem;
}

/* 工具内容区 */
.tools-content,
.tools-showcase {
  padding: 2.5rem;
}

/* 工具分类 */
.tools-section,
.tool-section {
  margin-bottom: 3rem;
}

.tools-section h2,
.tool-section h3 {
  color: #2c3e50;
  margin-bottom: 2rem;
  font-size: 1.6rem;
  font-weight: 600;
  position: relative;
  padding-left: 1rem;
}

.tools-section h2::before,
.tool-section h3::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 100%;
  background: linear-gradient(135deg, #3498db, #9b59b6);
  border-radius: 2px;
}

/* 工具卡片网格 */
.tools-grid,
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

/* 工具卡片 */
.tool-card,
.tool-item {
  background: white;
  border-radius: 12px;
  padding: 1.8rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: all 0.3s ease;
  border: 1px solid #e8ecef;
  position: relative;
  overflow: hidden;
}

.tool-card::before,
.tool-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(135deg, #3498db, #9b59b6);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.tool-card:hover::before,
.tool-item:hover::before {
  transform: scaleX(1);
}

.tool-card:hover,
.tool-item:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.12);
  border-color: #3498db;
}

.tool-card h3,
.tool-info h4 {
  color: #2c3e50;
  margin-bottom: 1rem;
  font-size: 1.3rem;
  font-weight: 600;
}

.tool-card p,
.tool-info p {
  color: #7f8c8d;
  margin-bottom: 1.5rem;
  line-height: 1.6;
  font-size: 0.95rem;
}

.tool-card a {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(135deg, #3498db, #2980b9);
  color: white;
  text-decoration: none;
  padding: 0.7rem 1.4rem;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.tool-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
  width: 100%;
  height: 100%;
}

.tool-icon {
  font-size: 2.5rem;
  margin-right: 1rem;
  flex-shrink: 0;
}

.tool-info {
  flex: 1;
}

.tool-card a:hover {
  background: linear-gradient(135deg, #2980b9, #1f5f8b);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

/* 工具页面布局 */
.tool-layout {
  display: flex;
  min-height: 100vh;
}

.tool-content {
  flex: 1;
  margin-left: 280px;
  background: #f5f7fa;
}

.tool-header {
  background: white;
  padding: 2rem 2.5rem;
  border-bottom: 1px solid #e1e8ed;
  box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

.tool-header h1 {
  color: #2c3e50;
  margin-bottom: 0.5rem;
  font-size: 2rem;
  font-weight: 600;
}

.tool-header p {
  color: #7f8c8d;
  font-size: 1rem;
}

.tool-main {
  padding: 2.5rem;
}

.tool-container {
  max-width: 900px;
  margin: 0 auto;
}

/* 表单样式 */
.form-group {
  margin-bottom: 1.8rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.6rem;
  color: #2c3e50;
  font-weight: 500;
  font-size: 0.95rem;
}

.form-group input,
.form-group textarea,
.form-group select,
.form-control {
  width: 100%;
  padding: 0.9rem 1rem;
  border: 2px solid #e1e8ed;
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: white;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus,
.form-control:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

/* 按钮样式 */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.8rem 1.6rem;
  background: linear-gradient(135deg, #3498db, #2980b9);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s ease;
  margin-right: 0.8rem;
  margin-bottom: 0.8rem;
}

.btn:hover {
  background: linear-gradient(135deg, #2980b9, #1f5f8b);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.btn-secondary {
  background: linear-gradient(135deg, #95a5a6, #7f8c8d);
}

.btn-secondary:hover {
  background: linear-gradient(135deg, #7f8c8d, #6c7b7d);
  box-shadow: 0 4px 12px rgba(149, 165, 166, 0.3);
}

.btn-danger {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.btn-danger:hover {
  background: linear-gradient(135deg, #c0392b, #a93226);
  box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

/* 结果区域 */
.result,
.result-area {
  background: white;
  border: 2px solid #e1e8ed;
  border-radius: 8px;
  padding: 1.2rem;
  margin-top: 1.5rem;
  min-height: 120px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.9rem;
  line-height: 1.5;
}

.result.success {
  border-color: #27ae60;
  background: linear-gradient(135deg, #d5f4e6, #e8f8f5);
}

.result.error {
  border-color: #e74c3c;
  background: linear-gradient(135deg, #fdf2f2, #fef5f5);
}

/* 密码生成器特定样式 */
.result-area h4 {
  color: #2c3e50;
  margin-bottom: 1rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.result-area ul {
  list-style: none;
  padding: 0;
}

.result-area li {
  margin-bottom: 0.8rem;
  padding-left: 0;
  color: #555;
  line-height: 1.6;
}

.result-area li strong {
  color: #2c3e50;
  font-weight: 600;
}

/* 复选框和标签样式优化 */
.form-group label[style*="display: flex"] {
  font-weight: normal !important;
  margin-bottom: 0.3rem;
  align-items: center;
}

.form-group input[type="checkbox"] {
  width: auto;
  margin-right: 0.5rem;
  transform: scale(1.1);
}

/* 滑块样式 */
input[type="range"] {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #e1e8ed;
  outline: none;
  margin: 0.5rem 0;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #3498db;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #3498db;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* 底部 */
footer {
  background: #2c3e50;
  color: white;
  text-align: center;
  padding: 2rem 0;
  margin-top: auto;
}

footer p {
  opacity: 0.8;
  font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 1024px) {
  .sidebar {
    width: 260px;
  }
  
  .main-content,
  .tool-content {
    margin-left: 260px;
  }
}

@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    position: relative;
    height: auto;
  }
  
  .main-content,
  .tool-content {
    margin-left: 0;
  }
  
  .layout-container,
  .tool-layout {
    flex-direction: column;
  }
  
  .content-header,
  .tool-header {
    padding: 1.5rem;
  }
  
  .tools-content,
  .tool-main {
    padding: 1.5rem;
  }
  
  .tools-grid {
    grid-template-columns: 1fr;
  }
  
  .content-header h1,
  .tool-header h1 {
    font-size: 1.8rem;
  }
}
