/* ========================================
   nister.cn - Tool Pages Shared Styles
   ======================================== */

:root {
  --bg-page: #f5f5f7;
  --bg-card: #ffffff;
  --text-primary: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-tertiary: #86868b;
  --border-card: #e8e8ed;
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --accent-bg: rgba(0,113,227,0.08);
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font-sans);
  background: var(--bg-page);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ========================================
   Tool Page Header
   ======================================== */
.tool-header {
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 0.5px solid var(--border-card);
  position: sticky;
  top: 0;
  z-index: 100;
}

.tool-header-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tool-header-back {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 6px;
  transition: background 0.2s;
}

.tool-header-back:hover {
  background: var(--accent-bg);
}

.tool-header h1 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

/* ========================================
   Tool Content
   ======================================== */
.tool-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 24px 60px;
  flex: 1;
  width: 100%;
}

.tool-description {
  text-align: center;
  margin-bottom: 28px;
}

.tool-description h2 {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 8px;
}

.tool-description p {
  font-size: 14px;
  color: var(--text-tertiary);
}

/* ========================================
   Tool Card Container
   ======================================== */
.tool-card-container {
  background: var(--bg-card);
  border: 0.5px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 32px;
}

/* ========================================
   Form Elements
   ======================================== */
.tool-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text-secondary);
}

.tool-input, .tool-select, .tool-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 0.5px solid var(--border-card);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font-sans);
  color: var(--text-primary);
  background: var(--bg-card);
  outline: none;
  transition: border-color 0.2s;
}

.tool-input:focus, .tool-select:focus, .tool-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}

.tool-textarea {
  resize: vertical;
  min-height: 100px;
}

/* Buttons */
.tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 24px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-sans);
}

.tool-btn:hover {
  background: var(--accent-hover);
}

.tool-btn:active {
  transform: scale(0.97);
}

.tool-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.tool-btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 0.5px solid var(--border-card);
}

.tool-btn-secondary:hover {
  background: var(--bg-page);
}

.tool-btn-row {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

/* ========================================
   Result / Preview Area
   ======================================== */
.tool-result {
  margin-top: 20px;
  padding: 16px;
  background: var(--bg-page);
  border-radius: var(--radius-sm);
  border: 0.5px solid var(--border-card);
  min-height: 60px;
}

.tool-result p {
  font-size: 14px;
  color: var(--text-secondary);
}

.tool-result-image {
  max-width: 100%;
  max-height: 400px;
  border-radius: var(--radius-sm);
  display: block;
  margin: 0 auto;
}

/* ========================================
   File Upload Area (drag & drop)
   ======================================== */
.drop-zone {
  border: 2px dashed var(--border-card);
  border-radius: var(--radius-md);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg-page);
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-bg);
}

.drop-zone-icon {
  font-size: 36px;
  margin-bottom: 12px;
}

.drop-zone-text {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.drop-zone-hint {
  font-size: 12px;
  color: var(--text-tertiary);
}

/* ========================================
   Grid / Row helpers
   ======================================== */
.tool-row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  align-items: flex-end;
}

.tool-row .tool-field {
  flex: 1;
}

/* ========================================
   Font Preview specific
   ======================================== */
.font-sample {
  padding: 12px 16px;
  border: 0.5px solid var(--border-card);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg-card);
}

.font-sample:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-bg);
}

.font-sample .font-name {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-bottom: 4px;
}

.font-sample .font-preview-text {
  font-size: 20px;
  line-height: 1.4;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 600px) {
  .tool-content { padding: 20px 12px 40px; }
  .tool-card-container { padding: 20px; }
  .tool-header h1 { font-size: 14px; }
  .tool-row { flex-direction: column; }
}
