/* 基础样式 */
a{text-decoration:none;color:#356CAF;cursor:pointer;}

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --background: #f5f6fa;
}

body {
    font-family: 'Segoe UI', sans-serif;
    background: var(--background);
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* 导航页样式 */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.tool-card {
    display: block;
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    text-decoration: none;
    color: var(--primary-color);
    max-width: calc((1200px - 2 * 25px) / 3); /* 新增：限制最大宽度，假设容器最大宽度为 1200px，间隔为 25px */
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

/* 工具页通用样式 */
.back-btn {
    display: inline-block;
    padding: 10px 20px;
    margin-bottom: 30px;
    background: var(--primary-color);
    color: white;
    border-radius: 25px;
    text-decoration: none;
    transition: opacity 0.3s;
}

.tool-wrapper {
    background: white;
    border-radius: 15px;
    padding: 20px 30px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.1);
}

/* 文本处理页特定样式 */
.input-area textarea,
.input-area input[type="text"]{
    width: 100%;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    margin: 10px 0;
    box-sizing: border-box;
}

.action-btns {
    display: flex;
    gap: 15px;
    margin: 20px 0;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    background: var(--secondary-color);
    color: white;
}

/* 表单控件样式 */
input[type="radio"],
input[type="checkbox"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--input-border);
    border-radius: 50%; /* 单选框为圆形 */
    margin-right: 8px;
    vertical-align: middle;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

input[type="checkbox"] {
    border-radius: 4px; /* 复选框为方形 */
}

input[type="radio"]:hover,
input[type="checkbox"]:hover {
    border-color: var(--input-hover);
}

input[type="radio"]:checked,
input[type="checkbox"]:checked {
    border-color: var(--input-checked);
    background-color: var(--input-checked);
    position: relative;
}

input[type="radio"]:checked::after {
    content: "";
    width: 10px;
    height: 10px;
    background-color: white;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

input[type="checkbox"]:checked::after {
    content: "✓";
    color: white;
    font-size: 14px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* 标签样式 */
label {
    display: inline-block;
    vertical-align: middle;
    cursor: pointer;
}   

input[type="file"] {
    display: none;
}
.custom-file-upload {
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    background: var(--secondary-color);
    color: white;
    font-size: 16px;
}
.custom-file-upload:hover {
    background: #2980b9;
}

.result-area {
    position: relative;
}

.result-box {
    min-height: 100px;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 10px 20px;
    margin-top: 20px;
    border: 2px dashed #ddd;
}
.think{margin:0 0 6px;}
	.think,
	.think *{font-size:12px;color:#8b8b8b;line-height:1.8em;}

.loading {
  position: relative;
}
.loading::after {
  content: '...';
  position: absolute;
  white-space: pre;
  animation: loading 1s steps(3, end) infinite;
}
@keyframes loading {
  0%, 80%, 100% { 
    content: '...'; 
  }
  40% { 
    content: '.. '; 
  }
  60% { 
    content: '.  '; 
  }
}

.result-toolbar {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 10px;
}
.toolbar-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: var(--secondary-color);
}

/* 悬浮提示框样式 */
.tooltip {
	position: fixed;
	top: 20px;
	left: 50%;
	transform: translateX(-50%);
	background-color: #ff5722;
	color: white;
	padding: 10px 15px;
	border-radius: 5px;
	box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
	display: none;
}

/* 历史记录区域样式 */
.history-area {
    margin-top: 20px;
}

.history-list {
    list-style-type: none;
    padding: 0;
}

.history-list li {
    margin-bottom: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #ddd;
}

/* 全屏弹出框样式 */
.fullscreen-popup {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.8);
	z-index: 999;
}

.popup-content {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	background-color: white;
	padding: 20px;
	border-radius: 5px;
	width: 80%;
	max-width: 800px;
	max-height: 80%;
	overflow-y: auto;
	position: relative;
}

.close-popup {
	position: sticky;
	top: 0;
	float: right;
	cursor: pointer;
	font-size: 24px;
}

.history-item {
	margin-bottom: 20px;
	padding-bottom: 20px;
	border-bottom: 1px solid #ccc;
}

.history-item:last-child {
	border-bottom: none;
}

.history-item strong {
	display: block;
	margin-bottom: 5px;
}

/*md*/
/* 基础代码样式 */
code {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  padding: 0.2em 0.4em;
  margin: 0 2px;
  border-radius: 3px;
  font-size: 0.9em;
}

/* 行内代码样式 */
:not(pre) > code {
  background-color: #f3f4f6;
  border: 1px solid #e5e7eb;
  color: #dc2626; /* 红色系突出显示 */
}

/* 代码块容器 */
pre {
  padding: 1rem;
  margin: 1.5rem 0;
  border-radius: 6px;
  overflow-x: auto;
  background: #f8f8f8;
  border: 1px solid #e5e7eb;
  line-height: 1.5;
}

/* 代码块内容 */
pre code {
  display: block;
  padding: 0;
  margin: 0;
  background: transparent;
  border: none;
  color: #333; /* 默认文本颜色 */
  font-size: 0.9em;
  white-space: pre;
}

/* 暗色主题适配 */
@media (prefers-color-scheme: dark) {
  :not(pre) > code {
    background: #2d2d2d;
    border-color: #404040;
    color: #f97583;
  }
  
  pre {
    background: #1e1e1e;
    border-color: #333;
  }
  
  pre code {
    color: #dcdcdc;
  }
}

/* 语法高亮兼容样式 (需配合 highlight.js) */
.hljs-keyword { color: #d73a49; }      /* 关键字红色 */
.hljs-title { color: #6f42c1; }        /* 标题紫色 */
.hljs-string { color: #22863a; }       /* 字符串绿色 */
.hljs-built_in { color: #005cc5; }     /* 内置函数蓝色 */
.hljs-comment { color: #6a737d; }      /* 注释灰色 */
.hljs-meta { color: #e36209; }         /* 元数据橙色 */