/* =========================================
   CDE (Common Desktop Environment) Theme
   Palette: Default Teal (Mariner)
   Mobile Responsive Version
   ========================================= */

:root {
  /* Core Colors */
  --cde-bg:       #5e7d8a;  /* Desktop Background */
  --win-color:    #7998a5;  /* Window/Panel Surface */
  
  /* 3D Bevels */
  --bevel-hi:     #b4d3e0;  /* Highlight */
  --bevel-lo:     #3d545e;  /* Shadow */
  
  /* Content Area */
  --paper-bg:     #eeeeee;
  --text-main:    #000000;
  --link-color:   #b03030;
}

/* Global Settings */
body {
  margin: 0;
  padding: 15px;
  background-color: var(--cde-bg);
  /* CDE Dithered Pattern */
  background-image: linear-gradient(45deg, rgba(0,0,0,0.05) 25%, transparent 25%, transparent 75%, rgba(0,0,0,0.05) 75%), 
                    linear-gradient(45deg, rgba(0,0,0,0.05) 25%, transparent 25%, transparent 75%, rgba(0,0,0,0.05) 75%);
  background-size: 4px 4px;
  background-position: 0 0, 2px 2px;
  
  /* Font Stack with Chinese Support */
  font-family: "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif;
  color: #000;
  line-height: 1.6;
}

.container {
  max-width: 1250px; /* Wider layout for desktop */
  margin: 0 auto;
}

/* =========================================
   3D Bevel Utilities
   ========================================= */

.cde-outset {
  background-color: var(--win-color);
  border-style: solid;
  border-width: 2px;
  border-top-color: var(--bevel-hi);
  border-left-color: var(--bevel-hi);
  border-right-color: var(--bevel-lo);
  border-bottom-color: var(--bevel-lo);
}

.cde-inset {
  background-color: var(--paper-bg);
  border-style: solid;
  border-width: 2px;
  border-top-color: var(--bevel-lo);
  border-left-color: var(--bevel-lo);
  border-right-color: var(--bevel-hi);
  border-bottom-color: var(--bevel-hi);
}

/* =========================================
   UI Components
   ========================================= */

/* Front Panel (Navigation) */
.front-panel {
  display: flex;
  align-items: center;
  padding: 6px;
  margin-bottom: 25px;
  gap: 8px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
  flex-wrap: wrap;
}

.nav-label {
  font-weight: bold; 
  margin-right: 5px;
  white-space: nowrap;
}

.nav-spacer {
  flex-grow: 1;
}

/* Buttons */
.cde-btn {
  text-decoration: none;
  color: #000;
  font-weight: bold;
  font-size: 14px;
  padding: 6px 12px;
  background-color: var(--win-color);
  border: 2px solid;
  border-top-color: var(--bevel-hi);
  border-left-color: var(--bevel-hi);
  border-right-color: var(--bevel-lo);
  border-bottom-color: var(--bevel-lo);
  text-align: center;
  white-space: nowrap;
}
.cde-btn:hover { background-color: #8ab0bf; }
.cde-btn:active {
  border-top-color: var(--bevel-lo);
  border-left-color: var(--bevel-lo);
  border-right-color: var(--bevel-hi);
  border-bottom-color: var(--bevel-hi);
}

/* IPA Widget (Integrated styles) */
.ling-widget {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  padding: 0;
  height: 32px;
  width: 80px;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--bevel-lo);
}

#ipa-widget-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Main Window */
.main-window {
  padding: 4px;
  box-shadow: 8px 8px 0 rgba(0,0,0,0.2);
  width: 100%;
  overflow: hidden; 
}

.title-bar {
  background-color: var(--win-color);
  padding: 4px 6px;
  margin-bottom: 5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
  font-size: 13px;
  white-space: nowrap;
}
.title-bar.active {
  background-color: #a7525e; 
  color: white;
  box-shadow: inset 1px 1px 0 var(--bevel-lo);
}

.grip-lines {
  flex-grow: 1;
  margin: 0 8px;
  height: 4px;
  border-top: 1px solid var(--bevel-lo);
  border-bottom: 1px solid var(--bevel-hi);
  min-width: 10px;
}

.content-pane {
  padding: 20px;
  font-family: "Georgia", "Times New Roman", serif;
  color: var(--text-main);
  overflow-x: auto;
}

/* Markdown Typography */
h1 { font-size: 1.8em; margin-top: 0.5em; border-bottom: 1px solid #999; }
h2 { font-size: 1.4em; }
h3 { font-size: 1.2em; }
a { color: var(--link-color); }
img {
  max-width: 100%;
  height: auto;
  border: 2px solid var(--bevel-lo);
  padding: 4px;
  background: #fff;
  box-sizing: border-box;
}
.profile-img {
  float: right;
  width: 120px;
  margin-left: 15px;
  margin-bottom: 10px;
}
pre {
  background: #ddd;
  border: 1px solid #999;
  padding: 10px;
  font-family: "Courier New", monospace;
  font-size: 13px;
  overflow-x: auto;
}

/* =========================================
   Mobile Responsiveness
   ========================================= */

@media (max-width: 600px) {
  /* Front Panel Adjustments */
  .front-panel {
    justify-content: space-between;
    padding: 8px;
  }

  /* Hide labels and spacers */
  .nav-label, .nav-spacer {
    display: none;
  }

  /* Buttons: 2-column layout */
  .cde-btn {
    width: 48%;
    margin-bottom: 5px;
    font-size: 13px;
    padding: 10px 0; /* Larger touch target */
  }

  /* Widget: Full width and taller on mobile */
  .ling-widget {
    margin-top: 8px;
    width: 100% !important;
    height: 100px;
    order: 99; /* Force to bottom */
  }

  /* Title Bar Adjustments */
  .title-bar {
    padding: 6px;
  }
  
  .grip-lines {
    display: none;
  }
  
  .content-pane {
    padding: 15px;
  }
  
  .profile-img {
    float: none;
    display: block;
    margin: 0 auto 15px auto;
    width: 150px;
  }
}
